CarBoN: Calibrated Best-of-N Sampling
Improves Test-time Reasoning

1EPFL, 2Idiap Research Institute, 3IBM Research

Abstract

Allocating more computation during inference time (test-time scaling) improves language model performance, especially for reasoning tasks. However, popular methods like Best-of-N sampling often show diminishing returns as N increases. To address this inefficiency, we introduce a general test-time calibration framework that adaptively modifies the model toward high-reward reasoning paths, with theoretical guarantees of improving the lower bound of expected reward under finite sampling, all without large language model (LLM) retraining. Within this framework, we propose CarBoN (Calibrated Best-of-N), a two-phase method that first explores the solution space and then learns a calibration of the logits via an input-specific temperature T and additive shift vector δ, guiding generation toward more reliable reasoning.

Experiments on MATH-500 and AIME-2024 show that CarBoN improves efficiency, with up to 4× fewer rollouts to reach the same accuracy, while often achieving higher accuracy under fixed budgets. We also analyze the complementary roles of T and δ in balancing output diversity and correctness, and demonstrate that the framework also generalizes to step-level sampling strategies such as beam search.

Why calibration for test-time scaling (TTS)? A motivating example of reward-based binary search.

Let the task be finding a target in [0,104]. Calibration means that before each search step the model can query n candidate points for reward, where n denotes the number of reward queries per step. The reward is defined as the inverse distance to the target plus noise. The baseline binary search, corresponding to naive TTS (n=0), requires 13.3 steps on average. Increasing n significantly accelerates convergence: for example, with n=16 the search depth is reduced by up to 74% (see Figure 1, left). Figure 1 (right) shows an example run where calibration quickly converges to the target, while vanilla binary search continues oscillating. This example highlights that reward feedback for calibration reshapes the sampling distribution and motivates its use for TTS.

Reward-guided calibration accelerates binary search

Figure 1. Reward-guided calibration accelerates binary search. Left: Increasing per-step noisy reward (inverse-distance signal + noise) lowers average search steps versus vanilla. Right: Example showing reward guidance converges early; vanilla keeps oscillating.

Overview of Test-time Calibration Framework

Building on this principle, our framework reuses sampled completions that are normally discarded in parallel sampling methods to extract reward signals and perform calibration. Within this framework, we introduce CarBoN (Calibrated Best-of-N). Without modifying the original LLM, our framework allocates part of the budget to exploration and calibration, then focuses the remaining budget on high-scoring regions using logit calibration. Reusing high-scoring answer selected by reward model enhances answer quality and query efficiency, under the same inference budget.

Test-time calibration framework and MATH-500 results

Figure 2. (a) Test-time calibration framework. With a rollout budget N = N1 + N2, the model first explores by generating and scoring N1 candidate responses. The model then learns calibration parameters (δ, T) from high-scoring responses, using them to adjust the logits for the remaining N2 generations. The final answer is selected from all N candidates. (b) MATH-500 Results. CarBoN improves weighted Best-of-N accuracy across four models. For all models, calibrated accuracy at N=64 (orange dash line) matches or exceeds uncalibrated accuracy at N=256, corresponding to up to a 4× reduction in rollout budgets. Notably, with Qwen2.5-Math-1.5B-Instruct at N=64, CarBoN surpasses GPT-4o (red dashed line), while uncalibrated Best-of-N with N=256 does not.

Theoretical Analysis

We provide theoretical foundations for our calibration framework through three formal results. Lemma 1 establishes the existence of joint calibration parameters \((\delta^*, T^*)\) that provably improve the model's predictive distribution when the base model is not perfectly calibrated. Theorem 1 proves that applying such calibration strictly increases the expected reward under finite Best-of-\(N\) sampling, by showing that calibration achieves first-order stochastic dominance—making high-reward outputs more likely. Corollary 1 demonstrates that discarding exploration samples and using only calibrated samples is strictly suboptimal. Together, these results rigorously justify why test-time calibration works and why both phases are essential.

Lemma 1: Existence of an Improving Joint Solution \((\delta, T)\)

Let the joint loss function be \(\mathcal{L}(\delta, T) = \mathbb{E}_{y \sim \mathcal{D}_\text{calib}(x)} \left[ -\log p_\theta(y \mid x; \delta, T) \right]\). Let \(\bar{p}_{\theta}\) be the model's average predictive distribution and \(\bar{p}_{\text{target}}\) be the empirical average one-hot distribution, both averaged over all generation steps in the calibration set \(\mathcal{D}_\text{calib}(x)\). Suppose the base model is not perfectly calibrated in the sense that at least one of the following conditions holds: (1) \(\bar{p}_{\theta} \neq \bar{p}_{\text{target}}\), or (2) the average logit of ground-truth tokens does not equal the average expected logit.

Then there exists a joint solution \((\delta, T) \in \mathbb{R}^D \times (0, \infty)\), where \((\delta, T) \neq (\mathbf{0}, 1)\), such that the loss is strictly reduced: \[\mathcal{L}(\delta, T) < \mathcal{L}(\mathbf{0}, 1)\]

Theorem 1: Joint Calibration \((\delta, T)\) Improves Expected Reward from Best-of-\(N\) Sampling

Let \(p_{\theta}(y \mid x; \delta, T)\) be the model's probability distribution over outputs \(y \in \mathcal{Y}\), parameterized by a calibration vector \(\delta\) and a temperature \(T\). Let the base model be configured with parameters \((\mathbf{0}, T_{base})\) for some \(T_{base} > 0\). Let \(R(x,y)\) be a reward function, and assume there exists a unique output \(y^* \in \mathcal{Y}\) with a strictly maximum reward, i.e., \(r^* = R(x,y^*) > \max_{y \neq y^*} R(x,y) = r_{\text{other\_max}}\).

