Industrial optimization involves complex constraints, making optimization modeling difficult to automate. Large language models (LLMs) have been explored for generating optimization models from natural language, but their reliability in end-to-end settings remains limited, often producing non-executable, infeasible, or feasible but incorrect solutions. In this work, we study failure modes in LLM-based optimization modeling by decomposing the process into three components: mathematical reasoning, solver usage, and domain knowledge, and constructing datasets that target each aspect. Using these datasets, we analyze how different components relate to errors and find that they are associated with different types of failure, although these relationships are not always strong or consistent. Furthermore, while combining these components improves execution reliability, feasible but incorrect solutions remain the dominant failure mode, suggesting a remaining gap between executability and correctness. These findings highlight limitations of current dataset designs and suggest the importance of data that better capture constraint completeness and formulation accuracy to enhance reliability.
Figures & tables
Figure 1: Overview of the three-step data construction pipeline.
Figure 2: Modeling accuracy and reasoning-token usage. The Math-Opt Reasoning dataset requires reasoning tokens comparable to existing benchmarks, while Solver Usage achieves lower accuracy with similar token lengths. Domain Knowledge requires more tokens due to domain-specific formulation complexity.
Figure 3: Non-executable and infeasible rates. Math-Opt Reasoning shows error rates comparable to existing benchmarks, while Solver Usage has higher non-executable rates and Domain Knowledge higher infeasible rates, highlighting distinct challenges.
Figure 4: Failure patterns across benchmarks: although the non-executable rate decreases with fine-tuning, LLMs still produce wrong objectives (i.e., feasible but incorrect solutions), particularly in more complex tasks.
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 5: Overview of training reasoning LLMs. Left: Rejection Sampling Fine - Tuning (RFT), which generates multiple reasoning traces using Math - Opt Reasoning Data, Solver Usage Data, and Domain Knowledge Seed Data, using only solver - verified correct traces for training. Right: Reinforcement Learning (RL), which trains the model on Solver Usage Data and Domain Knowledge Scaled Data, with solver - executed reasoning traces providing binary rewards based on objective value correctness.
Dataset Variant (Qwen3-1.7B)
Correct
Wrong Obj.
Infeasible
Timeout
Non-exec.
Full
0.394
0.268
0.033
0.000
0.305
W/O Math Opt. Reasoning
0.362
0.310
0.057
0.001
0.271
W/O Solver Usage
0.376
0.249
0.032
0.000
0.343
W/O Domain Knowledge
0.357
0.282
0.037
0.000
0.325
Appendix
Table 1: Ablation study results for Qwen3-1.7B on the full dataset and variants without mathematical reasoning, solver usage, or domain knowledge.
Dataset Variant (Qwen3-4B)
Correct
Wrong Obj.
Infeasible
Timeout
Non-exec.
Full
0.503
0.280
0.044
0.001
0.173
W/O Math Opt. Reasoning
0.500
0.278
0.051
0.001
0.169
W/O Solver Usage
0.459
0.294
0.055
0.000
0.192
W/O Domain Knowledge
0.497
0.304
0.042
0.001
0.157
Appendix
Table 2: Ablation study results for Qwen3-4B on the full dataset and variants without mathematical reasoning, solver usage, or domain knowledge.
Model
ComplexOR
IndustryOR
ComplexLP
NLP4LP
NL4OPT
Average
GPT-5.2
0.595 ± 0.046
0.353 ± 0.037
0.463 ± 0.080
0.791 ± 0.053
0.840 ± 0.037
0.609 ± 0.050
o3
0.552 ± 0.159
0.330 ± 0.119
0.392 ± 0.181
0.748 ± 0.070
0.886 ± 0.074
0.582 ± 0.121
GPT-4.1
0.521 ± 0.100
0.308 ± 0.082
0.427 ± 0.117
0.700 ± 0.068
0.892 ± 0.063
0.570 ± 0.086
gpt-oss-120b
0.472 ± 0.227
0.270 ± 0.113
0.341 ± 0.207
0.590 ± 0.190
0.692 ± 0.253
0.473 ± 0.198
gpt-oss-20b
0.226 ± 0.247
0.125 ± 0.142
0.137 ± 0.185
0.374 ± 0.313
0.460 ± 0.400
0.264 ± 0.257
Qwen3-32B
0.432 ± 0.224
0.295 ± 0.120
0.318 ± 0.198
0.602 ± 0.262
0.672 ± 0.292
0.464 ± 0.219
Appendix
Table 3: Dataset - level accuracy comparison across all models on the benchmarks.
Optimization modeling formulates real-world decision problems as mathematical programs that solvers can use to find optimal decisions. Large language models (LLMs) can automate this process, but the resulting correct formulations can require substantial time and memory to construct and solve, limiting practical scalability. Therefore, we systematically investigate whether LLMs can identify problem structure from natural-language descriptions and apply suitable optimization modeling techniques to generate mathematical models and solver code that solve the problems correctly and efficiently. To this end, we first curate OptTips, a knowledge base of 50 expert modeling techniques in eight families. Using this knowledge, we develop OptDachshund, a multi-agent framework that transforms problems from existing optimization benchmarks into new tasks for evaluating LLMs' use of modeling techniques. It constructs conventional and expert mathematical models with solver code for the same task and data, providing baselines for correctness and computational cost. The resulting EfficientOpt benchmark contains 561 expert-reviewed tasks with paired reference implementations. Evaluation of 11 representative LLMs reveals an efficiency gap on correctly solved tasks with comparable measurements: for every LLM, most generated programs take longer to solve than their expert counterparts. Within the comparable reference-size subset, 57% of programs with correct objective values and fewer variables and linear constraints have longer recorded solver times. Case studies show that different modeling techniques can achieve the same optimal value at similar recorded cost. Faster solving may not reduce execution time if the code takes longer to prepare data and build the model. LLM optimization modeling should therefore be evaluated for both correctness and computational efficiency.
Zhong Li, Xin Huang, Jinhui Wan +6
Great Bay University · Beijing Jiaotong University · Beihang University +1
Large language models (LLMs) have emerged as potential tools for numerical optimization. Despite promising results, their intrinsic optimization capabilities and limitations remain poorly understood, particularly in high dimensions. This paper investigates the ability of LLMs to exploit mathematical problem structures and generate feasible, near-optimal solutions. We develop an evaluation framework that distinguishes solution quality from execution failures, including numerical inaccuracies, constraint violations, and output-format errors. Using representative problems from convex optimization, fractional programming, and constrained projection, we assess LLM performance against deterministic reference solvers across different dimensions. Our results reveal that LLMs can capture useful optimization structures and produce near-optimal solutions, even when their outputs fail to satisfy numerical or formatting requirements. However, reliability deteriorates with increasing problem dimension and depends strongly on the underlying optimization structure. To further investigate the limitations, we deploy an iterative refinement mechanism that provides targeted feedback on feasibility and solution quality. The results demonstrate that iterative refinement substantially improves reliability and extends the range of problem dimensions over which LLMs produce valid solutions. Nevertheless, persistent numerical and structural errors limit their applicability as standalone optimizers. These findings provide insights into the capacity and limits of LLM-based optimization and motivate hybrid approaches that combine LLM reasoning with deterministic numerical verification.
Lingyun Guo, Ali Bereyhi
Edward S. Rogers Sr. Department of Electrical and Computer Engineering (ECE), University of Toronto, Toronto, ON, Canada · Schwartz Reisman Institute (SRI) for Technology and Society
Building mathematical optimization models is critical in operations research (OR), while it requires substantial human expertise. Recent advancements have utilized large language models (LLMs) to automate this modeling process. However, existing works often struggle to verify the correctness of the generated optimization models, without checking the rationality of the constraints and variables or the validity of solutions to the generated models. This hampers the subsequent verification and correction steps, and thus it severely hurts the modeling accuracy. To address this challenge, we propose a novel LLM-based framework with Dual-side Verification (Opt-Verifier) from both structure and solution perspectives, thereby improving the modeling accuracy. The structure-side verification ensures that the modeling structure of the generated optimization models aligns with the original problem description, accurately capturing the problem's constraints and requirements. Meanwhile, the solution-side verification interprets and evaluates the solutions' validity, confirming that the optimization models are logically and mathematically sound. Experiments on popular benchmarks demonstrate that our approach achieves over 20% improvement in accuracy.
Haoyang Liu, Jie Wang, Boxuan Niu +8
MoE Key Laboratory of Brain-inspired Intelligent Perception and Cognition, University of Science and Technology of China · Noah’s Ark Lab, Huawei Technologies · Tianjin University