OptiMind: Teaching LLMs to Think Like Optimization Experts

Zeyi Chen, Xinzhi Zhang, Humishka Zope, Hugo Barbalho, Konstantina Mellou, Marco Molinaro, Janardhan Kulkarni, Ishai Menache, Sirui Li · DOI

Introduction

Mathematical optimization is the backbone of logistics, supply chain management, and energy systems. However, translating a natural language "word problem" into a precise Mixed-Integer Linear Programming (MILP) model is a high-skill task that typically requires years of training in Operations Research (OR). While Large Language Models (LLMs) are proficient at general coding, they often struggle with the nuances of optimization, such as "subtour elimination" in routing problems or sign conventions in flow-conservation constraints. Furthermore, existing benchmarks are often "noisy," containing missing data or incorrect ground-truth answers, which complicates training and evaluation.

Methodology: The OptiMind Framework

OptiMind addresses these challenges by systematically integrating optimization expertise into two stages of the LLM lifecycle: expert-guided data cleaning and hint-augmented inference.

The OptiMind pipeline: integrating expert error analysis into data cleaning and multi-turn inference.
  1. Expert-Guided Data Cleaning (Training): Instead of training on raw synthetic data, the authors mapped problems into 53 canonical classes (e.g., Bin Packing, Traveling Salesman). Experts identified common failure modes for each class. A strong model (GPT-OSS-120B) then regenerated solutions guided by these hints and "majority voting" to ensure high-quality training labels.
  2. Hint-Augmented Inference (Test-time): During inference, the system classifies the input problem and retrieves a targeted "hint" (e.g., "When solving TSP, remember to fix one city's position to avoid subtours").
  3. Test-Time Scaling: The framework employs self-consistency (sampling multiple solutions with majority voting) and multi-turn correction, where generated code is executed in a solver (like Gurobi) and error logs are fed back to the LLM for self-correction.

Datasets and Cleaning Efforts

The study evaluates OptiMind on three challenging benchmarks: IndustryOR, Mamo-Complex, and OptMATH. A significant contribution of this work is the manual re-cleaning of these benchmarks. The authors found that 30–60% of original test instances were incorrect or underspecified. By releasing these cleaned versions, the researchers provide a more reliable foundation for future optimization research.

Key Insights: The Power of the Hint

A core finding is that class-specific hints are highly generalizable. Even for novel problems, knowing the recurrent pitfalls of a specific problem class significantly boosts accuracy.

Example of how expert hints prevent common errors in Traveling Salesman Problem (TSP) formulations.

Expertise, rather than just scale, appears to be the primary bottleneck. By cleaning data and providing structured guidance, a 20B parameter model (GPT-OSS-20B) outperformed much larger open-source models and rivaled proprietary frontier models. Even models like GPT-5 showed accuracy gains when provided with expert hints, suggesting that domain-specific guardrails are universally beneficial.

Results

OptiMind improved absolute formulation accuracy by 13% to 21% over the base GPT-OSS-20B model across all benchmarks. The fine-tuned 20B model achieved a weighted mean accuracy of 81.7%, surpassing all open-source baselines of similar or larger size. Additionally, multi-turn feedback and majority voting provided consistent gains, demonstrating that "thinking longer" (test-time compute) is particularly effective for structured mathematical reasoning.

Limitations and Future Work

Currently, OptiMind focuses strictly on Linear and Mixed-Integer Linear programming. Non-linear problems remain out of scope due to scarce training data. Furthermore, the multi-turn correction relies on solver access (Gurobi). Future work aims to expand these principles to non-linear domains and specialized enterprise-specific scenarios where problem classes are even more specialized.

Summary updated

BibTeX
@misc{chen2025optimind,
  author = {Zeyi Chen and Xinzhi Zhang and Humishka Zope and Hugo Barbalho and Konstantina Mellou and Marco Molinaro and Janardhan Kulkarni and Ishai Menache and Sirui Li},
  title = {{OptiMind: Teaching LLMs to Think Like Optimization Experts}},
  year = {2025},
  eprint = {2509.22979},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.22979},
}
Figure