Manuscript Offprint

arXiv:2610.09250

Efficient Best-of-N policy evaluation for inference-time alignment

Jonas Schweisthal, Yuxin Wang, Athiya Deviyani, Stefan Feuerriegel, Dennis Frauen

ABSTRACT

Best-of-N (BoN) is a common inference-time alignment method that selects the highest-scoring response among N samples from a reference model. Evaluating BoN policies from logged data is challenging under sample-only access because standard off-policy estimators require density ratios that depend on unavailable response likelihoods. In this paper, we propose a sample-only framework for evaluating and selecting BoN policies without access to these likelihoods. We show that the order-statistic structure of BoN allows the required density ratios to be expressed through score-rank probabilities that are estimable from samples alone. We then develop a doubly robust estimator of the BoN policy value (BoN-DR) that efficiently reuses a shared auxiliary sample pool across candidate budgets. We establish valid asymptotic inference even under reward estimator misspecification and prove the efficiency of our BoN-DR estimator. Since larger budgets can amplify errors in the score function and lead to reward overoptimization, we derive two selection rules: (i) maximizing the estimated policy value and (ii) maximizing a lower confidence bound on the improvement over the reference policy, which accounts for estimation uncertainty and provides a no-harm guarantee. Across synthetic experiments and GSM8K with multiple reference and reward models, our framework accurately estimates BoN policy values and selects effective sampling budgets.

1 INTRODUCTION

In inference-time alignment, the aim is to improve the behavior of a given generative model using sampled outputs and an auxiliary reward or preference signal, but without updating or accessing the model parameters (Huang et al., 2025; Khalaf et al., 2025). This is relevant in practice, where one often interacts with a model through a restricted interface and cannot modify the underlying parameters. For example, many large companies want to adapt frontier LLMs with API-only access to their own preferences and needs (Kosmas et al., 2025), such as a car manufacturer using collected user feedback to improve a third-party in-car assistant.

A widely used approach is Best-of-N (BoN) sampling (Nakano et al., 2021; Beirami et al., 2025), which has two steps: (1) for a prompt x, the reference model (e.g., the LLM) generates N candidate responses; and (2) a score function s (e.g., an externally pre-trained reward model or an LLM judge) selects the highest-scoring response (Nakano et al., 2021; Beirami et al., 2025). Importantly, BoN requires only samples and no modification of the reference model. However, deploying BoN in practice is subject to two challenges:

Challenge ①: Evaluating BoN policies under sample-only access. Practitioners need to know whether and, in particular, how much a BoN policy actually improves the true downstream reward (and not only the score) over the reference model. From logged responses and rewards, this is an off-policy evaluation (OPE) problem. Yet, standard OPE estimators (e.g., importance-weighted and doubly robust estimators) are not applicable. The reason is that these estimators require the

1^{1}LMU Munich & MCML, 2^{2}Carnegie Mellon University, 3^{3}Meta (work in personal capacity). ∗^{*}Equal contribution.

Figure

N

N

N

Figure 1: The score function does not reveal the optimal inference-time budget. Best-of-N on GSM8K (Cobbe et al., 2021) for three reference models using OASST-RM-2.1 as the score model. Black solid: task accuracy computed from 512 stored responses for each of the 1,319 held-out test prompts. Magenta dashed: mean selected-response score (right axis). Grey dotted: reference-model accuracy (N = 1). Red circles mark the accuracy-optimal budget N∗N^*. ⇒\Rightarrow Takeaway: The proxy score increases with N, but accuracy peaks and then falls, showing that the score function alone cannot determine the best sampling budget.

density ratio between the target policy and the policy that generated the logged data (Dudik et al., 2011). Under sample-only access, however, the probabilities assigned to complete responses, i.e., the response likelihoods, are unavailable. ⇒\Rightarrow We therefore need an estimator that evaluates BoN policies without evaluating the response likelihoods.

Challenge ②: Selecting the sampling budget N. The sampling budget N controls how strongly BoN optimizes the score: a small N limits the potential benefit, while a large N concentrates the policy on low-probability, high-scoring responses. When the score function is an imperfect proxy for the downstream reward, this can amplify its errors and reduce downstream performance. This issue is often known as reward overoptimization (Gao et al., 2023; Coste et al., 2024). Figure 1 illustrates the issue on GSM8K: the score function of the selected response increases with N, while the downstream accuracy can peak and then decline. The score function alone therefore does not reveal which N should be deployed; instead, this requires estimating the policy value of each candidate budget. However, even unbiased value estimates are noisy in finite samples, especially for large N, where the BoN policy concentrates on responses that are rarely observed in the logged data. Directly maximizing them can thus lead to harmful budget choices. ⇒\Rightarrow We therefore need a selection rule that accounts for uncertainty when comparing candidate budgets and guards against harmful departures from the reference policy.

