Many language-model systems now improve their answers in a loop: draft, check, revise, repeat. Each extra round costs a full sequential generation, so the decision that matters most for speed is a small one: after each round, should the system accept the current draft or revise again? Stopping too early ships a wrong answer. Stopping too late wastes time, and it can also wreck a correct draft, because models do talk themselves out of right answers. We propose to learn this accept-or-revise decision as a reinforcement-learning policy, which is the standard way to train a model that makes yes/no choices that cannot be differentiated. The policy is trained against a second, adversarial policy. The adversary's job is to steer the refinement loop into the states where the stopping decision is most likely to fail: confident-looking wrong drafts, and correct drafts that still look unfinished.
The underlying idea comes from recommendation and retrieval. There, rankers trained only on randomly chosen negatives learn loose decision boundaries, and adversarial samplers that pick hard negatives tighten them (IRGAN, RNS). A halting policy trained on the refinement trajectories a model naturally produces has the same problem. Most wrong drafts it sees are obviously wrong, and most correct drafts are obviously right. The rare near-misses, which decide both accuracy and latency, are underrepresented. Our claim is that a halting policy will only learn a sharp boundary if those near-misses are deliberately manufactured during training, and that simply reweighting the near-misses that happen to occur is not enough.
Core Claim
A learned halting policy for iterative refinement reaches a better accuracy-versus-rounds trade-off when it is trained on states produced by an adversarial rollout policy than when it is trained on natural trajectories, on reweighted natural trajectories, or on the same number of extra random rollouts. This holds only if the adversary is constrained to produce drafts the refiner would actually generate at deployment. The gain should concentrate in two failure modes: accepting confident-wrong drafts, and revising correct drafts until they break.
The idea differs from its nearest neighbors in specific ways. Dynamic Early Exit in Reasoning Models (DEER) stops chain-of-thought reasoning when trial-answer confidence crosses a hand-set threshold. Its authors report that the best threshold shifts across models and tasks, that "shy" models with depressed confidence miss the exit window, and they leave learning termination via reinforcement learning to future work. This motivates our proposal. AdaDiff does train a discrete step-count selector with policy gradients, but it makes one choice before generation starts and scores it against a frozen quality model. We make the choice at every round, and the training distribution is shaped adversarially. Critique-RL shows that a critic optimized purely for downstream revision success loses its ability to tell right from wrong. That is the same symptom we target, but its remedy is a staged cooperative pipeline with a fixed single refinement round, not a learned stopping time. The adversarial-sampling papers supply our method. From IRGAN we take the discrete adversary trained by policy gradient. From RNS we take the constraint that keeps the adversary's choices realistic: RNS matches sampled negatives to the distribution of exposed-but-unclicked items so the sampler cannot exploit unrealistic regions. AdvInfoNCE supplies the strongest simpler competitor, which is continuous, robust-optimization-style reweighting of hardness with no discrete adversary at all.
Research Program
The refinement loop. The loop has a fixed refiner model. At round $t$ it produces draft $y_t$ from the problem and the previous draft plus feedback. Feedback is execution output for code and a self-critique for math. We use domains where correctness is checked exactly, by unit tests, answer matching, or the Lean compiler. This matters because the main failure of adversarial negative sampling in recommendation is labeling an item the user would actually like as a negative. Exact checking removes that failure at labeling time, so any remaining instability can be attributed to the game rather than to label noise.
The halting policy. The halting policy $\pi_\theta$ is a small model reading features of the current state: the draft, the feedback, the round index, and the refiner's token-level confidence. It outputs accept or revise. In the verified-code setting it also gets a third action, abandon, for tasks where further rounds are futile. We train it with REINFORCE using a learned baseline. The per-episode reward is
$$R = \mathbb{1}[\,y_T \text{ correct}\,] - c\,T,$$
where $T$ is the round at which the policy accepts and $c$ is a per-round cost. We sweep $c$ to trace a trade-off curve. Only a reward computed from the outcome makes this possible: it scores stopping decisions without hand-made stop labels. The policy is still not differentiable through the refiner, which is why we use policy gradients.
The adversary. The adversary $\pi_\phi$ is a discrete policy over a menu of rollout choices. It picks which training problem to use, which round to branch from, and which perturbation operator to apply. Operators include sampling temperature, asking the refiner for a minimal plausible edit, injecting a misleading critique, and truncating feedback. The chosen branch is rolled out and labeled by the exact checker. The adversary is rewarded by the halting policy's error on the resulting state, meaning it accepted a wrong draft or revised a correct one. A realism penalty follows RNS:
$$\max_\phi \; \mathbb{E}_{s \sim \pi_\phi}\big[\ell_\theta(s)\big] - \beta\, \mathrm{MMD}\big(P_\phi, P_{\text{deploy}}\big),$$
Here $\ell_\theta(s)$ is the halting policy's loss on state $s$. $P_\phi$ and $P_{\text{deploy}}$ are the distributions of state features under the adversary and under ordinary deployment rollouts. Maximum mean discrepancy (MMD) is a kernel distance between those two distributions, and $\beta$ trades hardness against realism. Without this term we expect the adversary to drift toward bizarre drafts the refiner never writes. We run this unconstrained variant as an ablation.
Training schedule. Training alternates between the two policies. The halting policy is first warm-started on natural trajectories. Then we alternate halting-policy updates on a mix of natural and adversarial states with adversary updates. The adversary's entropy is regularized, because discrete adversaries are known to collapse prematurely.
Analysis. Beyond headline accuracy and latency, we measure the premature-accept rate on wrong drafts and the pearl-break rate, which is how often a correct draft is revised into an incorrect one. We also measure calibration of the halting policy across refiner sizes, to test whether learning removes DEER's threshold-transfer problem.
Baselines
The naive reference points are fixed-round refinement at 1, 2, 4, and the maximum number of rounds, plus an oracle that stops at the first correct draft. The fixed-round curve is the floor, and the oracle is the ceiling on achievable round savings.
The strongest existing heuristic is DEER-style confidence thresholding (Dynamic Early Exit in Reasoning Models), adapted from reasoning steps to refinement rounds. At each round we compute trial-answer confidence and accept above a threshold. The threshold is tuned on the same validation split with the same number of tuning trials we give our cost sweep. DEER reports cutting chain-of-thought length by 19.1% to 80.1% while raising accuracy by 0.3% to 5.0% across benchmarks including MATH-500 and HumanEval. Those numbers are for reasoning-length truncation, not round-level refinement halting. We found no reported result on Lacuna for learned halting in multi-round refinement loops on these benchmarks. Beating DEER means a trade-off curve that dominates it, with higher accuracy at equal mean rounds over at least the middle range of costs, and with one setting transferring across refiner sizes where DEER's tuned threshold does not.
The strongest learned competitor is the same halting policy trained by REINFORCE on natural trajectories, with no adversary. This ablation isolates the adversarial ingredient. For fairness it receives exactly as many extra refiner calls as the adversary consumed, spent on uniformly random branches from the same operator menu. Without this matched-random-rollout control, any adversarial gain could simply be more data.
The second ablation isolates generation versus reweighting. The halting policy is trained on natural trajectories, with examples reweighted toward its current errors. We use two weightings: online hard-example weighting, and AdvInfoNCE-style continuous hardness weights under a divergence constraint (AdvInfoNCE). The third ablation removes the realism term.
At the system level we compare against Best-of-N sampling with a matched number of refiner calls, and against a single critique-refine round in the style of Critique-RL. Critique-RL reports a 9.02% in-domain gain on Qwen2.5-7B and up to a 5x compute-efficiency advantage over majority voting on MATH. That makes it the reference for whether adaptive halting adds anything beyond a well-trained single round.
Why not just…?
Why not just tune a confidence threshold? This is the cheapest option, and on well-calibrated refiners it may be nearly as good. DEER itself reports that the best threshold moves across models and tasks, and that underconfident models miss the exit. Our experiment settles the question by tuning the threshold on one refiner size and testing on another, and by comparing trade-off curves rather than single points. If the threshold matches us on every model and task, the learned policy is not worth its cost.
Why not just train the halting policy with reinforcement learning on more natural trajectories? This is the most direct threat, and the matched-random-rollout control exists to answer it. If spending the adversary's rollout budget on random branches yields the same curve, then hardness does not matter and the claim fails. Our prediction is that random extra data improves the average case but leaves the premature-accept rate on confident-wrong drafts largely unchanged, because those states are rare under random branching.
Why not just reweight the hard cases you already have, as AdvInfoNCE does? In recommendation, continuous hardness weighting avoids the instability of discrete adversaries and performs strongly. AdvInfoNCE reports a 24.14% NDCG@20 gain under distribution shift on Tencent. This is a real threat. Reweighting can only emphasize near-misses that occur naturally, while the adversary can create them by branching and perturbing. We expect reweighting to close much of the gap on frequent failure types and to lose specifically on rare ones. If it matches the adversary overall, we will report that the discrete adversary is unnecessary.
Why not just sample N drafts in parallel and skip sequential refinement? Parallel sampling removes the sequential dependency, but evidence in the file favors refinement at equal compute. Critique-RL's 5x efficiency over majority voting, Self-Refinement Tuning's gains over Best-of-N re-ranking (Teaching Language Models to Self-Improve by Learning from Language Feedback), and IterRef's finding that more refinement steps beat more particles (Effective Test-Time Scaling of Discrete Diffusion through Iterative Refinement) all point that way. We still include matched-compute Best-of-N, both as a measured comparison and as a wall-clock comparison when drafts run in parallel.
Why not just internalize reflection into one forward pass? Meta-Reflection cuts first-token latency from 951ms to 246ms by distilling reflection into an internal codebook. It needs white-box access to activations and cannot use external checkers such as test execution or the Lean compiler. Our halting policy treats the refiner as a black box, so it applies to tool-in-the-loop settings that Meta-Reflection cannot reach.
Proposed Experiments
The primary testbed is code refinement with unit-test feedback on MBPP and HumanEval. For context, Meta-Reflection reports 63.4% Pass@1 on MBPP against 58.8% for LLaMA-3.1 zero-shot. The second testbed is math refinement on MATH-500 and GSM8K, scored by answer checking. Each method is summarized by the area under its accuracy-versus-mean-rounds curve and by wall-clock latency at matched accuracy, alongside premature-accept and pearl-break rates.
The stress test is VERINA (VERINA: Benchmarking Verifiable Code Generation, sunblaze-ucb/verina). There, 64 rounds of compiler feedback raise proof success only to about 20%, against 4.9% single-shot ProofGen Pass@1 for o3. We enable the abandon action and use cross-validation folds over the 189 tasks. Success is retaining nearly all of the 64-round proof successes while spending substantially fewer rounds on unsolvable tasks.
The decisive checks are three. First, the adversarial halting policy must beat the matched-random-rollout control on the curve area, with the gain located in the confident-wrong regime. Second, it must beat AdvInfoNCE-style reweighting, which shows that creating hard states matters beyond emphasizing existing ones. Third, removing the realism term must hurt deployment performance even as training-time adversarial loss rises, which shows the RNS-style constraint is doing real work. If the first check fails, the proposal reduces to "learned halting with more data," and we will say so.
References
- IRGAN: A Minimax Game for Unifying Generative and Discriminative Information Retrieval Models
- Reinforced Negative Sampling for Recommendation with Exposure Data
- Dynamic Early Exit in Reasoning Models
- AdaDiff: Adaptive Step Selection for Fast Diffusion Models
- Critique-RL: Training Language Models For Critiquing Through Two-Stage Reinforcement Learning
- Empowering Collaborative Filtering with Principled Adversarial Contrastive Loss
- Teaching Language Models to Self-Improve by Learning from Language Feedback
- Effective Test-Time Scaling of Discrete Diffusion through Iterative Refinement
- Meta-Reflection: A Feedback-Free Reflection Learning Framework
- VERINA: Benchmarking Verifiable Code Generation