arXiv:2611.26413cs.LGNov 2026

Manuscript Offprint

arXiv:2611.26413

Sequential Anytime Valid Tests for Efficient Inference-Time Alignment

Vishesh Kumar Singh, Sayak Ray Chowdhury

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

Abstract

Inference-time alignment methods, such as Best-of-N (BoN), improve language model outputs by generating many candidates per prompt and selecting among them using a reward model. The cost is largely wasted, since a fixed budget is applied uniformly across prompts, even though the computation required by different prompts varies widely. Adaptive methods halt generation once sampled answers appear settled, but their thresholds are tuned heuristics with no statistical control over early-stopping errors. Instead, we seek an anytime-valid stopping rule that takes a permitted Type-I error tolerance α\alpha as input, guaranteeing that generation halts only when an answer is certified to hold genuine majority dominance (θa>1/2\theta_{a}>1/2) under the generator’s distribution. To build such a rule, we aggregate candidates by their final answers using a reward-weighted self-consistency (RWSC) score and treat the decision of when to stop as a sequential test over the resulting clusters. Wald’s sequential probability ratio test (SPRT) is the natural tool for such a test, and when applied to the RWSC clusters, it yields SPRT-RWSC, which performs well empirically. Yet its guarantee does not hold here, since the leading answer shifts as sampling proceeds, and the run is continuously monitored. Our main contribution replaces Wald’s test with an anytime-valid construction that resolves this issue: it maintains a betting supermartingale (an e-process) for every answer the policy produces, bounding the probability of ever certifying a non-dominant answer by α\alpha, uniformly over time and across all answers, however many the policy produces. We call the resulting rule e-RWSC: the RWSC scores drive the bets, which affect only how quickly a dominant answer a⋆a^{\star} is certified, not the validity of the guarantee; and certification takes O(log⁡(1/α)/dKL(θa⋆∣∣1/2))O\bigl(\log(1/\alpha)/d_{\mathrm{KL}}(\theta_{a^{\star}}||1/2)\bigr) samples. Experiments across several language models, datasets, and reward models confirm the predicted 1/dKL1/d_{\mathrm{KL}} scaling of per-response cost, and show that accuracy also improves over baselines at substantially lower token cost.

1 Introduction

Inference-time alignment has emerged as the practical alternative to fine-tuning, in which one repeatedly generates responses from the existing language model (e.g., a policy) and selects among them. Best-of-N (Beirami et al., 2025) selection scores each response with a reward model and returns the one with the highest score. Self-consistency (Wang et al., 2022) takes a majority vote over final answers. Both are effective, but expensive: their cost is NN full generations per prompt, and NN must be large enough for the hardest prompt in the workload. Since inference is the dominant cost of deployed language models, the token budget spent on selection should be minimized.

A fixed budget of NN is uniform across prompts, while the computation required by prompts varies enormously. On a prompt where the policy immediately concentrates on a single answer, ten samples are enough, whereas on a prompt on which the policy remains genuinely divided, even a thousand samples are not sufficient. Fixed-budget selection, therefore, results in both over- and underspending of tokens. Adaptive methods address this by halting generation once the sampled answers look settled, e.g., stopping when a posterior over answer frequencies concentrates (Aggarwal et al., 2023; Wan et al., 2025), when the marginal value of another sample falls below its cost (Kalayci et al., 2025), or when a budget estimated from a short burn-in is exhausted (Raman et al., 2026). In every case, the halting rule is a tuned threshold with no control over the probability of stopping on the non-dominant answer. Moreover, they must be re-tuned for each new policy, reward model, and benchmark.

One would instead like an anytime-valid stopping rule that takes a formal error level α\alpha as input and adapts the token budget accordingly, guaranteeing that the probability of erroneously certifying a non-dominant answer (θa∗≤p†\theta_{a^{*}}\leq p^{\dagger}) is strictly bounded by α\alpha. The rule must be defined based on a computable statistic of the generations. Since many distinct reasoning traces can yield the same final answer, we group responses by their final answers and frame the stopping rule at the answer level. We introduce Reward-Weighted Self-Consistency (RWSC), which scores each cluster by the softmax-weighted mass of its members’ reward scores, so that a cluster is favored both for containing many responses and for highly rewarded ones. Let a∗a^{*} denote the highest-scoring cluster (the leading answer) at the current step. Framing stopping as the question – is a⋆a^{\star} genuinely the dominant answer, or merely ahead by chance? – makes it a sequential hypothesis testing problem. Wald’s sequential probability ratio test (SPRT) is the classic solution: as each new response arrives, one accumulates evidence for or against the leader and stops once it crosses a boundary (Wald, 1945). It performs strongly in practice, but remains a heuristic here, without any rigorous error-control guarantee.

Wald’s guarantee assumes hypotheses that are fixed in advance, tested by a single terminal decision, and none of these holds here. Writing θa\theta_{a} for the probability that a fresh response yields answer aa, the rates defining the test are estimated from the same responses the test then examines, rather than fixed beforehand. The leading answer a∗a^{*} is itself a function of the sampled responses, so the parameter under test, θa∗\theta_{a^{*}}, shifts whenever the leader does, forcing the test to restart. And the statistic is checked after every response, not at a single stopping point. Each of these voids the error control that Wald’s boundaries nominally provide. We resolve this with anytime-valid inference (Ramdas et al., 2023), whose guarantees hold under continuous monitoring and arbitrary stopping. We maintain a separate betting supermartingale for each final answer the policy produces, instantiating one when that answer first appears and assigning it a weight from a fixed, summable sequence. Since the weights sum to 1, they split a single error budget across answers, regardless of how many arise. Ville’s inequality (Ville, 1939) then bounds by α\alpha the probability that a non-dominant answer (θa≤1/2\theta_{a}\leq 1/2) is ever certified, uniformly over time and over a growing set of answers. This addresses each failure of SPRT. A change in the leading answer is irrelevant, since every answer accumulates its own evidence. Continuous monitoring is an inherent property of Ville’s inequality, so checking the boundary after each response incurs no additional cost.

