AI
Reinforcement Learning Trains AI Models to Solve Real Optimization Problems Across Multiple Solvers
Researchers propose a new approach using outcome-based rewards rather than costly supervision to teach language models how to generate working solver code for optimization tasks.
A research team has developed a novel method to train language models on mathematical optimization modeling using reinforcement learning signals derived directly from solver performance rather than expensive human feedback or process-level annotations.
The Challenge with Current Approaches#
Existing systems for automating optimization modeling rely on either heavyweight agentic pipelines built into proprietary large language models—which incur high computational costs during inference—or smaller open models that require extensive labeled supervision data, a process that tends to become brittle when moved to different optimization solvers. These limitations make it difficult to create practical, reusable systems for real-world decision-making tasks.
Introducing OMSO#
The new framework, called Optimization Modeling from Solver Outcomes (OMSO), flips the training paradigm by using a reinforcement learning loop where a mathematical programming solver acts as the environment itself. The process works in four steps: given a natural-language description of an optimization problem and a target solver, the model generates solver-specific code, executes it in a sandboxed runtime, and receives a reward signal based on whether the code ran successfully and produced correct results. This closed-loop approach trains the model without needing labeled traces of a solver's internal reasoning.
Key Advantages#
The OMSO approach offers several practical benefits:
- No process supervision required: The model learns from outcome labels alone—did the generated code work or not—rather than expensive step-by-step annotations
- Portable across solvers: By swapping out which solver environment the model trains against, the same method can teach models to work with Gurobi, OR-Tools, COPT, and other optimization packages without rebuilding datasets
- Improved reasoning: Experiments show the method produces more robust semantic understanding and better code than models trained on solver API usage alone
Evaluation Results#
Testing on four benchmark datasets—NL4OPT, MAMO, IndustryOR, and OptiBench—the team demonstrated that OMSO matches or surpasses models trained with process-level supervision. The approach also supports zero-shot transfer to new solvers without retraining, and can be combined with supervised fine-tuning as a warm start for further RL training.

