Strategy-Aware Optimization Modeling with Reasoning LLMs
Abstract
Large language models (LLMs) can generate syntactically valid optimization programs, yet often struggle to reliably choose an effective modeling strategy, leading to incorrect formulations and inefficient solver behavior. We propose SAGE, a strategy-aware framework that makes Modeling Strategy explicit in both data construction and post-training. SAGE builds a solver-verified multi-strategy dataset and trains a student model with supervised fine-tuning followed by Segment-Weighted GRPO using a composite reward over format compliance, correctness, and solver efficiency. Across eight benchmarks spanning synthetic and real-world settings, SAGE improves average pass@1 from 72.7 to 80.3 over the strongest open-source baseline. With multiple generations, SAGE discovers more distinct correct formulations and improves component-level diversity at pass@16 by 19-29%. At the largest scale, SAGE produces more compact constraint systems with 14.2% fewer constraints than the baseline, consistent with solver-efficient modeling. Overall, these results show that making Modeling Strategy explicit improves automated optimization modeling. The code and data are available at https://github.com/rachhhhing/SAGE.
Lay Summary
Optimization is widely used to support decisions in logistics, scheduling, manufacturing, finance, and resource allocation. Before these problems can be solved, human experts must translate a natural-language description into a mathematical optimization model by defining decision variables, objectives, and constraints. This modeling process requires substantial domain knowledge and manual effort, and large language models offer a promising way to automate it. In practice, experts usually begin by choosing a high-level formulation strategy, such as a flow-based, assignment-based, or time-indexed model, which affects correctness and solver efficiency. We introduce SAGE, a framework that teaches language models to make this strategy explicit before generating solver code. SAGE builds a solver-verified training dataset with multiple valid strategies for optimization problems, and further trains the model using solver feedback on format compliance, correctness, and efficiency. Across several optimization benchmarks, SAGE improves formulation accuracy, discovers more diverse correct formulations with multiple samples, and produces models that are easier for solvers to handle. These results suggest that explicitly learning modeling strategies can help language models automate expert-like optimization modeling more reliably and efficiently.