Manuscript Offprint

arXiv:2610.28770

ReAPO: Retry-Aware Policy Optimization for Efficient Exploration in LLM Reasoning

Nghi Dao, Calder Morton-Ferguson, Noah Golowich, Adam Block

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

RLVR improves language-model reasoning, but commonly relies on independent stochastic rollouts for exploration, which can repeatedly sample similar failed strategies. Prior work has seen success with approaches that guide exploration by introducing dependence into the sampling process by including incorrect solutions in the context for subsequent attempts. Still, these methods introduce the additional question of how to assign credit to each attempt. We propose to view the credit assignment through the lens of Stochastic Shortest Paths, a framework in classical reinforcement learning that seeks to minimize the expected cumulative cost to reach a terminal state (in our case, a verified successful response). We show that, under suitable simplifying assumptions, this perspective naturally leads to a simple modification to GRPO, which we call Retry-Aware Policy Optimization (ReAPO). ReAPO allocates additional generation to failed trajectories, allowing successful retries to be reinforced without rewarding preceding failures, and assigns credit in a theoretically principled way to each attempt. Across Qwen3 and OLMo-2 models from 0.6B to 4B and eight mathematical and scientific reasoning benchmarks, ReAPO improves first-attempt performance over GRPO as well as natural recent baseline algorithms, while additional ablations demonstrate the utility of both serial sampling and ReAPO's credit assignment. On Qwen3-0.6B, ReAPO also outperforms GRPO with twice the group size or twice the training steps, reaching their peak accuracy with 39% and 31% fewer generated tokens, respectively. Taken together, our results suggest that ReAPO is a simple yet effective approach for improving LM reasoning performance through improved exploration and retry-aware credit assignment. 1^{1}

1 Introduction

Reinforcement learning with verifiable rewards (RLVR) has emerged as an effective approach for improving the reasoning capabilities of large language models (LLMs) without requiring human-written reasoning traces (Shao et al., 2024; Guo et al., 2025; Wen et al., 2025; Lambert et al., 2025; Hu et al., 2025; Zeng et al., 2025). Given a problem with an easily verifiable answer (e.g., formalized mathematics or compilable code), RLVR samples multiple responses from a policy, evaluates each response, and reinforces responses that receive higher rewards. Most contemporary approaches to RLVR are based on the seminal algorithm Group Relative Policy Optimization (GRPO), which estimates the quality of individual responses by comparing verified rewards within the group of sampled responses. Despite the success of GRPO, the algorithm is limited by its reliance on policy stochasticity to explore semantically distinct reasoning trajectories. Indeed, like many policy gradient methods, GRPO does not explicitly encourage exploration, the process by which

*nmd2167@columbia.edu

†^{\dagger}calder.morton-ferguson@yale.edu

‡^{\ddagger}nzg@cs.utexas.edu

$adam.block@columbia.edu

1^{1}All code to reproduce our results can be found at https://github.com/Nghi-Dao/ReAPO.

Figure

Figure 1: Overview of ReAPO. Each rollout begins with an independent response; failed responses receive a verifier-conditioned retry, while successful rollouts terminate. Advantages are computed for each attempt separately, ensuring that credit is assigned appropriately to both initial and retry attempts, before applying a policy update with the GRPO loss.

a model actively seeks out novel reasoning strategies; moreover, this deficiency has been noted in prior work that questions the ability of RL methods to drive genuine reasoning improvements beyond the capabilities of the base model (Yue et al., 2025; Karan and Du, 2025; Huang et al., 2025b; Chen et al., 2026; Wen et al., 2025; Huang et al., 2025a).

Critically, GRPO relies on independently sampled rollouts to explore different reasoning trajectories, which can result in repeated exploration of the same incorrect paths and inefficient use of computational resources. Indeed, if a model is unlikely to solve a given problem, it may well be the case that independent rollouts make the same mistake again and again, leading to no useful training signal for the model to learn from its mistakes and wasting valuable computational resources in generating redundant and uninformative tokens. Recent work has demonstrated that introducing dependence into the generation process can help improve coverage and potentially improve RLVR (Snell et al., 2024; Madaan et al., 2023; Sprague et al., 2026; Kumar et al., 2024; Li et al., 2026), but the best way to do so remains unclear. We thus ask: How can we introduce structured dependence in the sampling process to improve exploration, and how should we assign credit to each attempt?

In this work, we propose Retry-Aware Policy Optimization (ReAPO) (Algorithm 1), a simple yet effective modification to GRPO that explicitly encourages exploration by allowing the model to generate retries after failed attempts and assigning credit to each attempt in a theoretically principled manner. ReAPO is compatible with any verifier-based reward function and does not require additional supervision or auxiliary objectives; moreover, ReAPO can be easily integrated into existing training pipelines, requiring minimal changes to existing code.

In more detail, our motivating question breaks into two parts whose combination yields ReAPO: (i) introducing beneficial dependence into generation and (ii) correctly assigning credit to individual attempts. Prior work has demonstrated the efficacy of keeping information in context to encourage language models to reflect on prior mistakes and correct themselves (Kumar et al., 2024; He et al., 2026; Bensal et al., 2025; Guo et al., 2025). We build on this idea and propose failure-conditioned repeated attempts: given a prompt and response, we grade the answer and, if the answer is incorrect, append an instruction to the model to try again. This process can then be repeated either until a correct answer is generated or until some maximum budget of attempts (or tokens) is reached. Critically, unlike GRPO, where each attempt is fully independent, future attempts can learn from prior incorrect solutions, thereby achieving better coverage than mere independent sampling (Snell et al., 2024). While taking this idea to the extreme would entirely replace the parallel sampling of GRPO with serial sampling, in practice, the system’s benefits of parallelization lead us to instead rollout multiple sequences of attempts independently, thereby introducing dependence within but not among distinct rollouts. Failure-conditioning has additional benefits beyond exploration: serial sampling can be viewed as a way to dynamically assign additional compute (measured in generated tokens) to more difficult problems where early attempts are less likely to achieve success. Differentially allocating compute based on problem difficulty has been observed to lead to significant improvements in token and wall-clock efficiency (Yu et al., 2025; Xiong et al., 2025; Microsoft AI Team, 2024), and is likely partially responsible for ReAPO’s efficiency.

Given a group of sequences of attempts as described above, it is not obvious how to assign credit to a given sub-attempt within a larger sequence. We propose to minimize the expected number of incorrect attempts before a correct solution is provided, which is an instance of a stochastic shortest path problem from the classical RL literature (Bertsekas and Tsitsiklis, 1991). Under natural simplifying assumptions, the resulting policy gradient computes response-level advantages, i.e., we treat each attempt within a sequence independently and assign each attempt's advantage only to the tokens relevant to that attempt, thereby allowing different attempts within a single sequence to receive different advantages. This approach encourages the model to produce correct solutions quickly while at the same time allowing the RL process to retain the benefits of conditioned sampling. The resulting algorithm is represented visually in Figure 1, demonstrating how failed responses are incorporated into context and how correct and incorrect responses are scored.

We now summarize the remainder of the paper. In Section 2 we introduce the prerequisite notions to our derivation of ReAPO. Then, in Section 3, we formally derive ReAPO's objective under natural simplifying assumptions on the generation process. In Section 4, we investigate ReAPO empirically across four models from two families (0.6B to 4B parameters) and eight mathematical and scientific reasoning benchmarks, comparing against GRPO, compute-matched GRPO variants and other recent baselines, and ablating each component. We briefly discuss related work in Section 5, and defer further discussion, additional experiments and all proofs to the appendix.

References (95)