Abstract
OptiMUS is a Large Language Model (LLM)-based agent designed to bridge the gap between natural language business problems and technical optimization solvers. By automating the formulation, coding, and iterative debugging of Mixed-Integer Linear Programming (MILP) models, OptiMUS nearly doubles the success rate of standard LLM prompting strategies. It achieves an 80% solve rate on the NLP4LP benchmark, demonstrating significant potential for democratizing access to advanced optimization tools.
Introduction
While optimization algorithms for supply chain management or energy grids have become highly efficient, the "modeling" phase remains a major bottleneck. Transforming a messy, real-world business description into a precise mathematical formulation requires specialized expertise that many organizations cannot afford. Large Language Models (LLMs) like GPT-4 show promise in coding and reasoning but face three specific hurdles in optimization: inconsistent variable representation, limited context windows for large-scale numerical data, and the tendency to generate syntactically correct but logically flawed code.
Methods
OptiMUS treats optimization as an iterative software engineering task rather than a single-shot translation. Its modular workflow includes several key components:
- Structured Natural language Optimization Problem (SNOP): A standardized format that separates the problem's logic from its numerical data. Instead of raw numbers, OptiMUS provides metadata (e.g., "the input is a list of prices"), allowing the LLM to write code that reads a JSON file.
- Modular Code Generation: The task is broken into three steps: defining variables, setting constraints, and defining the objective function.
- Automated Testing & Revision: The agent generates unit tests to check for logical consistency. If the code crashes or fails a test, the error message is fed back to the LLM for a "self-fix" cycle.
- Problem Augmentation: If the agent fails, it automatically rephrases the natural language description in multiple ways to find a linguistic interpretation that leads to a correct mathematical model.
Datasets and Modeling Approach
The researchers introduced NLP4LP, a novel benchmark consisting of 52 linear programming (LP) and mixed-integer linear programming (MILP) problems drawn from classic textbooks. Unlike previous math datasets, NLP4LP uses parameters instead of hardcoded numbers, forcing the model to generate general-purpose solver code.
A core innovation of OptiMUS is Data-Agnostic Modeling. By providing only the schema of the data rather than raw values, the system bypasses context window limits and prevents the model from getting bogged down in arithmetic, which LLMs are notoriously bad at.
Key Results and Insights
- Performance Leap: Using GPT-4, OptiMUS achieved a 91% improvement in solve rate compared to basic zero-shot prompting.
- Success Rate: OptiMUS solved approximately 80% of the NLP4LP benchmark, whereas basic prompting hovered around 45%.
- Efficiency: Successful runs generated roughly 4,100 tokens and took less than 7 minutes on average—significantly faster than a human expert drafting and testing a model from scratch.
- Model Disparity: There is a massive "intelligence gap" between GPT-3.5 and GPT-4. GPT-4 effectively uses tests to converge on solutions, whereas GPT-3.5 often generates incorrect tests that mislead the debugging process.
Limitations and Future Work
Current limitations include a reliance on the semi-structured SNOP format and a relatively small dataset scale. Future work will focus on handling completely unstructured documents, expanding the benchmark to hundreds of real-world cases, and fine-tuning LLMs specifically for optimization formulations to further reduce the need for multiple iterations.
Summary updated