We consider cases where joint calibration with parameters \((\delta^*, T^*)\) improves upon the base model by increasing the probability of the unique optimal output: \[p_{\theta}(y^* \mid x; \delta^*, T^*) > p_{\theta}(y^* \mid x; \mathbf{0}, T_{base})\]

Then, for any \(n \geq 1\) within the remaining inference budget after calibration, the lower bound on the expected best-of-\(N\) reward under the jointly calibrated model is strictly greater than that of the base model. Specifically, let \(R_{LB}(p) = r^* - (1-p)^n (r^* - r_{\text{other\_max}})\) be a valid lower bound for the expected best-of-\(N\) reward, where \(p\) is the probability of sampling \(y^*\). The improvement in this lower bound is strictly positive: \[\Delta_{R_{LB}}(x,n) = R_{LB}(p_{\theta}(y^* \mid x; \delta^*, T^*)) - R_{LB}(p_{\theta}(y^* \mid x; \mathbf{0}, T_{base})) > 0\]

Corollary 1: Sub-optimality of Exploitation Alone

The final candidate is selected by maximizing \(R(x, y)\) over a set of candidates \(\mathcal{Y}\). Since \(\mathcal{Y}_{\text{exploit}}\) is a subset of the union \(\mathcal{Y} = \mathcal{Y}_{\text{explore}} \cup \mathcal{Y}_{\text{exploit}}\), the strategy of only selecting from \(\mathcal{Y}_{\text{exploit}}\) is sub-optimal compared to selecting from the union.

This is because the maximum reward achievable from the union is greater than or equal to the maximum reward achievable from the exploitation set alone: \[\max_{y \in \mathcal{Y}_{\text{explore}} \cup \mathcal{Y}_{\text{exploit}}} R(x, y) \geq \max_{y \in \mathcal{Y}_{\text{exploit}}} R(x, y)\]

Therefore, including exploration samples in the final candidate pool is essential for maximizing expected reward.

Empirical Results

We evaluate CarBoN on MATH-500 and AIME-2024 benchmarks across multiple language models. The results demonstrate that CarBoN consistently improves upon standard Best-of-\(N\) sampling, with calibrated accuracy at \(N=64\) matching or exceeding uncalibrated results at \(N=256\) (\(4\times\) reduction in rollout budget).

MATH-500 Results

Table 1. Accuracy (%) of four models on MATH-500, comparing Weighted Best-of-N methods before and after calibration. CarBoN enables further improvements beyond the plateau of standard Best-of-N, with calibrated accuracy at N=64 exceeding the uncalibrated results at N=256. Bold indicates better accuracy for each N.

Model Method N=8 N=16 N=32 N=64 N=128 N=256
Llama-3.2-1B-Instruct Best-of-N 42.0 44.6 47.8 48.6 50.6 50.8
CarBoN 43.0 45.6 48.4 51.0 51.8 51.8
Llama-3.2-3B-Instruct Best-of-N 56.8 58.2 59.6 61.6 61.8 62.2
CarBoN 57.6 59.0 60.8 62.2 63.2 63.4
Qwen2.5-1.5B-Instruct Best-of-N 56.4 57.6 61.4 62.0 62.6 62.2
CarBoN 55.0 60.0 61.8 62.4 64.0 64.4
Qwen2.5-Math-1.5B-Instruct Best-of-N 73.6 75.4 76.4 75.6 76.4 76.8
CarBoN 74.2 76.0 76.4 77.2 77.2 77.8

AIME-2024 Results

Table 2. Correct answers (out of 30) on the AIME-2024 benchmark for two math-specialized models, comparing Best-of-N and CarBoN across different rollout budgets. CarBoN enables further improvements beyond the plateau of standard Best-of-N. Bold numbers indicate the higher number of correct answers for each N.

Model Method N=16 N=32 N=64 N=128 N=256
Qwen2.5-Math-1.5B-Instruct Best-of-N 4/30 5/30 6/30 6/30 6/30
CarBoN 4/30 5/30 6/30 7/30 7/30
Qwen2.5-Math-7B-Instruct Best-of-N 5/30 5/30 6/30 6/30 6/30
CarBoN 5/30 6/30 6/30 6/30 7/30

Generalizing Test-time Calibration Beyond Best-of-N

Test-time calibration is not limited to Best-of-N sampling. We show that calibrating step-level strategies such as beam search can further improve sample efficiency and accuracy. As shown below, calibrated beam search achieves similar or better performance with fewer candidates, demonstrating the generality of our approach.

Table 3. Accuracy (%) of standard and calibrated beam search on the MATH-500 benchmark. Calibrated beam search generally improves test-time reasoning performance, especially for larger N.

Model Method N=8 N=16 N=32 N=64
Llama-3.2-1B-Instruct Beam Search 56.0 58.4 60.4 62.2
Calibrated Beam Search 57.2 60.0 62.2 64.2
Qwen2.5-Math-1.5B-Instruct Beam Search 79.0 79.2 80.2 81.4
Calibrated Beam Search 78.6 79.6 81.2 82.8

For more detailed ablation studies and analysis, please refer to our paper.

BibTeX

@misc{tang2025carboncalibratedbestofnsampling,
  title={CarBoN: Calibrated Best-of-N Sampling Improves Test-time Reasoning}, 
  author={Yung-Chen Tang and Pin-Yu Chen and Andrea Cavallaro},
  year={2025},
  eprint={2510.15674},
  archivePrefix={arXiv},
  primaryClass={cs.LG},
  url={https://arxiv.org/abs/2510.15674}, 
}