TL;DR
Translating real-world logistics and scheduling headaches into mathematical code that optimization solvers can crunch usually requires a PhD—or a massive, cloud-bound AI. OptiMind teaches a local, 20-billion-parameter small language model (SLM) to match frontier giants like GPT-5 at this task. It pulls this off by auditing messy benchmarks, distilling recurring math blunders into a "cheat sheet" of hints, and training the model via multi-turn reinforcement learning to debug its own formulations using real solver feedback.
What Problem Does This Paper Address?
Every day, supply chains, power grids, and airlines rely on mathematical optimization—specifically Linear and Mixed-Integer Linear Programming (LP/MILP)—to make decisions. While managers can easily describe their problems in plain English, translating those words into strict mathematical variables, objectives, and constraints is a major bottleneck.
Giant frontier models (like GPT-5 or Claude Opus) are getting surprisingly good at writing solver-ready Python code (e.g., GurobiPy). However, warehouses and hospitals often can’t send sensitive operational data to the cloud due to privacy, latency, and cost constraints; they need Small Language Models (SLMs) running locally. Until now, open-source SLMs have struggled mightily here. Unlike general coding, there is no massive "GitHub for optimization" to train on, existing synthetic datasets are riddled with errors, and standard one-shot prompting ignores how human experts actually work: writing a model, running the solver, inspecting the output, and iteratively fixing bugs.
Methods
OptiMind upgrades SLMs across the entire lifecycle—data cleaning, training, and inference—using three main ingredients:
- Class-Specific Hint Library: The authors noticed that models make predictable, structured mistakes on related problems (like swapping inflow and outflow signs in network-flow problems). By analyzing errors via both human experts and an automated teacher-model pipeline, they distilled ~200 compact, preventive "hints" organized across 53 canonical problem classes (e.g., Traveling Salesman).
- Hint-Guided Data Cleaning: Using these hints and stronger teacher models (o4-mini and GPT-OSS-120B with 64-sample majority voting), the team repaired missing data in training questions and regenerated clean solution trajectories and ground-truth objective values.
- Multi-Turn RL with Solver Feedback: Rather than relying solely on standard Supervised Fine-Tuning (SFT), OptiMind uses Group Relative Policy Optimization (GRPO)—a reinforcement learning algorithm—over a 3-turn interactive loop. The model writes Gurobi code, executes it, observes the solver's logs/errors/outputs, and revises its formulation. Crucially, the reward averages executable correctness across all turns, encouraging the model to get it right early and not break working solutions.
At test time, OptiMind classifies the user's problem, injects the matching hints into the prompt, and gives the model up to five turns of solver-assisted self-correction.
Datasets
- Training: Cleaned versions of OR-Instruct (2.2k items) and OptMATH (2.3k regenerated linear problems).
- Cleaned Evaluation Benchmarks: A team of operations research experts manually audited three established, hard benchmarks—IndustryOR, Mamo-Complex, and OptMATH (linear subset)—yielding 469 validated test instances.
- Out-of-Distribution (OOD) Benchmarks: To test generalization, the authors evaluated on LogiOR, held-out nonlinear OptMATH problems, and a newly constructed arXiv dataset featuring eight novel optimization problems pulled directly from recent research papers.
Key Insights and Ideas
- Existing benchmarks were shockingly broken: Manual audits revealed that 50% of IndustryOR, 51% of Mamo-Complex, and 41% of OptMATH test instances had missing data, ambiguities, or flat-out wrong ground-truth answers! Cleaning the test sets alone caused the base model's measured accuracy to jump from 40–60% to 70–90%.
- Execution feedback fixes math errors, not just syntax: Even when Python code runs without crashing, solver outputs expose logical flaws (like inventory exceeding capacity). Multi-turn RL teaches the model to read those numbers and flip an inequality sign on the next turn.
- Hints transfer across model families—even to giants: Hints curated from a 20B model's mistakes boosted a 9B Qwen model and even lifted GPT-5's accuracy by +4.7% on Mamo-Complex, proving domain checklists complement raw reasoning power.
- RL preserves general skills better than SFT: While SFT degraded the base model's general language benchmark scores and broke its agentic tool-calling syntax, OptiMind-RL preserved those broader capabilities.
Key Results
Built on the open-source GPT-OSS-20B base model, OptiMind-RL (with expert hints and 5 solver turns) achieves 78.5% accuracy on IndustryOR, 92.3% on Mamo-Complex, and 91.0% on OptMATH.
- This crushes open-source baselines up to 32B parameters (including
Qwen3-32Band domain-specializedSIRL-Gurobi-32B) by 12.3 to 27.2 percentage points. - Under the same 5-turn budget (without hints for baselines), this 20B model goes toe-to-toe with GPT-5, beating it by 2.9 points on Mamo-Complex and 1.1 points on OptMATH, while trailing by just 4.7 points on IndustryOR.
- Applying the exact same cleaned data and hint recipe to
Qwen3.5-9Bwithout extra human effort yielded massive multi-turn RL gains (+6.3 to +15.8 points over SFT at five turns), confirming the pipeline's portability.
Limitations and Future Work
The authors do not include a dedicated limitations section, though several constraints are noted in the text:
- Linear Focus: The core training pipeline and primary evaluations focus on linear problems (LP/ILP/MILP), with nonlinear optimization explored mainly as a smaller generalization study.
- Objective-Value Proxy: Accuracy is automatically graded by checking if the solver's final objective number matches the ground truth. While an expert audit of 30 correct outputs found zero false positives, matching a single number remains a proxy for full structural correctness.
- Compute Constraints on Ablations: Due to time and compute limits, several ablations (such as training data recipes and automatic hint filtering) were evaluated using SFT checkpoints rather than full RL retraining runs.
Summary updated