Complex Optimization Modeling via Multiagent Fine-Tuning and Skill-Augmented Reasoning

Yu Ding, Jiajun Li, Ran Hou, Jiahui Duan, Guanyu Nie, Xiongwei Han, Tao Zhong, Vincent Chau, Weiwei Wu, Wanyuan WangNeurIPS 2026

TL;DR

Turning messy, real-world business problems into precise mathematical equations usually takes a small army of Operations Research PhDs—and single LLMs tend to trip over their own shoelaces when the logic gets tricky. This paper replaces the lone-wolf LLM with an assembly line of six specialized 7B-parameter agents, teaching them how to collaborate using a clever "who broke it?" debugging loop and an on-demand playbook of math recipes. The result? A compact multi-agent team that outperforms massive frontier models like GPT-4 and DeepSeek-R1 on complex optimization tasks.

What Problem Does This Paper Address?

Every day, airlines schedule crews, factories route supplies, and power grids balance loads using Optimization Modeling (OM)—the art of translating real-world constraints and goals into mathematical formulations that commercial solvers (like Gurobi) can crunch. Automating this translation from plain English to solver code is a dream for industry, and LLMs seem like a natural fit.

While single LLMs handle textbook word problems reasonably well, they hit a wall on industrial-scale problems featuring tangled combinatorial logic and obscure decision variables. Breaking the problem down across a Multiagent System (MAS) helps, but introduces a nasty catch-22: the credit assignment problem. Existing OM datasets only tell you if the final numerical answer is right or wrong. If a six-agent relay team drops the baton and outputs infeasible code, how do you know which intermediate agent messed up so you can fine-tune them without hiring human experts to grade every step?

Methods

The authors tackle this with a three-part framework covering architecture, training, and inference:

Figure 2: Multiagent system (MAS) Workflow for OM.
  1. A Six-Agent Assembly Line: Mirroring how human experts think, the system splits modeling into a strict topological dependency graph of six specialized agents (built on Qwen2.5-7B-Instruct): Set (identifies entities/indices), Parameter and Variable (extract data and define decision variables), Objective and Constraint (write the math logic), and Code (translates everything into Python/Gurobi).
  2. Hierarchical Counterfactual Synthesis (HCS) (Novel): To generate step-by-step training data without human annotators, the authors work backward from failures. When a modeling trajectory fails solver verification, HCS applies a "Minimal Intervention Principle"—resampling from the end of the pipeline upstream (Code $\rightarrow$ Logical $\rightarrow$ Structural $\rightarrow$ Base layers). If resampling only the Constraint Agent fixes the final answer, bingo: the original constraint is flagged as a "hard negative" and the fixed one as a "verified positive." These pairs fuel standard Supervised Fine-Tuning (SFT) and Direct Preference Optimization (DPO) for each individual agent.
  3. Opt-Skill Library (Novel): During inference, a keyword-based router fetches reusable procedural checklists (like flow conservation rules or variable-linking patterns) from a two-level library—covering both general OR patterns and scenario-specific rules—and injects them only into the prompts of the specific agents that need them.

Datasets

  • Training: Synthesized and augmented from public optimization modeling seed problems, using multiple teacher LLMs to establish solver-verified consensus labels (which are used strictly to verify outputs, not generate training text).
  • Evaluation: Tested across five established Operations Research benchmarks spanning textbook problems to gnarly industrial scenarios: NL4Opt, MAMO EasyLP, MAMO ComplexLP, IndustryOR, and OptMATH. No new evaluation benchmarks are introduced.

Key Insights and Ideas

  • Structure alone buys you a free lunch: Even before fine-tuning a single weight, simply splitting a zero-shot 7B model into the six-agent workflow boosts average accuracy from 31.0% to 39.1% across all five benchmarks. Giving LLMs narrow, well-defined sandboxes prevents context overload.
  • Failures are goldmines for credit assignment: Instead of throwing away failed trajectories, bottom-up counterfactual resampling turns sparse binary solver feedback into surgical, component-level supervision—isolating exactly where reasoning went off the rails.
  • Constraints and code are the true bottlenecks: In a "leave-one-agent-untrained" ablation study, swapping the trained Constraint or Code agent back to an untrained base model tanked accuracy by 15.3% and 12.6%, respectively. Meanwhile, swapping out the Objective or Set agent barely caused a dent (-3.4% and -4.0%). Defining the feasible region and writing bug-free solver syntax is where domain alignment matters most.

