Lean4AgenticRL: Advancing Agentic RL with Verifiable Multi-level Process Rewards
Organizations: Amazon Web Services · University of Illinois Urbana-Champaign
Abstract
Enhancing the agentic capabilities of Large Language Models (LLMs) to tackle complex software engineering (SWE) and general terminal-usage problems is a pressing challenge. Current state-of-the-art LLMs often go through large-scale agentic Reinforcement Learning (RL). However, they mostly rely on high-level outcome rewards, with minimal consideration of low-level toolcall and mid-level workflow-stage rewards, which makes the training less effective. To overcome this limitation, we propose Lean4AgenticRL, which, to the best of our knowledge, is the first framework that grounds multi-level process rewards in the unified Lean4 formalization schema for open-ended agentic RL. Lean4AgenticRL first builds a problem-specific workflow system that balances the agent's own capability and controllability during execution, laying the foundation for further verification. Subsequently, our workflow formalization and multi-level reward annotation methods enable agent behavior verification within a general harness system. It provides multi-level rewards to support more effective agentic RL with the workflow-stage-normalized GRPO algorithm. Using Lean4AgenticRL, we train LAR-9B/27B, a family of models with enhanced agentic capability. Extensive experiments indicate that our model outperforms the leading model of similar size. LAR-27B achieves 77.3% on TerminalBench-2.1. On average, our models outperform the base model by 9.89% and surpass the second-best model of comparable size we know by 5.07%. These results indicate the potential of integrating formal methods in enhancing open-ended agentic RL.
Figures & tables
| Models | Size | SWE-Bench-Verified | TB-2.0 | TB-2.1 |
| OpenThinker-Agent-V1 ( Team, 2025a ) | 8B | 15.7% | 1.9% | - |
| Qwen-3.5-9B ( Qwen Team, 2026a ) | 9B | 44.0% | 19.3% | 16.1% |
| TMax-9B ( Ivison et al., 2026 ) | 9B | 53.5% | 27.2% | 27.6% |
| Gemma-4-12B ( Farabet & Lacombe, 2026 ) | 12B | 23.2% | 15.3% | 27.0% |
| Qwen-3.6-27B ( Qwen Team, 2026b ) | 27B | 70.0% | 45.6% | 40.5% |
| TMax-27B ( Ivison et al., 2026 ) | 27B | 70.0% | 49.9% | 44.9% |
| Method | SWE-Bench-Verified |
|---|---|
| w/o | 49.4% |
| w/ | 56.0% |
| w/o PSWF | 42.4% |
| w/ PSWF | 44.0% |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Faithfulness Type | Failure Rate |
|---|---|
| Predicate annotation | 8.03% |
| Workflow segmentation | 6.21% |
| Trajectory verification | 4.84% |
| Step | TB-2.1 Test cases | Stages with / total stages | |
|---|---|---|---|
| 0 (base) | 1/4 passes | -1 | 2/8 |
| 40 | 1/4 passes | -1 | 4/7 |
| 80 | 2/4 passes | -1 | 5/6 |
| 120 | 4/4 passes | +1 | 5/5 |
Agentic RL
Agentic reinforcement learning trains AI agents to plan, use tools, and adapt through feedback from multi-step interactions.
See all 217 papers