Certified Evaluation for LLMs in Optimization Modeling: From Graph Isomorphism to Formulation Isomorphism

Zhuohan Wang, Ziwei Zhu, Ziniu Li, Congliang Chen, Zhihang Lin, MingZhe Yang, Yizhou Han, Yufeng Lin, Angyang Gu, Xinglin Hu, Ruoyu Sun, Tian DingCTB @ ICML 2026

TL;DR

This paper introduces ORGEval, a novel graph-theoretic framework for evaluating LLMs' ability to translate natural language into optimization models. By reducing formulation equivalence to graph isomorphism and introducing a "symmetric decomposability" condition, ORGEval provides a provably correct and efficient evaluation method, outperforming traditional solver-based approaches. Benchmarking LLMs on their new dataset, Bench4Opt, reveals that current models still struggle significantly with accurate optimization modeling, particularly with constraint formulation.

What Problem Does This Paper Address?

Large Language Models (LLMs) are increasingly capable of handling complex tasks, including generating code and solving problems. However, evaluating their performance on structured outputs, like mathematical optimization models, is challenging. Traditional methods rely on solving the generated models and comparing objective values. This approach has several drawbacks: it doesn't guarantee structural correctness (two different models can yield the same optimal value), it's uninformative for infeasible problems, and it can be computationally expensive. The authors argue that a more precise notion of "formulation-level correspondence" is needed, one that is invariant to superficial changes but sensitive to structural errors in the optimization model. This paper addresses this gap by proposing a theoretically grounded and practically efficient evaluation framework for automated optimization modeling.

Methods

The core of the proposed solution, ORGEval, is a graph-theoretic approach. Optimization models (specifically LP/MILP) are transformed into weighted bipartite graphs, where nodes represent variables and constraints, and edges represent coefficients. Equivalence between two models is then framed as a graph isomorphism problem. To make this computationally feasible and reliable, the authors introduce "symmetric decomposability" (SD), a sufficient condition for graphs. When an instance is SD, the Weisfeiler-Lehman (WL) graph isomorphism test becomes a provably correct method for determining formulation equivalence. ORGEval combines the WL test with an efficient SD verification procedure. This allows for provably correct evaluation for SD-certified instances, offering a significant advantage over heuristic or purely solver-based methods.

Datasets

The authors introduce Bench4Opt, a new benchmark specifically designed for evaluating LLM-generated optimization models. Key features of Bench4Opt include:

  • Model-data separation: Similar to real-world OR practice, formulations (models) are separated from numerical data, allowing the same formulation to be tested with different data configurations.
  • Two abstraction levels: Problems are presented in both structured and unstructured natural language formats to test different levels of LLM guidance.
  • SD-certified ground-truth instances: All ground-truth instances in Bench4Opt are verified to satisfy the symmetric decomposability condition, ensuring the reliability of the evaluation.
  • Coverage: The benchmark includes 197 LP and MILP problems, resulting in 394 word problems across various industry domains.

Key Insights and Ideas

  • Formulation Equivalence as Graph Isomorphism: The paper elegantly reframes the problem of checking if two optimization models are structurally the same as a graph isomorphism problem. This provides a formal and rigorous foundation for evaluation.
  • Symmetric Decomposability (SD) as a Key to Correctness: The introduction of SD is crucial. It acts as a bridge, ensuring that the efficient Weisfeiler-Lehman test, which is generally a heuristic, becomes a provably correct method for determining graph isomorphism (and thus formulation equivalence) for a specific class of optimization problems.
  • The Importance of Structural Evaluation: The paper strongly advocates for structural evaluation over purely solver-based methods. Solver-based evaluation can be misleading due to coincidental optimal values, infeasibility, or solver-specific behavior, whereas structural evaluation directly assesses the model's correctness.
  • LLMs Struggle with Constraints and Variables: The benchmarking results highlight that current LLMs, even advanced ones, face significant challenges in accurately formulating constraints and defining decision variables, which are the dominant failure modes in optimization modeling.

Key Results

  • ORGEval Efficiency and Stability: ORGEval is shown to be substantially faster than solver-based evaluation, especially on challenging instances, and achieves 100% consistency across different data configurations.
  • LLM Performance on Bench4Opt: State-of-the-art LLMs struggle with automated optimization modeling. The best-performing model achieved only 57.11% accuracy on Bench4Opt.
  • Error Analysis: The dominant failure mode for LLMs is incorrect or mis-specified constraints (over 60% of errors), followed by issues with decision variables (around 40%). Objective function errors are relatively rare.
  • Structured vs. Unstructured Prompts: LLMs perform better on structured problem descriptions, indicating that explicit scaffolding aids their modeling capabilities.

Limitations and Future Work

  • SD Condition is Sufficient, Not Necessary: While SD guarantees correct evaluation, not all equivalent formulations might be SD. This means ORGEval might reject some equivalent models if they don't meet the SD criteria.
  • Focus on LP/MILP: The current framework is focused on Linear Programming (LP) and Mixed-Integer Linear Programming (MILP). Extending it to non-linear or more complex optimization problems would be a natural next step.
  • LLM Capabilities: The paper highlights that LLMs still have a long way to go in reliably translating natural language into correct optimization models, particularly concerning the intricate details of constraints and variable definitions. Future work will likely focus on improving LLM architectures and training strategies for this domain.

Summary updated

BibTeX
@inproceedings{wang2026certified,
  author = {Zhuohan Wang and Ziwei Zhu and Ziniu Li and Congliang Chen and Zhihang Lin and MingZhe Yang and Yizhou Han and Yufeng Lin and Angyang Gu and Xinglin Hu and Ruoyu Sun and Tian Ding},
  title = {{Certified Evaluation for LLMs in Optimization Modeling: From Graph Isomorphism to Formulation Isomorphism}},
  booktitle = {CTB @ ICML},
  year = {2026},
  url = {https://openreview.net/forum?id=jEudMU2Ppd},
}
Figure