Key Results

Using a compact Qwen2.5-7B-Instruct backbone for each agent, the proposed system achieves an average accuracy of 67.6% across the five benchmarks.

Table 1: Main results on five optimization modeling benchmarks. Baseline results are taken from prior work [Chen et al., 2025b], while our method is evaluated on the same cleaned benchmark datasets using the same solver-based correctness criterion. The best and second-best results in the reported comparison are highlighted in bold and underlined, respectively.
  • Punching above its weight class: It outperforms massive general and reasoning models, including GPT-4 (55.0%), OpenAI-o3 (57.1%), DeepSeek-R1 (64.6%), and DeepSeek-V3.1 (65.0%).
  • Beating specialized peers: It surpasses single-agent fine-tuned OR models like SIRL-Qwen2.5-7B (60.6%) and LLMOpt-14B (51.1%), as well as prompt-based multi-agent systems like OptiMUS (53.7%).
  • Thriving on complexity: On MAMO ComplexLP, it hits 68.5% (beating DeepSeek-R1's 67.9% and SIRL's 51.7%), and ties DeepSeek-R1 for first place on IndustryOR at 45.0%.
  • Every training stage stacks up: Controlled ablations show steady climbs from MAS Prompting (39.1%) $\rightarrow$ +SFT (57.5%) $\rightarrow$ +DPO (61.5%) $\rightarrow$ +Opt-Skill (67.6%).

Limitations and Future Work

Not discussed in the paper. (Note: The provided text concludes after Section 5 without a dedicated limitations or future work section, though the results show that benchmarks like OptMATH [36.4%, vs. OpenAI-o3's 44.0%] and IndustryOR [45.0%] still leave plenty of headroom for automated industrial modeling).

Summary updated

Abstract

Optimization modeling (OM) is fundamental to address Operations Research (OR) problems, yet it requires specialized domain expertise. Large language models (LLMs) are promising for automating OM from natural language descriptions. Through prompting and fine-tuning, LLMs have made significant progress on easy problems, but they still struggle with complex problems involving combinatorial constraint logic and obscure decision variables. To provide a precise formulation for industry OR problems, this paper proposes a multiagent system (MAS) workflow, which decomposes the entire OM process into six structured sub-tasks: set identification, parameter abstraction, variable definition, objective formulation, constraint derivation, and solver-code generation. Existing OM benchmarks only provide a sparse judgment of the final formulation, without process rewards for intermediate agents. Therefore, the main challenge of MAS-based OM is how to fine-tune intermediate agents with OM domain knowledge. This paper proposes a sample efficient counterfactual-based credit assignment for the MAS trajectory. The augmented intermediate credit can be directly used to fine-tune each agent. Moreover, we construct an Optimization Skill Library (Opt-Skill) that provides agent-specific procedural guidance for skill-augmented reasoning, self-checking, and error correction during inference. Experimental results across five optimization modeling benchmarks demonstrate that the proposed multiagent system achieves competitive performance compared with existing methods and larger LLMs, attaining an average accuracy of $67.6\%$ while maintaining strong performance on both easy and complex optimization modeling tasks.Altogether, we believe that MAS represents a concrete step forward in performing complex OM in industry scenarios.
BibTeX
@inproceedings{ding2026complex,
  author = {Yu Ding and Jiajun Li and Ran Hou and Jiahui Duan and Guanyu Nie and Xiongwei Han and Tao Zhong and Vincent Chau and Weiwei Wu and Wanyuan Wang},
  title = {{Complex Optimization Modeling via Multiagent Fine-Tuning and Skill-Augmented Reasoning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=8DDcXg3IK4},
}
Figure