TL;DR
OptiChat is a first-of-its-kind, LLM-powered autonomous agent designed to help both experts and non-experts diagnose and fix "infeasible" optimization problems. By combining the reasoning capabilities of GPT-4 with the precision of professional optimization solvers, it translates cryptic mathematical conflicts into actionable natural language advice.
What Problem Does This Paper Address?
In the world of mathematical optimization (like scheduling flights or managing power grids), a model is "infeasible" if its constraints are mathematically impossible to satisfy simultaneously—for example, requiring a factory to produce 100 units while only having enough raw material for 50.
Diagnosing why a model is infeasible is notoriously difficult. Standard solvers can identify an Irreducible Infeasible Subset (IIS)—the smallest group of constraints that conflict—but these are usually presented as dense code or raw equations. Interpreting an IIS requires significant domain expertise and time. Existing "expert systems" from the 1980s and 90s attempted to solve this but relied on rigid, programming-like syntax that remained inaccessible to most practitioners. The authors aim to bridge this "expertise gap" using Large Language Models (LLMs).
Methods
The researchers developed OptiChat, a system that integrates three core components:
- Modeling & Solving: It uses Pyomo (a Python-based optimization language) to define models and Gurobi (a high-performance solver) to identify the IIS.
- The LLM "Brain": GPT-4 acts as the orchestrator, translating user queries, interpreting solver data, and generating explanations.
- Advanced Prompting Suite: To ensure reliability and prevent "hallucinations," the authors employed four specific techniques:
- Expert Chain-of-Thought (CoT): Instructions that force the LLM to follow the step-by-step logic an optimization expert would use.
- Few-shot Learning: Providing the model with specific examples of optimization problems and their correct diagnoses.
- Key-retrieve (Novel): A technique where the system explicitly extracts parameter and constraint names from the code before reasoning, ensuring the LLM doesn't misidentify variables.
- Sentiment Prompting: The agent monitors the user's tone to provide warnings if a user insists on a "risky" model change that might violate physical realities.
To fix the models, OptiChat doesn't just delete constraints. It solves a secondary "slack" optimization problem to suggest the minimal change needed (e.g., "increase your initial stock by 3.34 units") to make the model feasible.
Datasets
The authors evaluated OptiChat using a dataset of 63 infeasible instances derived from well-known sources:
- GAMS Model Library: A standard industry benchmark.
- Pyomo Cookbook: Educational examples from the University of Notre Dame.
- Resource Task Network (RTN): Complex industrial scheduling models.
These instances covered diverse real-world applications, including aircraft allocation, oil refining, power generation, and military manpower planning.
Key Insights and Ideas
- Actionable vs. Abstract: Most tools tell you what is broken; OptiChat tells you how much to change it. By calculating specific "slack" values, it provides a concrete plan for decision-makers.
- The Power of "Key-retrieve": The authors found that simply feeding code to an LLM leads to errors. By first extracting a "key" (a map of code variables to their roles), the LLM's accuracy in identifying the root cause of infeasibility improved significantly.
- Human-in-the-Loop Repair: The system recognizes that some constraints are "hard" (physical laws) and some are "soft" (business targets). It uses sentiment analysis to negotiate with the user, warning them if they try to change a parameter that shouldn't be touched.
- Democratizing Optimization: The study showed that inexperienced users could solve complex infeasibility issues nearly as effectively as experts when using the natural language interface.
Key Results
The researchers conducted a human study with 15 participants (8 inexperienced, 7 experienced):
- High Accuracy: Inexperienced users achieved an 88% success rate in troubleshooting, while experts reached 96.77%.
- User Satisfaction: GPT-4 provided "satisfactory" answers in 90.93% of interactions for non-experts.
- Efficiency: While experts typically spend 15–30 minutes manually diagnosing these models, OptiChat provided near-instant natural language summaries that users found "detailed and insightful."
- Qualitative Feedback: Users specifically praised the agent's ability to explain abstract mathematical conflicts using "real-life examples" tailored to the problem's context (e.g., explaining a worker balance constraint in the context of a warehouse manager's duties).
Limitations and Future Work
- Scalability: While effective for the tested models, extremely large-scale industrial models (with millions of constraints) might exceed the "context window" (memory) of current LLMs.
- Expertise Leveling: Future versions could detect the user's specific background and adjust the technical depth of the explanation accordingly (e.g., using more math for researchers and more business analogies for managers).
- Cost and Latency: The system currently relies on commercial APIs (GPT-4), which involves costs and potential delays compared to local, smaller models.
Summary updated