In this paper, we address both challenges by developing a sample-only framework for evaluating BoN policies and selecting the inference-time sampling budget N. We proceed in two steps:

① Estimation (→ Section 4): To develop an estimator, we exploit a statistical property of BoN: the underlying order-statistic structure makes the otherwise unavailable density ratio between the BoN policy and the reference model expressible through the probabilities that a fresh reference-model sample scores below or at a given response, which can be estimated from samples alone. Building on this, we construct a doubly robust estimator of the BoN policy value (called BoN-DR) without access to response likelihoods. Here, BoN-DR separates the score used to select responses from the reward estimator used to evaluate them. Further, it reuses a shared auxiliary sample pool across candidate budgets and is unbiased for any finite pool size. We show that our BoN-DR yields asymptotically valid inference even when the reward estimator is misspecified, and that it attains the efficiency of an exact-ratio DR estimator as the pool grows and the reward estimator is consistent.

② Selecting N (→ Section 5): To select the sampling budget N, we develop two selection rules: (i) Value Maximization chooses the budget with the largest estimated policy value; and (ii) Safe Improvement chooses the budget with the largest lower confidence bound (LCB) on the improvement over the reference policy, with a fallback to N = 1 if no LCB is positive. We show that both rules asymptotically attain the best policy value on the candidate grid, while Safe Improvement additionally provides an asymptotic no-harm guarantee relative to the reference policy with high probability. To compute the LCB, we further construct simultaneous confidence bounds across candidate budgets. Unlike pointwise intervals, these bounds account for searching over the candidate grid and remain asymptotically valid after N is selected from the same data.

Our contributions are fourfold: 1^{1} (1) We develop BoN-DR, a novel, unbiased doubly robust estimator for evaluating BoN policies from logged data, which requires only sample access to the reference model. (2) We prove statistical guarantees for BoN-DR, including robustness to reward estimator misspecification, asymptotic normality, and efficiency. (3) We propose two principled selection rules for N (i.e., Value Maximization and Safe Improvement) with consistency and a no-harm guarantee. (4) We evaluate our methods in synthetic experiments and on GSM8K across multiple reference and score models.

