[Paper Review] OptiMUS: Optimization Modeling Using MIP Solvers and large language models
OptiMUS is an LLM-based agent that formulates MILP problems from natural language, generates solver code, runs tests, and iteratively fixes issues to solve optimization problems. It is benchmarked on NLP4LP demonstrating near doubling of success versus basic prompting.
Optimization problems are pervasive across various sectors, from manufacturing and distribution to healthcare. However, most such problems are still solved heuristically by hand rather than optimally by state-of-the-art solvers, as the expertise required to formulate and solve these problems limits the widespread adoption of optimization tools and techniques. We introduce OptiMUS, a Large Language Model (LLM)-based agent designed to formulate and solve MILP problems from their natural language descriptions. OptiMUS is capable of developing mathematical models, writing and debugging solver code, developing tests, and checking the validity of generated solutions. To benchmark our agent, we present NLP4LP, a novel dataset of linear programming (LP) and mixed integer linear programming (MILP) problems. Our experiments demonstrate that OptiMUS solves nearly twice as many problems as a basic LLM prompting strategy. OptiMUS code and NLP4LP dataset are available at \href{https://github.com/teshnizi/OptiMUS}{https://github.com/teshnizi/OptiMUS}
Motivation & Objective
- Bridge the expert-knowledge gap in optimization by leveraging LLMs to formulate and solve MILP problems from natural language descriptions.
- Create a standardized SNOP representation to convert natural language into mathematical formulations and solver code.
- Demonstrate improvement over naive prompting through data augmentation, automated testing, and iterative debugging.
- Provide a benchmark NLP4LP dataset to evaluate LLM-assisted optimization modeling and solving.
Proposed method
- Define SNOP to structure optimization problems in natural language with six fields including problem type, info, and solver preferences.
- Transform SNOP into a mathematical formulation with variables, constraints, and objective function.
- Generate Python solver code that reads data from JSON, calls a solver (Gurobi or cvxpy), and outputs results.
- Execute the code and generate unit tests to verify solution validity and constraint satisfaction.
- Automatically revise code using solver errors or test failures until success or max iterations reached.
- Augment the problem with rephrasings and solve each variant to increase the probability of a solution.
Experimental results
Research questions
- RQ1Can an LLM-based agent form correct MILP formulations from natural language descriptions?
- RQ2How do automated testing, debugging, and augmentation affect the solvability and reliability of LLM-generated optimization code?
- RQ3What is the impact of separating numerical data from problem descriptions on LLM scalability and performance?
- RQ4How does OptiMUS compare to basic prompting in solving NLP4LP instances?
- RQ5What is the role of human supervision in improving test quality and solution accuracy?
Key findings
- OptiMUS increases solve rate by 91% over direct prompting.
- NLP4LP comprises 52 instances of LP and MILP problems (41 LP and 11 MILP).
- GPT-4-based runs show progressive improvements with debugging, automated tests, supervised tests, and augmentation.
- Augmentation via problem rephrasing and multiple iterations enables solving problems that single prompts cannot.
- OptiMUS can generate executable solver code using Gurobi or cvxpy and validate outputs with unit tests.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.