R$^3$L: Reflect-then-Retry Reinforcement Learning with Language-Guided Exploration, Pivotal Credit, and Positive Amplification
Weijie Shi, Yanxi Chen, Zexi Li, Xuchen Pan, Yuchang Sun, Jiajie Xu, Xiaofang Zhou, Yaliang Li
TL;DR
R^3L tackles core RL bottlenecks in language-guided, multi-turn tasks by integrating language-guided Reflect-then-Retry for active trajectory synthesis, Pivotal Credit Assignment to localize learning signals to diverging suffixes, and Positive Amplification to ensure constructive gradients dominate off-policy updates. The method achieves robust gains across agentic environments and mathematical reasoning benchmarks, outperforming baselines like GRPO, GSPO, and Critique-GRPO while maintaining training stability. Through extensive ablations and analyses, the paper demonstrates that active trajectory synthesis, precise credit assignment, and gradient shaping are crucial for effective learning in sparse-reward, long-horizon tasks. The work provides a practical, scalable framework and releases code to facilitate replication and further research in RL for LLM-driven agents.
Abstract
Reinforcement learning drives recent advances in LLM reasoning and agentic capabilities, yet current approaches struggle with both exploration and exploitation. Exploration suffers from low success rates on difficult tasks and high costs of repeated rollouts from scratch. Exploitation suffers from coarse credit assignment and training instability: Trajectory-level rewards penalize valid prefixes for later errors, and failure-dominated groups overwhelm the few positive signals, leaving optimization without constructive direction. To this end, we propose R$^3$L, Reflect-then-Retry Reinforcement Learning with Language-Guided Exploration, Pivotal Credit, and Positive Amplification. To synthesize high-quality trajectories, R$^3$L shifts from stochastic sampling to active synthesis via reflect-then-retry, leveraging language feedback to diagnose errors, transform failed attempts into successful ones, and reduce rollout costs by restarting from identified failure points. With errors diagnosed and localized, Pivotal Credit Assignment updates only the diverging suffix where contrastive signals exist, excluding the shared prefix from gradient update. Since failures dominate on difficult tasks and reflect-then-retry produces off-policy data, risking training instability, Positive Amplification upweights successful trajectories to ensure positive signals guide the optimization process. Experiments on agentic and reasoning tasks demonstrate 5\% to 52\% relative improvements over baselines while maintaining training stability. Our code is released at https://github.com/shiweijiezero/R3L.