References (82)

  • Best-of-n through the smoothing lens: KI divergence and regret analysis
  • Theoretical guarantees on the best-of-n alignment policy
  • Off-policy evaluation from logged human feedback (opens arXiv in a new tab)
  • Large language monkeys: Scaling inference compute with repeated sampling (opens arXiv in a new tab)
  • Evaluating Large Language Models Trained on Code
  • Gaussian approximations and multiplier bootstrap for maxima of sums of high-dimensional random vectors
  • Inference-aware fine-tuning for best-of-n sampling in large language models
  • Training Verifiers to Solve Math Word Problems
  • Reward model ensembles help mitigate overoptimization
  • Doubly robust policy evaluation and learning
  • Nonparametric llm evaluation from preference data
  • Scaling laws for reward model overoptimization
  • The Llama 3 Herd of Models
  • Bonbon alignment for large language models and the sweetness of best-of-n sampling
  • Generalizing off-policy learning under sample selection bias
  • Efficient and sharp off-policy learning under unobserved confounding
  • A generalization of sampling without replacement from a finite universe
  • Is best-of-n the best of them? coverage, scaling, and optimality in inference-time alignment
  • Policy learning “without” overlap: Pessimism and generalized empirical bernstein’s inequality
  • Regularized best-of-n sampling with minimum bayes risk objective for language model alignment
  • Nathan Kallus. More efficient policy learning via optimal retargeting. Journal of the American Statistical Association, 116(534):646–658, 2021. doi: 10.1080/01621459.2020.1788948. (opens the publisher in a new tab)
  • Double reinforcement learning for efficient off-policy evaluation in markov decision processes
  • Off-policy confidence sequences
  • Inference-time reward hacking in large language models
  • Advances in neural information processing systems, 36:47669–47681, 2023
  • From code to culture: Aligning large language models with corporate values
  • Confident off-policy evaluation and selection through self-normalized importance weighting
  • Safe policy improvement with baseline bootstrapping
  • Unbiased offline evaluation of contextual-bandit-based news article recommendation algorithms
  • Policy evaluation for reinforcement learning from human feedback: A sample complexity analysis
  • Information theoretic guarantees for policy alignment in large language models
  • WebGPT: Browser-assisted question-answering with human feedback
  • Efficient counterfactual learning from bandit feedback
  • Adabon: Adaptive best-of-n alignment (opens arXiv in a new tab)
  • Estimation of regression coefficients when some regressors are not always observed
  • Improved offline contextual bandits with second-order bounds: Betting and freezing (opens arXiv in a new tab)
  • Off-policy evaluation for large action spaces via embeddings
  • Reliable off-policy learning for dosage combinations
  • Aligning llms with best-of-n distillation
  • Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameters
  • Revisiting the (sub) optimality of best-of-n for inference-time alignment (opens arXiv in a new tab)
  • Learning to summarize with human feedback
  • Learning from logged implicit exploration data
  • Gemma 2: Improving Open Language Models at a Practical Size
  • High-confidence off-policy evaluation
  • High confidence policy improvement
  • Soft best-of-n sampling for model alignment
  • Optimal and adaptive off-policy evaluation in contextual bandits
  • Asymptotics of language model alignment
  • From curiosity to caution: Mitigating reward hacking for best-of-n with pessimism (opens arXiv in a new tab)
  • Advances in neural information processing systems, 36:46595–46623, 2023
  • Theoretical work characterizes the BoN policy, its KL divergence to the reference policy, and its optimality and scaling behavior (Gui et al., 2024; Yang et al., 2024; Mroueh & Nitsure, 2025; Beirami et al., 2025; Huang et al., 2025; Sriraman & Block, 2026)
  • Thus the unknown components relevant to the efficiency bound are the context distribution and conditional reward distribution
  • There are therefore
  • Applying this to the plug-in and weight kernels, using $0 \leq \hat{w}_N^{s_n,M}, w_N^{s_n} \leq N$, yields
  • The standard AIPW influence function for its value is
  • Thus $\phi_{N,n}^{\text{eff}}$ is the efficient influence function in this model, and (33) establishes the claimed efficiency
  • the finite-pool approximation is mean zero for every $M_n$, so it is enough that its per-observation variance vanish as $M_n \to \infty$
  • If $\Delta^\star < 0$, all lower bounds are eventually negative and the procedure selects $N = 1$
  • Each repetition contains $n$ independent logged observations and $M$ independent auxiliary behavior-policy draws per logged context
  • We split the training questions deterministically into 3,500 prompts for fitting the reward function and 3,973 validation prompts for off-policy evaluation and selection, and reserve the official test set for the exact evaluation of selected policies
  • It is fit once on the 3,500 training prompts and held fixed across repetitions, budgets, and selection rules
  • Consequently, errors in the estimated reward function are not corrected by the Plug-in estimator
  • Pointwise confidence intervals use the Wald form $\hat{V}_{\mathrm{DR}}^M(\pi_N^s) \pm z_{1-\alpha/2} \hat{\sigma}_{N,M} / \sqrt{n}$
  • On GSM8K, estimation and coverage are evaluated against the exact benchmark induced by the stored validation responses, while selected budgets are evaluated independently on the held-out test set
  • It contains 5,100 per-repetition records for the Synthetic experiments and 3,600 for GSM8K, covering every combination of environment, estimator, budget, and selection rule reported here and in the appendix
  • Figure 6 reports policy-value estimation at N = 256 and Value Maximization selection over the candidate budget grid
  • Correctly specified reward function ( $\delta = 0$), $\gamma = 0.65$, n = 4,096, 300 repetitions
  • The Plug-in bias is large and nearly constant in N, whereas DR and IPW are essentially unbiased at every budget and their dispersion grows as overlap deteriorates
  • Each quantity is averaged over the six configurations, 500 repetitions, log scale
  • Plug-in coverage is zero for both, so the failure reported in RQ2 is a property of the estimator under misspecification and not an artifact of the score-calibration spline used in the main text
  • The following subsections report the complete comparisons across configurations
  • >Selection method</td><td colspan=
  • The Synthetic experiments with $\gamma = 0.65$ and $\delta = 0.6$ has an interior optimal budget, $N^* = 8$, so successful selection must exploit the benefit of increasing N without overoptimizing at larger budgets
  • Safe Improvement is slightly more conservative, but retains most of the gain while likewise avoiding harmful selections
  • Value Maximization selection nevertheless frequently chooses larger, harmful budgets: BoN-IPW and BoN-DR lose 0.84 and 0.82 accuracy percentage points on average, with harm rates of 77% and 73%, respectively
  • Two patterns hold throughout
  • Given a prompt $x$, the BoN policy induced by $\pi_{b,1}$ samples
  • We denote the resulting policy by $q_N(\cdot \mid x)$
  • The Bradley–Terry model is useful because it connects pairwise preferences to the reward modeling perspective common in RLHF. However, the pairwise win-rate estimand does not require the Bradley–Terry model for identification
  • The $M$ terms above are independent Monte Carlo replicates, each using $\widetilde{N}$ candidate draws and an independent opponent draw; this is a direct Monte Carlo construction rather than the pooled estimator of Section 4.2
  • Given samples