Mathematical optimization drives decisions in supply chains, logistics, energy, and scheduling, but translating natural-language problems into solver-executable formulations remains a bottleneck. While frontier models show promise for this task, many deployments require small language models (SLMs) that run locally under privacy, latency, and cost constraints. Existing SLMs are limited by noisy data, ambiguous benchmarks, and one-shot inference that ignores the iterative, feedback-driven nature of optimization modeling. To address these challenges, we introduce OptiMind, a system that combines data cleaning and class-specific hints with training using solver feedback. OptiMind distills recurring formulation errors into class-specific hints that guide the repair of ambiguous problems and the regeneration of solution trajectories. This process provides reliable training data, which is then used for multi-turn RL to teach models to revise their formulations in response to solver feedback. At inference time, the same hint library guides further refinement as models revise their solutions over successive turns. To support reliable evaluation, we clean three challenging benchmarks from the literature. On these cleaned benchmarks, our 20B OptiMind-RL model outperforms strong open-source baselines and reaches frontier-model performance under the same protocol. The full hint library, cleaned test data, cleaning logs, and evaluation code are publicly available on Github (https://github.com/microsoft/OptiGuide/tree/main/optimind), and our trained OptiMind-RL model is available on Hugging Face (https://huggingface.co/microsoft/OptiMind-RL).
Figures & tables
Figure 1: Comparison of rollout trajectories between base model without hint, base model with hint, and OptiMind-RL with hint on Mamo-Complex problem_index 147. Red marks the key failures.
Figure 2
Figure 4: Average accuracy for different models under 5 turns. Models colored in blue are open-sourced models up to 32B parameters, and models in purple are closed-sourced frontier models.
IndustryOR
Mamo-Complex
OptMATH
Model
Hints
1 turn
5 turns
1 turn
5 turns
1 turn
5 turns
GPT-OSS-20B
None
66.23
71.89
65.03
86.80
66.68
81.52
SFT
None
68.97
72.43
85.77
90.71
72.95
81.64
Multi-turn RL
None
71.97
75.88
85.36
89.58
75.70
82.92
SFT
Expert
70.50
75.25
89.09
92.04
79.93
88.50
Multi-turn RL
Expert
75.76
78.54
90.00
92.26
85.17
90.99
Table 1: Component comparisons under K=1 . SFT and multi-turn RL are independently trained from GPT-OSS-20B. All values are accuracy (%); full deviations appear in Table 3 .
Figure 5: Left: training comparison across gpt-oss-20b , OptiMind-SFT , and OptiMind-RL under first-turn, no-majority-voting evaluation, with and without expert hints. Right: first-turn accuracy of different models on three cleaned benchmarks with and without expert-curated hints, showing consistent improvements from hints.
Appendix figures & tables32 assets
Supplementary material from the paper’s appendix.
Appendix
Method
Core methodology
Policy optimization
Inference control
ORLM [ Tang et al., 2024 ]
OR-Instruct synthetic data and SFT
–
–
OptMATH [ Lu et al., 2025 ]
Bidirectional data synthesis for optimization modeling
–
–
LLMOPT [ Jiang et al., 2025 ]
Multi-instruction tuning and self-correction
–
Self-correction
SIRL [ Chen et al., 2025 ]
Solver-informed RL with executable code/model verification
RLVR
Instance-enhanced self-consistency
StepORLM [ Zhou et al., 2025 ]
Solver outcome verification plus generative process supervision
W-DPO
GenPRM verification/reranking
Solver-in-the-Loop [ Ao et al., 2026 ]
MDP-based OR model debugging with IIS/solver actions
GRPO
MDP repair policy
Appendix
Table 2: Structured comparison with related optimization-modeling systems.
IndustryOR
Mamo-Complex
OptMATH
Model
Hints
1 turn
5 turns
1 turn
5 turns
1 turn
5 turns
gpt-5
no hint
82.72±2.15
83.23±2.29
87.86±1.55
89.36±1.92
81.83±2.35
89.93±2.12
expert
83.63±2.17
85.15±1.65
92.57±1.19
93.42±0.62
81.35±2.92
90.41±1.85
automatic
65.65±2.71
77.78±1.00
86.57±1.28
91.42±1.51
77.85±2.64
91.18±2.37
hybrid
77.52±4.31
83.58±1.51
78.33±1.01
91.90±0.67
79.73±2.34
91.18±2.22
o4-mini
no hint
72.42±2.33
78.58±2.72
75.95±2.38
87.78±1.15
69.91±3.20
82.64±3.98
Appendix
Table 3: Comprehensive results on expert-cleaned benchmarks in the single-sample setting (majority K=1 ) under different hint configurations. For the gpt-oss-20b -and-below block, the best result in each metric column is bolded.
Figure 6: First-turn accuracy of gpt-oss-20b , OptiMind-SFT , and OptiMind-RL under different hint configurations on the expert-cleaned benchmarks.
Figure 7: Accuracy by problem type on IndustryOR (top), Mamo-Complex (middle) and OptMATH (bottom), measured via first-turn evaluation with gpt-oss-20B (no majority voting). Problem types occurring in less than 2.5% of instances are omitted in the figure. We are using hybrid hints.
Figure 8: Mean accuracy across expert-cleaned and independently cleaned benchmark versions. GPT-5, SIRL-Gurobi32B, o4-mini, and GPT-OSS-20B use no hints and one turn; OptiMind-RL uses expert hints and five turns. All settings use K=1 . Values are drawn from Tables 3 and 4 .
IndustryOR-SIRL
IndustryOR-LogiOR
IndustryOR-Survey
Mamo-Complex-SIRL
Mamo-Complex-Survey
Model
Hints
1 turn
5 turns
1 turn
5 turns
1 turn
5 turns
1 turn
5 turns
1 turn
5 turns
gpt-5
no
69.67
71
68.29
70.12
66.67
68.25
72.57
74.05
65.76
66.21
expert
72
73
76.82
78.04
70.23
69.04
88.17
89.65
85.58
86.48
o4-mini
no
61.33
64.67
66.26
74.79
68.25
69.84
57.96
69.95
58.55
66.67
expert
68.67
70
71.54
74.39
66.67
63.49
81.77
86.53
78.82
86.48
SIRL-Gurobi32B
no
29.25
29.87
38.9
39
47.85
47.85
53.05
53.1
83.06
82.97
Appendix
Table 4: Accuracies under different base models and hint settings on benchmarks cleaned by parallel works. SIRL stands for Chen et al. [2025] , LogiOR stands for Yang et al. [2025a] , and Survey stands for Xiao et al. [2025a] . Best reported result in each metric column is bolded. All values are mean accuracy (%). All comparisons use K=1 .
Figure 9: Top : Accuracies of the gpt-oss-20b base model and OptiMind-SFT across majority voting K and turn counts on the three benchmarks. Bottom : Accuracy of gpt-oss-20b base model and OptiMind-RL over five self-correcting turns on the three benchmarks. All evaluations utilize hybrid hints.
IndustryOR
Mamo-Complex
OptMATH
Model
Hints
1 turn
5 turns
1 turn
5 turns
1 turn
5 turns
Qwen3.5-9B
None
38.59±3.94
61.82±3.30
41.90±2.21
76.10±1.09
44.69±3.55
65.00±2.78
Expert
48.08±6.76
65.05±3.00
59.52±3.90
85.90±2.47
59.38±3.41
73.91±2.25
Qwen-SFT
None
66.87±2.52
67.88±4.25
84.95±2.25
83.81±2.99
77.03±2.63
79.69±4.17
Expert
66.46±1.66
64.85±3.81
86.19±1.75
86.19±1.06
78.28±1.50
79.69±2.41
Qwen-RL-multi
None
69.29±1.53
78.79±1.24
74.00±1.60
90.10±1.19
74.22±5.15
86.25±1.05
Appendix
Table 5: Accuracy (%) for Qwen3.5-9B and fine-tuned variants under no-hint and expert-hint configurations. Values are mean ± sample standard deviation across five inference runs (seeds 0–4), with K=1 .
Model
Hints
1 turn
5 turns
GPT-OSS-20B
None
30.00±8.74
42.50±10.54
GPT-OSS-20B
Reused expert
32.50±10.54
45.00±10.54
OptiMind-SFT
None
33.75±8.44
47.50±12.91
OptiMind-SFT
Reused expert
38.75±12.43
47.50±7.91
OptiMind-RL-single
None
43.75±10.62
45.00±12.08
OptiMind-RL-single
Reused expert
47.50±5.27
48.75±3.95
Appendix
Table 6: Accuracy (%), reported as mean ± sample standard deviation, on the arXiv dataset ( K=1 ). Qwen base/SFT use ten runs and Qwen-RL-multi uses five. “Reused expert” denotes the existing hint library; no custom hints were created for this set.
Model
1 turn
5 turns
GPT-OSS-20B
55.22±4.34
66.30±3.97
OptiMind-SFT
60.65±2.98
66.63±2.46
OptiMind-RL-single
63.80±1.70
67.93±2.47
OptiMind-RL-multi
63.91±4.55
68.04±3.88
GPT-5
59.78±1.09
66.30±0.00
Qwen3.5-9B
33.48±2.36
56.30±2.09
Appendix
Table 7: Accuracy (%) on the standalone 92-problem LogiOR benchmark without hints ( K=1 ). Values are mean ± sample standard deviation across ten GPT-OSS runs, five Qwen runs, and three API repetitions.
Model
Optimization
Agentic
LM-eval
GPT-OSS-20B
65.79
64.75
56.50
OptiMind-SFT
78.19
0.00
48.28
OptiMind-RL
79.48
66.80
56.11
Appendix
Table 8: General capability evaluation. Agentic scores average xLAM and ToolACE; LM-eval scores average ARC-Challenge, HellaSwag, WinoGrande, and TruthfulQA-MC2. Optimization reports average accuracy over IndustryOR, Mamo-Complex, and OptMATH in the first-turn, no-hint setting.
RL variant
Hint strategy
IndustryOR
Mamo-Complex
OptMATH
1 turn
5 turns
1 turn
5 turns
1 turn
5 turns
Single-turn RL
No hint
71.21±2.90
75.38±2.52
86.01±0.86
90.83±0.74
75.93±1.45
81.52±2.44
Expert
72.73±2.02
75.51±1.73
85.12±1.71
89.94±1.15
90.06±1.49
92.86±1.24
Hybrid
71.21±2.47
75.13±2.42
85.42±1.04
89.11±0.81
89.75±1.84
92.31±0.87
Terminal reward only
No hint
64.69±3.15
79.80±2.64
78.54±3.12
89.45±0.68
67.36±1.35
80.87±1.81
Expert
64.60±3.80
80.07±1.98
79.81±1.41
91.84±1.00
71.56±2.39
90.60±1.09
Appendix
Table 9: Ablation for RL rewards. We report accuracies across 1 and 5 turns under the same prompt and evaluation setup. The terminal-reward row optimizes only final-turn correctness. Terminal reward achieves strong final-turn accuracy but degrades first-turn accuracy, while average-turn reward better balances early correctness, repair, and stability.
Figure 10: Ablation on training-data configurations. We compare seven variants of our training data recipe under the first-turn, no-hint setting and report weighted average accuracy across IndustryOR, Mamo-Complex, and OptMATH.
Classification / Hint Strategy
1 turn
5 turn
gpt-oss classifier (ours)
83.81
89.90
Human expert classification
81.04
89.61
All hints, no classification
78.57
89.23
Random classes
72.57
87.23
No hints
70.00
86.57
Appendix
Table 10: Ablation on classification and hinting strategies on Mamo-Complex. We report first-turn and 5-turn accuracies (in percentage points).
Hint
gpt-oss-20B
OptiMind-SFT
IndustryOR
Mamo-Complex
OptMATH
IndustryOR
Mamo-Complex
OptMATH
Raw GPT-5 hints
62.19
66.57
75.91
66.86
80.95
83.43
Refined hints
63.83
67.85
76.34
67.47
82.22
85.54
Refined + filtered hints
61.31
68.14
77.03
69.39
82.76
87.11
Appendix
Table 11: Ablation on automatic hint generation stages. We report first-turn accuracies (in percentage points) for the base model (gpt-oss-20B) and OptiMind-SFT on each benchmark.
Figure 11: From problem description to solution.
Figure 12: Number of error-hint pairs that experts collected per class.
Problem Class
Common error pattern
Hint
Traveling Salesman
Apply MTZ subtour-elimination constraints to the start city, making the ordering constraints infeasible.
Fix the start city’s position, and apply the MTZ constraint for each visited pair of cities except the start city.
Job Shop
Use two binaries for a pair of operations without exclusivity, e.g., both “ a before b ” and “ b before a ” allows inconsistent ordering. Big-M is too small, making the disjunction invalid and incorrectly ruling out feasible schedules.
Use one ordering binary per unordered pair: y{a,b}=1 means operation a is scheduled before b . Set M to 100 plus the sum of processing times of all operations.
Capacitated Facility Lot-Sizing
Backlog is often modeled with the wrong sign on Bt or by using a “net inventory” term ( It−Bt ) inconsistently, which breaks flow conservation.
Use the exact balance equation It−1+xt+Bt=It+dt+Bt−1 .
Appendix
Table 12: Representative examples of error-analysis hints from optimization problem classes.
Figure 13: Example hint for the Traveling Salesman Problem and comparison of the model’s response before and after applying the hint.
Error pattern
Hint
Self-loop arcs (i=j) are mishandled, either by adding undefined self-arcs or by forbidding self-arcs that represent local use, holding, or storage.
Build the arc set from the input data; exclude self-loops only when the instance has no explicit (i,i) arcs, and otherwise preserve them or replace them with explicit local-use variables and matching cost/capacity constraints.
Missing node-wise flow conservation allows flow to be created or destroyed when the model only constrains sources and sinks.
Impose one flow-balance constraint at each node and commodity, e.g., outgoing flow minus incoming flow equals net supply, while adding separate restrictions only when the problem explicitly forbids inflow to sources or outflow from sinks.
Appendix
Table 13: Examples of automatically generated hints.
IndustryOR
Mamo-Complex
OptMATH
Hint strategy
1 turn
5 turns
1 turn
5 turns
1 turn
5 turns
No hint
66.23±3.77
71.89±3.05
65.03±3.91
86.80±1.33
66.68±4.70
81.52±3.60
Expert
68.28±2.61
75.05±1.84
75.85±2.74
89.47±1.27
73.32±4.05
87.39±1.91
Automatic ( gpt-oss-120b )
65.43±2.61
73.63±3.44
63.52±1.76
86.57±0.89
70.07±3.77
84.58±2.57
Hybrid (expert + gpt-oss-120b )
69.29±2.19
75.66±2.26
74.86±3.31
89.90±1.40
74.82±4.28
88.15±1.86
Automatic ( GPT-5 )
61.31±2.65
73.43±2.07
68.14±1.91
85.38±1.43
73.38±3.82
88.83±2.46
Appendix
Table 14: Performance of gpt-oss-20b using automatic hints distilled from an open-source gpt-oss-120b teacher.
Benchmark
Problem Index
Optimization Class
Why the original problem is incorrect
How we fixed it
IndustryOR
24
–
The problem did not state an objective function.
We added a well-specified objective (minimize pollution).
IndustryOR
46
–
The original instance was infeasible but had a ground-truth objective value of 472.3 .
We updated the data to make the instance feasible and adjusted the ground-truth objective accordingly.
OptMATH
35
Facility Location Problem (FLP)
The problem describes selecting towers to cover regions, but the description is missing data about which towers cover which regions.
We generated the missing coverage data semi-automatically and then verified it manually.
OptMATH
36
Job Shop
The instance omits the number of machines and specifies only a partial assignment of jobs to machines.
We generated the missing machine and assignment data semi-automatically and then verified it manually.
Appendix
Table 15: Representative incorrect problems and fixes in IndustryOR and OptMATH.
Benchmark
# (%) Incorrect
Missing Data
Ambiguous
Infeasible
Wrong GT
Underspecified
Specific Solver
Non-linear
Inconsistent
Integral / Fractional
IndustryOR
50 (50%)
0 (0%)
11 (11%)
2 (2%)
25 (25%)
5 (5%)
5 (5%)
1 (1%)
2 (2%)
4 (4%)
MAMO-Complex
106 (51.2%)
15 (7.1%)
3 (1.4%)
2 (0.9%)
42 (19.9%)
0 (0%)
0 (0%)
0 (0%)
4 (1.9%)
43 (20.4%)
OptMATH
68 (41%)
48 (29%)
11 (7%)
1 (0.6%)
10 (6%)
1 (0.6%)
0 (0%)
0 (0%)
0 (0%)
0 (0%)
Appendix
Table 16: High-level breakdown of benchmark errors. Some instances belong to multiple error categories. Percentages are relative to the total number of problems in each benchmark.
Model
Hints
1 turn
5 turns
GPT-OSS-20B
None
33.94
61.82
GPT-OSS-20B
Nonlinear
58.79
86.67
OptiMind-SFT
None
25.45
49.70
OptiMind-SFT
Nonlinear
70.30
89.09
OptiMind-RL-single
None
24.24
43.18
OptiMind-RL-single
Nonlinear
86.74
89.39
Appendix
Table 17: Accuracy (%) on the held-out nonlinear OptMATH subset. Two nonlinear-specific hints are distilled from three separate seed instances.
Parameter
Value
Batch size
16
Learning rate
2e-5
Max prompt length
16384
Max response length
16384
Prompt length truncation
left
Max epochs
3
Appendix
Table 18: SFT training parameters for gpt-oss-20b .
Parameter
Value
Algorithm
GRPO
Initialization
gpt-oss-20b-bf16
Rollout turns
3
GRPO group size
2
Samples per prompt
8
Prompts per step
32
Appendix
Table 19: GRPO training parameters for gpt-oss-20b .
Parameter
Value
Batch size
32
Learning rate
1e-5
Max sequence length
32768
Sequence length truncation
left
Max epochs
3
Appendix
Table 20: SFT training parameters for Qwen3.5-9B.
Parameter
Value
Algorithm
GRPO
Initialization / precision
Qwen3.5-9B / BF16
Rollout turns
3 (early stopping disabled)
Samples per prompt
8
Prompts per rollout
32
Global / micro batch size
256 / 1
Appendix
Table 21: GRPO training parameters for Qwen3.5-9B.
Parameter
Value
Temperature
0.9
Top p
0.95
Max tokens
60000
Appendix
Table 22: Generation / evaluation sampling parameters for the gpt-oss-20b SFT model.
Aircraft Assignment
Aircraft Landing
Bin Packing
Blending Problem
Capacitated Facility Location Problem
Capacitated Lot-sizing Problem (CLSP)
Car Selection Assignment
Contract Allocation
Diet Problem
Factory Planning Problem
Flow Shop Scheduling
Job Shop
Knapsack
Multicommodity Capacitated Network Design
MarketShare
Set Multi-Cover
PortfolioOptimization
Revenue Management Problem
Assignment Problem
Set Cover
Discrete Lot-sizing and Scheduling Problem
Appendix
Table 23: Problem categories obtained from OptMATH
Subclass
Natural Language Example
Knapsack
A hiker is preparing for a 3-day outdoor hiking trip. They need to select the most valuable combination of equipment and supplies from many available options within the limited backpack capacity. The items include: * Tent: weight 5kg, value 90 points * Sleeping bag: weight 3kg, value 80 points* Portable stove: weight 1kg, value 60 points * Drinking water: weight 2kg, value 70 points * Dry food: weight 1.5kg, value 65 points * First aid kit: weight 0.5kg, value 50 points Assuming the backpack has a maximum weight capacity of 10kg, the hiker’s goal is to select the combination of items with the highest total value while not exceeding the weight limit. Each item must be either taken in its entirety or left behind; partial items cannot be taken.
Team Formulation Problem
As a team leader, you have several projects requiring different expertise levels in different areas. You want to assign a set of people to these projects. Each person has a level of expertise in each of the areas. How to assign people to projects to minimize the maximum skill shortage from the project expertise requirement?
Transportation Problem
A company has three warehouses (origins) with supplies of 100, 150, and 200 units, respectively. There are four retail stores (destinations) with demands of 80, 120, 90, and 160 units, respectively. The cost of transporting one unit from each warehouse to each retail store is given. The goal is to determine the optimal transportation plan that minimizes the total transportation cost while meeting all supply and demand constraints.
Appendix
Table 24: Examples of OptMATH classes and their corresponding natural language examples. Original generators: https://github.com/optsuite/OptMATH/tree/main/generators .
Figure 14: A screenshot of the HTML correction table in our supplementary material showing our edits for the IndustryOR benchmark.
Optimization modeling is the process of translating real-world decision problems, often described in natural language, into formal mathematical formulations and executable solver code. While recent advances in large language models have shown promise in automating this process, many approaches focus on one-shot generation or rely on predefined execution-and-repair workflows, without explicitly learning a policy for tool use and revision. This stands in sharp contrast to real-world optimization modeling, which is inherently interactive and proceeds through repeated solve-debug-revise cycles. We introduce PEARL, a system for multi-turn solver-interactive optimization modeling that uses Python execution and mathematical programming solvers inside this loop. Rather than relying on a fixed repair workflow, PEARL learns when to test partial models, how to revise from solver diagnostics, and when to stop. It operates in a multi-turn tool-integrated setting where intermediate execution results, feasibility signals, and solution checks are used to improve both formulations and solver code before finalization. Across diverse optimization benchmarks, PEARL substantially improves executable objective agreement over the same-scale base model and is competitive with strong one-shot and tool-augmented baselines. Notably, PEARL-Qwen3-4B outperforms the much larger DeepSeek-V3.2-685B baseline under direct prompting on both macro- and micro-averaged Pass@1. Code and datasets are provided at https://github.com/AuroraLHL/PEARL.
Hongliang Lu, Zhong Li, Yuxuan Chen +3
Peking University · Great Bay University · Huawei Technologies Co., Ltd
Large language models (LLMs) can translate natural-language optimization problems into solver programs, but reliably producing correct formulations and implementations remains challenging. Existing approaches improve optimization modeling through agentic workflows or task-specific post-training. This raises a practical question: can a lightweight harness using a single model role achieve competitive performance without additional training? We introduce OPTICYCLE and OPTISTATE, two lightweight inference harnesses for optimization modeling, and evaluate them on nine benchmarks comprising 2,634 problems using 11 Qwen variants spanning 0.6B-27B parameters. Our results show that execution-guided revision consistently improves macro accuracy over direct generation for all evaluated models, with gains of up to 49.46 percentage points. Despite their simplicity, both harnesses outperform six adapted agentic workflows in same-model comparisons and four evaluated post-trained optimization models at comparable model sizes, without additional training. Explicit formulation state provides further but model-dependent improvements, suggesting that additional structure is not universally beneficial.
Yunxiang Luo, Xin Xu, Tianhao Chen +7
The Hong Kong University of Science and Technology · Huawei
Optimization problems are pervasive in 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 because the expertise required to formulate and solve these problems limits the widespread adoption of optimization tools and techniques. We introduce a Large Language Model (LLM)-based system designed to formulate and solve (mixed integer) linear programming problems from their natural language descriptions. Our system can develop mathematical models, write and debug solver code, evaluate the generated solutions, and improve efficiency and correctness of its model and code based on these evaluations. OptiMUS is designed as a productivity tool for optimization practitioners who understand the problem domain and can describe it precisely, but seek to accelerate the modeling and implementation workflow. OptiMUS-0.3 utilizes a modular structure to process problems, allowing it to handle problems with long descriptions and complex data without long prompts. Experiments demonstrate that OptiMUS-0.3 outperforms direct-prompting baselines by over 43% on easy and 18% on hard instances. It remains competitive with fine-tuned specialist models on benchmark problems, and outperforms them on real-world case studies (28.6% vs. 0%) where fine-tuned models fail to generalize. Ablation studies show that modular architecture with error correction is central to these gains. A key finding is that system architecture is a stronger driver of performance than model capability. Structured decomposition with targeted error correction enables weaker models to match stronger models under naive prompting, and remains competitive with fine-tuned specialist models without retraining costs.
Ali AhmadiTeshnizi, Wenzhi Gao, Herman Brunborg +3
a School of Management Science and Engineering, Stanford University, Stanford, California 94305 · b Institute for Computational and Mathematical Engineering, Stanford University, Stanford, California 94305