NEMO: Execution-Aware Optimization Modeling via Autonomous Coding Agents

Yang Song, Anoushka Vyas, Zirui Wei, Sina Khoshfetrat Pakazad, Henrik Ohlsson, Graham Neubig

TL;DR

NEMO is an "execution-aware" system that uses autonomous coding agents to translate natural-language business problems into executable mathematical optimization models. By leveraging a novel asymmetric validation loop—where a generated simulator acts as a "ground truth" to check the optimizer's work—NEMO achieves state-of-the-art performance across nearly all major optimization benchmarks, often by massive margins.

What Problem Does This Paper Address?

Mathematical optimization is the backbone of modern logistics, finance, and engineering, yet it remains a "high-barrier" field. Translating a messy, natural-language description of a business problem (e.g., "How do I route these 50 trucks to minimize fuel?") into formal code (like Gurobi or Pyomo) typically requires a human expert.

While Large Language Models (LLMs) have tried to automate this, they are often "brittle." They might generate code that looks mathematically plausible but fails to run, contains syntax errors, or—most dangerously—produces a "correct-looking" answer that actually violates the problem's constraints. Existing systems mostly treat LLMs as text generators; they lack a robust way to "check their work" in a real execution environment.

Methods

NEMO (Execution-Aware Optimization Modeling) moves away from simple text-generation and toward a Workspace-State paradigm. The system treats Autonomous Coding Agents (ACAs) as first-class citizens that operate within a sandboxed environment. Key technical components include:

  • Decision Process Extractor: Uses a hybrid approach of Minimum Bayes Risk (MBR) decoding and LLM re-ranking. It generates multiple candidate mathematical formulations and selects the one that is most "consistent" with the others, significantly reducing the randomness (non-determinism) of the LLM.
  • Asymmetric Validation Loop: This is the paper's core innovation. The system recognizes that writing a simulator (imperative code that checks if a solution is valid) is systematically easier for an LLM than writing an optimizer (declarative code that finds the best solution). NEMO generates both independently; the simulator then serves as an automated "judge" for the optimizer's output.
  • Diversity-Aware Memory: Instead of just pulling the most similar examples from its 3,000-problem memory bank, NEMO uses a greedy strategy to balance relevance and diversity, preventing the model from getting "stuck" on a single, potentially biased pattern.
  • Self-Consistency Aggregation: The system runs multiple optimization attempts in parallel and uses a hierarchical consensus (checking solver status, then objective values, then variables) to pick the most robust answer.

Datasets

The authors evaluated NEMO on nine established optimization benchmarks, covering everything from simple linear programming to complex industrial scenarios:

  • Standard Benchmarks: OptiBench, OptMATH-Bench, NL4OPT, NLP4LP, BWOR, IndustryOR, MAMO-Easy, MAMO-Complex, and ComplexOR.
  • Curated Benchmarks: The authors performed a rigorous "quality control" pass on these datasets, finding that many existing benchmarks contained malformed problems or invalid ground truths. They released these curated versions to the community.

Key Insights and Ideas

  • The Complexity Asymmetry: One of the "aha" moments is the empirical proof that LLMs are much better at verification than solving. In their tests, LLMs achieved 97% accuracy in writing simulators but only 87% in writing optimizers. NEMO exploits this gap to create a self-correcting system.
  • Execution as Reasoning: In NEMO, code isn't just the final output; it's a tool for reasoning. By running the code and seeing it fail, the agent receives "model-grounded" feedback that is far more useful than a simple text-based "try again" prompt.
  • The "Workspace-State" Advantage: By allowing agents to share a persistent sandbox, they can import each other's modules and share data without complex "message-passing" protocols. This mimics how human developers actually work.

Key Results

NEMO set a new standard for the field, outperforming previous state-of-the-art (SOTA) models on eight out of nine benchmarks.

  • Massive Margins: On the IndustryOR benchmark, NEMO outperformed the previous SOTA by a staggering 28 percentage points.
  • Consistency: On OptMATH-Bench, it achieved an absolute gain of roughly 20 percentage points.
  • Compute Efficiency: The authors showed that NEMO’s gains aren't just from "throwing more compute" at the problem. A compute-matched baseline (simply running the LLM 5 times and picking the best) still lagged significantly behind NEMO’s structured agentic workflow.

Limitations and Future Work

  • Computational Overhead: The primary trade-off is time. Because of the iterative loops and sandboxed execution, NEMO takes 5–10 minutes per problem. While acceptable for high-stakes business decisions, it’s too slow for high-throughput applications.
  • Semantic Equivalence: While the simulator catches many errors, it isn't a "formal proof." Two models might produce the same objective value for one specific test case but still have different underlying logic. Full formal verification remains an open challenge.
  • Data Quality: The authors noted that nearly 13% of problems in existing benchmarks were malformed, suggesting that the field needs better-quality evaluation data to continue progressing.

Summary updated

BibTeX
@inproceedings{song2026nemo,
  author = {Yang Song and Anoushka Vyas and Zirui Wei and Sina Khoshfetrat Pakazad and Henrik Ohlsson and Graham Neubig},
  title = {{NEMO: Execution-Aware Optimization Modeling via Autonomous Coding Agents}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=1MxluQVepx},
}
Figure