NEMO: Execution-Aware Optimization Modeling via Autonomous Coding Agents
Abstract
We present NEMO, a system that translates Natural-language descriptions of decision problems into formal Executable Mathematical Optimization implementations using autonomous coding agents (ACAs). Existing approaches rely on specialized large language models (LLMs) or bespoke task-specific agents that are often brittle and frequently generate syntactically invalid or non-executable code. NEMO instead treats ACAs as a first-class abstraction analogous to API-based interaction with LLMs; their sandboxed execution guarantees code is executable by construction and supports automated validation and repair. We introduce novel coordination patterns including asymmetric validation loops between independently generated optimizer and simulator implementations, external memory for experience reuse, and robustness enhancements via minimum Bayes risk (MBR) decoding and self-consistency. Across nine established optimization benchmarks, NEMO achieves state-of-the-art performance on the majority of tasks with substantial margins on several datasets, demonstrating the power of execution-aware agentic architectures for automated optimization modeling.
Lay Summary
Many real-world decisions, such as routing delivery trucks, scheduling staff, or allocating budgets, can be solved with mathematical optimization, but only if a human expert first translates the problem description into precise math and code. This translation is slow, error-prone, and requires years of specialized training. Recent attempts to use AI for this translation often produce code that doesn't run or quietly gives wrong answers. We built NEMO, a system that uses autonomous coding agents: AI assistants that can write, run, and fix code on their own. The key insight is that two independent agents tackle the same problem from different angles. One writes a solver, the other writes a checker that simulates the problem step-by-step. When the two disagree, the system flags the error and repairs it automatically. We also give the agents a memory of past solved problems and ensemble multiple solver attempts for robustness. Across nine established benchmarks of optimization problems, NEMO matches or beats the best prior systems on eight of them. By making it easier to turn plain-English descriptions of decisions into reliable working code, this lowers the technical barrier to optimization, expanding access beyond the small community of operations research experts.