Validity requires only that the bets be predictable, each computed from earlier responses before the next one is sampled. The reward model sets each bet based on the current RWSC score of the answer cluster, which buys efficiency when the scores are accurate. The gain has a precise form: under the log-optimal Kelly betting (Kelly, 1956), evidence for a dominant answer accrues at a rate dKL(θa∣∣1/2)d_{\mathrm{KL}}(\theta_{a}||1/2), so certification takes about log⁡(1/α)/dKL(θa∣∣1/2)\log(1/\alpha)/d_{\mathrm{KL}}(\theta_{a}||1/2) sampled responses. An accurate RWSC score bets near-optimally and approaches this rate, while an inaccurate or hacked score bets poorly and slows the certification. But it never crosses the boundary in expectation under the null, since validity does not depend on the estimate being correct.

The efficiency of the stopping rule, therefore, adapts to the prompt. The number of tokens spent scales with its difficulty: an answer the policy strongly favors (θa>1/2\theta_{a}>1/2) is certified in a few responses, whereas one near the decision boundary θa=1/2\theta_{a}=1/2 takes many, often more than the budget allows, in which case the procedure certifies nothing and falls back to standard aggregation. Either way, the practitioner fixes the error-control probability α\alpha once, and the number of responses adjusts itself to each prompt. We summarize our contributions as follows.

(i) We cast early stopping as a sequential hypothesis-testing problem and introduce SPRT-RWSC, which applies Wald’s test to determine when the leading answer has converged. It operates on Reward-Weighted Self-Consistency (RWSC): an answer-level aggregation rule that scores answer clusters by reward-weighted mass, and recovers majority voting and Best-of-NN as extreme cases. It works well in practice, but Wald’s error guarantee does not hold in this setting (Section 2).

(ii) We propose e-RWSC, an anytime-valid stopping rule that accumulates evidence over all answers through separate e-processes. It controls the Type-I error (certifying an answer that is not dominant under the policy) at a user-specified level α\alpha, uniformly over time, and over an unknown set of answers. The guarantee holds for any predictable choice of bets, so the reward model, which sets them through RWSC scores, governs only efficiency and never validity. Under a plug-in estimate of the log-optimal Kelly betting, certifying the dominant answer (when one exists) takes O(log⁡(1/α)/dKL(θa∗∣∣1/2))O\bigl(\log(1/\alpha)/d_{\mathrm{KL}}(\theta_{a^{*}}||1/2)\bigr) responses as α→0\alpha\to 0. So, the number of tokens spent scales with the prompt’s difficulty (Section 3).

(iii) An empirical study on 5 Language Models (Qwen2.5-3B, Qwen2.5-7B, Llama-3-8B, Phi-3-Mini-4K, Mistral-24B) with 4 Reward Models (ArmoRM, FsfairX, Skywork V1, Skywork V2) over 4 Benchmarks (GSM8K, MATH500, MMLU, CruxEval) showing that realized certification error stays below the nominal level, that per-response cost follows the predicted 1/dKL1/d_{\mathrm{KL}} scaling with prompt difficulty, and that e-RWSC matches or outperform several baselines at substantially lower average cost (Section 4). For example, with Qwen-2.5-3B as the language model, ArmoRM as the reward model, and a maximum generation budget capped at 512, on the MATH500 Benchmark, we achieve an 8.2% absolute accuracy gain over BoN with a 61.7% smaller budget.

Related work. A line of work improves which response is chosen from a pool: reward-weighted selection with a temperature (Verdun et al., 2025), ensemble reward models normalized across members (Coste et al., 2024), and step-level search or process verification that refine how each candidate is generated and scored (Qiu et al., 2025; Chen et al., 2024; Chen et al., 2025; Lee et al., 2025a). RWSC draws on the first two but aggregates over final answers rather than individual candidates. Our contribution concerns the orthogonal question of how many candidates to generate. The adaptive stopping methods (Aggarwal et al., 2023; Wan et al., 2025; Kalayci et al., 2025; Raman et al., 2026; Sun et al., 2024) share a common limitation: their halting rules are tuned thresholds resting on distributional assumptions, with no control over the probability of stopping on the wrong answer. ConSol (Lee et al., 2025b), like SPRT-RWSC, applies Wald’s test to halt self-consistency generation, but compares only the top two answers and uses static priors. Two recent works give anytime-valid certificates for self-consistency: MMC (Cordero-Encinar and Duncan, 2025) certifies the empirical-leader mode via paired e-processes and couples this with test-time training, and CITE (Ota et al., 2026) certifies a fixed target as the unique mode with a matching minimax lower bound. Unlike reward-agnostic mode certifiers (MMC, CITE), e-RWSC uses reward-informed betting to certify strict majority dominance (p†≥0.5p^{\dagger}\geq 0.5), achieving 94.5%94.5\% accuracy on certified early stopped answers vs. 88.9%88.9\% for MMC with a lower budget.