RAPO: Expanding Exploration for LLM Agents via Retrieval-Augmented Policy Optimization

Siwei Zhang, Yun Xiong, Xi Chen, Zi'an Jia, R.l. Huang, Jiarong Xu, Jiawei Zhang

Abstract: Agentic Reinforcement Learning (Agentic RL) has shown remarkable potential in large language model-based (LLM) agents. These works can empower LLM agents to tackle complex tasks via multi-step, tool-integrated reasoning. However, an inherent limitation of existing Agentic RL methods is their reliance on a pure on-policy paradigm for exploration, restricting exploration to the agent's self-generated outputs and preventing the discovery of new reasoning perspectives for further improvement. While recent efforts incorporate auxiliary off-policy signals to enhance exploration, they typically utilize full off-policy trajectories for trajectory-level policy estimation, overlooking the necessity for the fine-grained, step-level exploratory dynamics within agentic rollout. In this paper, we revisit exploration in Agentic RL and propose Retrieval-Augmented Policy Optimization (RAPO), a novel RL framework that introduces retrieval to explicitly expand exploration during training. To achieve this, we decompose the Agentic RL training process into two phases: (i) Hybrid-policy Agentic Rollout, and (ii) Retrieval-aware Policy Optimization. Specifically, we propose a Hybrid-policy Agentic Rollout strategy, which allows the agents to continuously reason over the retrieved off-policy step-level traces. It dynamically extends the reasoning receptive field of agents, enabling broader exploration conditioned on external behaviors. Subsequently, we introduce the Retrieval-aware Policy Optimization mechanism, which calibrates the policy gradient estimation with retrieval reward and importance shaping, stabilizing training and prioritizing retrieval-illuminating exploration. Extensive experiments show that RAPO achieves an +5.0% average gain on fourteen datasets across three agentic reasoning tasks, while delivering 1.2x faster training efficiency.

Introduction

Reinforcement Learning (RL) has become the primary strategy for enhancing Large Language Model (LLM) agents. By allowing an agent to "practice" tasks and rewarding successful reasoning, researchers can push models beyond their base capabilities. However, a major bottleneck has emerged: on-policy exploration. Most agents only learn from the reasoning paths they generate themselves. If an agent lacks exposure to diverse strategies, it can become trapped in an "echo chamber," amplifying existing behaviors rather than discovering novel, more effective reasoning patterns.

Comparison of exploration strategies in Agentic RL.

As illustrated above, standard Agentic RL (a) is limited to a narrow on-policy exploration space. While some methods (b) incorporate off-policy data, they often do so at a coarse trajectory level. RAPO (c) introduces a hybrid-policy approach that expands the exploration space by integrating fine-grained, step-level off-policy traces directly into the agent's reasoning process.

Methodology

RAPO introduces two primary components to expand the exploration boundary and stabilize the learning process: Hybrid-policy Agentic Rollout and Retrieval-aware Policy Optimization (RPO).

The RAPO framework architecture.

1. Hybrid-policy Agentic Rollout

Instead of relying solely on on-policy rollouts, RAPO utilizes a Step-Trace Buffer populated with high-quality reasoning steps from an "off-policy" teacher model. During training, the agent follows a "Retrieval-then-Reasoning" process:

  • Dynamic Sampling: At any given step, the agent has a 50% chance of generating its own next reasoning step (on-policy) and a 50% chance of retrieving a relevant step from the buffer.
  • Conditioned Reasoning: If a step is retrieved, the agent must continue its reasoning based on that external input. This forces the agent to adapt to and internalize superior reasoning patterns mid-stream, effectively broadening its reasoning receptive field.

2. Retrieval-aware Policy Optimization (RPO)

To ensure that external data injection leads to stable training, RAPO employs two key mechanisms:

  • Retrieval Reward: The framework uses entropy (a measure of model uncertainty) as a proxy for quality. If a retrieved step reduces the model's entropy—making it more "confident" about the subsequent step—the retrieval receives a high reward. Conversely, if it increases uncertainty, it is penalized.
  • Importance Shaping: Since retrieved tokens are fixed and do not carry gradients, the model might naturally ignore them. RAPO reweights the gradients of the on-policy tokens generated immediately after a retrieval, prioritizing the integration of external knowledge.
  • Training Efficiency: By masking retrieved tokens during the backward pass, RAPO reduces the computational load, leading to significantly faster training cycles.

Experimental Results

The researchers evaluated RAPO across 14 benchmarks spanning computational reasoning (e.g., GSM8K, MATH), knowledge-intensive reasoning (e.g., WebWalkerQA), and web-agentic reasoning (e.g., GAIA). Using backbones like Qwen2.5 and Llama3, RAPO demonstrated superior performance and efficiency:

  • Performance Gain: RAPO achieved a +5.0% average gain across all datasets compared to strong baselines like AEPO and ARPO.
  • Efficiency: Despite the overhead of retrieval, RAPO was 1.2x faster in training. This is attributed to "retrieved token masking," which minimizes the number of tokens requiring gradient computation.
  • Robustness: The entropy-based reward system proved effective; even with "noisy" retrieval buffers, the model learned to prioritize helpful traces and ignore detrimental ones.
  • Internalization: Models trained with RAPO made fewer tool calls, suggesting they internalized the knowledge from retrieved traces rather than becoming overly dependent on external search tools.

Conclusion

RAPO addresses the fundamental exploration limits of Agentic RL by introducing a retrieval-augmented framework. By blending on-policy generation with step-level off-policy retrieval, it breaks the "echo chamber" of self-generated reasoning. The resulting agents are not only more capable across diverse tasks but also more efficient to train, marking a significant step toward more robust and versatile LLM agents.

Summary updated

BibTeX
@misc{zhang2026rapo,
  author = {Siwei Zhang and Yun Xiong and Xi Chen and Zi'an Jia and R.L. Huang and Jiarong Xu and Jiawei Zhang},
  title = {{RAPO: Expanding Exploration for LLM Agents via Retrieval-Augmented Policy Optimization}},
  year = {2026},
  eprint = {2603.03078},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.03078},
}
Figure