Optimization is the hidden engine of the modern world, powering everything from airline scheduling to power grid management. However, there is a massive bottleneck: translating a messy, natural-language business problem into the precise mathematical code that solvers (like Gurobi or OR-Tools) require. This process, known as autoformulation, usually requires expensive human experts.
In their recent paper, AutoOR, researchers from X (The Moonshot Factory) and the University of Oxford present a scalable pipeline that trains small, open-source Large Language Models (LLMs) to perform this expert-level task. By combining a clever synthetic data strategy with Reinforcement Learning (RL), they’ve enabled an 8B-parameter model to match—and sometimes beat—frontier models like Gemini 3 Pro.
TL;DR
AutoOR is a scalable pipeline that trains LLMs to translate natural language descriptions into executable optimization solver code. By using a "backtranslation" synthetic data strategy and Reinforcement Learning with verifiable solver feedback, an 8B model achieves state-of-the-art results, even solving complex non-linear physics problems where frontier models typically score 0%.
What Problem Does This Paper Address?
The "Operations Research (OR) Bottleneck" is real. While we have powerful solvers that can find optimal solutions in milliseconds, getting the problem into the solver is hard.
Current LLMs struggle with this for three reasons:
- Data Scarcity: There aren't many high-quality, public datasets of "Problem Description $\rightarrow$ Solver Code" pairs.
- Complexity: Real-world problems have intricate constraints and non-linear physics that are easy to hallucinate.
- Verification: It is incredibly difficult for a model (or even a non-expert human) to look at a block of generated code and know if it correctly represents the original word problem.
Methods
The authors introduce two core innovations to bypass these hurdles:
1. Scalable Backtranslation (The "Easy Direction" Trick)
Instead of trying to generate descriptions and then code (which is hard to verify), the authors reversed the process. They started with Standard Forms (templates for math problems), instantiated them with random valid parameters to get Solver Code, and then used an LLM to "backtranslate" that code into a Natural Language Description. Because they started with the math, they already had the "ground truth" answer. They then used another LLM to verify that the generated description actually contained all the necessary data points, creating a high-fidelity, self-verifying training set.
2. RL with Verifiable Rewards (GRPO)
The researchers used Group Relative Policy Optimization (GRPO)—the same RL algorithm behind DeepSeek-R1. The "Aha!" moment here is that OR is a verifiable domain. You don't need a human to grade the model's homework; you just run the generated code. The reward function is simple and objective:
- Does the code execute?
- Is the solution feasible (does it satisfy constraints)?
- Is the solution optimal (does it match the ground truth)?
3. Curriculum RL for Non-Linear Problems
For complex non-linear problems (like optimizing a network of centrifugal pumps), models usually fail 100% of the time initially. If every attempt gets a zero reward, the model never learns. The authors used a curriculum strategy: they first gave the model "privileged information" (hints about solver syntax and constraints), then gradually removed the training wheels as the model's performance improved.
Datasets
The authors evaluated AutoOR across a wide range of benchmarks:
- Established Benchmarks: NL4LP, NL4Opt, MAMO (Easy/Complex), IndustryOR, and ComplexOR.
- New "Hard" Benchmarks: The authors introduced Hard-LP, Hard-MIP, and Pump-NLP to test the limits of these models on longer descriptions and complex physical dynamics.
Key Insights and Ideas
- The Power of Small Models: A post-trained Qwen3-8B model can outperform models 50x its size. This suggests that for specialized reasoning tasks, high-quality, verifiable data is more important than raw parameter count.
- Closing the Loop with Solvers: By using the solver as the "judge," the training process becomes a closed loop. This eliminates the "vibe-based" evaluation common in LLM training and replaces it with mathematical certainty.
- Multi-Turn is the Future: The paper includes a "Multi-Turn" experiment where the model learns to ask clarifying questions (e.g., "What is the cost of Resource B?") when a description is incomplete. This mimics how human consultants actually work.
Key Results
- State-of-the-Art Performance: AutoOR-8B achieved SOTA or competitive results across all six established benchmarks.
- Beating the Giants: On the Hard-MIP benchmark, AutoOR-8B scored 94%, significantly higher than Gemini 2.5 Pro (84%) and matching Gemini 3 Pro (92%).
- The Non-Linear Breakthrough: On the Pump-NLP task (involving non-linear physics), frontier models like Gemini 3 Pro scored ~0%. AutoOR-8B, thanks to curriculum RL, reached 48.98%.
Limitations and Future Work
While impressive, the authors note several areas for growth:
- Domain Specificity: The non-linear results are currently limited to pump network synthesis. Expanding this to other physics-heavy domains (like chemical processing or power systems) is a logical next step.
- Code Quality: The reward function checks for correctness, but not elegance or efficiency. Two pieces of code might both be correct, but one might run 10x faster; current AutoOR doesn't distinguish between them.
- Solver APIs: The model is trained on specific APIs (OR-Tools and Gekko). Generalizing to any solver-agnostic mathematical formulation remains a challenge.
AutoOR demonstrates that we are moving toward a world where the "language barrier" between business requirements and mathematical optimization is finally disappearing.
Summary updated