TL;DR
PEARL introduces an agentic reinforcement learning framework that transforms optimization modeling from a fragile, one-shot text generation task into an interactive, multi-turn "solve-debug-revise" process. By training a compact 4B-parameter model to dynamically execute code and learn from real-time solver feedback, PEARL allows smaller models to outperform giant models like the 685B DeepSeek-V3.2 on complex optimization benchmarks.
What Problem Does This Paper Address?
Optimization modeling involves translating real-world business or engineering problems described in natural language into formal mathematical formulations and executable solver code (e.g., using Python libraries like Pyomo).
While Large Language Models (LLMs) are capable code generators, standard approaches treat optimization modeling as a one-shot task. The model generates the code once, and that's it. In reality, human experts rarely write perfect optimization code on the first try; they write a partial model, run it, inspect solver diagnostics or infeasibility reports, and iteratively fix errors. Because one-shot LLMs lack this feedback loop, they frequently suffer from hallucinated constraints, indexing mismatches, or silent runtime failures. Even existing tool-augmented LLM workflows rely on rigid, hand-designed heuristics to fix code rather than letting the model dynamically learn how to debug.
Methods
The authors introduce PEARL (Interactive Optimization Modeling with Tool-Integrated Agentic Reinforcement Learning), which formalizes optimization modeling as a Partially Observable Markov Decision Process (POMDP).
Instead of treating the solver as a post-hoc evaluator, PEARL integrates it directly into the model's environment loop:
- Action Space: At each turn, the agent can choose a natural-language action (drafting or revising an implementation plan) or a tool action (
Executeto run Python/Pyomo code in a sandbox, orValidateto check constraint satisfaction). - Solver-in-the-Loop Feedback: Runtime logs, syntax exceptions, solver statuses (optimal, infeasible, unbounded), and objective values are fed directly back into the model's observation stream for the next turn.
- Verifiable Reward Decomposition: To train the model via reinforcement learning, the authors design a trajectory-level reward $R(\tau) = r_{fmt}(\tau) + r_{corr}(\tau)$. It combines a dense format reward (incentivizing correct tool syntax) with a sparse correctness reward (awarded only when the solver-reported objective value matches the ground-truth reference within a tight numerical tolerance).
- Policy Optimization: The policy is trained using Group Relative Policy Optimization (GRPO) with decoupled clipping to stabilize learning under high-variance, multi-turn tool trajectories.
Datasets
PEARL was trained on a mixed corpus of roughly 14,000 optimization modeling instances, combining 10,000 cleaned open-source problems (from OR-Instruct/ORLM, OptMATH, and OptiBench) with 3,800 newly constructed and manually curated instances.
Evaluation was conducted across a diverse suite of established benchmarks: NL4Opt, MAMO (EasyLP and ComplexLP), NLP4LP, OptMATH, IndustryOR, ComplexOR, and Resocratic.
Key Insights and Ideas
- Interaction Trumps Scale: A 4B parameter model trained specifically to interact with a solver can beat a massive 685B general-purpose model. Teaching a model how to use tools and debug its own errors is far more parameter-efficient than simply scaling up model size.
- Scaffolding Alone is Insufficient: Simply wrapping a base model in a fixed Python loop (a "scaffold control") does not yield high accuracy. Base models use tools sparsely and struggle to interpret complex solver diagnostics. The model itself must undergo RL training to learn when to test partial models and how to respond to failures.
- A Shift in Failure Modes: Before agentic training, the base model's failures are dominated by low-level code and runtime crashes (66.2%). PEARL successfully eliminates these basic implementation bugs, shifting the remaining failures to deeper, more substantive mathematical or semantic mismatches (objective value mismatches).
Key Results
- Massive Accuracy Gains: PEARL-Qwen3-4B achieved a macro-averaged Pass@1 accuracy of 69.71%, dramatically outperforming its base model Qwen3-4B-Instruct (22.20%) and the reasoning-focused Qwen3-4B-Think (30.86%).
- Outperforming the Giants: As shown in Figure 1, the 4B PEARL model outperformed the much larger DeepSeek-V3.2-685B (66.51%) in macro-averaged accuracy across the benchmark suite.
- Thriving on Complexity: The gains were most pronounced on difficult, interactive datasets. On MAMO ComplexLP, PEARL achieved a massive absolute accuracy jump to 76.12%, compared to the base model's 13.51%.
Limitations and Future Work
- Bounded Horizon: PEARL operates under a maximum budget of 8 turns. Extremely complex industrial problems requiring long debugging chains or extensive data inspection might exhaust this budget.
- Partial Oracles: Objective-value matching is a strong proxy for correctness, but it is a partial oracle. It can occasionally miss latent structural defects or accept alternative formulations that happen to output the correct target value for a specific instance.
- Inference Cost: Multi-turn interaction inherently increases serving memory and latency compared to one-shot generation. The authors note that future systems should explicitly learn when interaction is worth the cost versus when a direct, one-shot solution is sufficient.
Summary updated