CS329Z中文学习站

"优化地扩展 LLM 测试时计算,可以比扩展模型参数更有效"

"Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameters"

Charlie Snell, Jaehoon Lee, Kelvin Xu, Aviral Kumar · "ICLR 2025 · UC Berkeley / Google DeepMind"

必读全译对照查看原文(PDF) ↗

导读

本文是第 5 周「优化」的核心论文,也是 o1 式"推理模型"的理论起点之一:给模型更多推理时间到底能带来多少提升、怎么分配最划算?作者在 MATH 上用 PaLM 2-S 分析两大机制——对过程奖励模型(PRM)搜索、迭代修订提议分布——发现没有万能策略,关键变量是题目相对基础模型的难度;据此提出按难度自适应的"计算最优"策略:最多 4 倍少算力超过 best-of-N;FLOPs 对齐下小模型+推理算力在易/中档题上打败 14 倍参数大模型。本页为全文中英对照*版本(正文全部,附录略),可用顶部按钮切换"仅看中文"。

全文对照翻译

译注:覆盖论文正文(摘要至第 8 节,原文第 1-16 页)。附录 A-O(补充实验、PRM 训练细节、示例轨迹等)未收录,请查阅原文 PDF;其要点已浓缩在文末"要点速览"。

EN

**ABSTRACT** — Enabling LLMs to improve their outputs by using more test-time computation is a critical step towards building generally self-improving agents that can operate on open-ended natural language. In this paper, we study the scaling of inference-time computation in LLMs, with a focus on answering the question: if an LLM is allowed to use a fixed but non-trivial amount of inference-time compute, how much can it improve its performance on a challenging prompt? Answering this question has implications not only on the achievable performance of LLMs, but also on the future of LLM pretraining and how one should tradeoff inference-time and pre-training compute. Despite its importance, little research attempted to understand the scaling behaviors of various test-time inference methods. Moreover, current work largely provides negative results for a number of these strategies. In this work, we analyze two primary mechanisms to scale test-time computation: (1) searching against dense, process-based verifier reward models; and (2) updating the model's distribution over a response adaptively, given the prompt at test time. We find that in both cases, the effectiveness of different approaches to scaling test-time compute critically varies depending on the difficulty of the prompt. This observation motivates applying a "compute-optimal" scaling strategy, which acts to most effectively allocate test-time compute adaptively per prompt. Using this compute-optimal strategy, we can improve the efficiency of test-time compute scaling by more than 4× compared to a best-of-N baseline. Additionally, in a FLOPs-matched evaluation, we find that on problems where a smaller base model attains somewhat non-trivial success rates, test-time compute can be used to outperform a 14× larger model.

摘要 —— 让 LLM 通过使用更多测试时计算来改进自身输出,是构建能在开放自然语言上运行的通用自我改进智能体的关键一步。本文研究 LLM 推理时计算的扩展问题,聚焦回答:若允许 LLM 使用固定但不可忽略的推理时算力,它在一个有挑战性的 prompt 上能提升多少? 回答该问题不仅关乎 LLM 可达到的性能上限,也关乎 LLM 预训练的未来,以及应如何在推理时算力与预训练算力之间权衡。尽管重要,却很少有研究尝试理解各类测试时推理方法的扩展行为,且现有工作对其中不少策略主要给出负面结果。本文分析扩展测试时计算的两大机制:(1) 针对稠密的、基于过程的验证器奖励模型进行搜索;(2) 测试时根据 prompt 自适应地更新模型对回答的分布。我们发现,在这两种情形下,不同方法的有效性都关键取决于 prompt 的难度。这一观察启发我们采用"计算最优"扩展策略——按 prompt 自适应地最有效分配测试时算力。使用该策略,相比 best-of-N 基线可将测试时算力扩展的效率提升 4 倍以上。此外,在 FLOPs 对齐评测中,我们发现在较小基座模型已能取得一定非平凡成功率的问题上,测试时计算可被用来超过 14 倍大的模型。

1 引言

EN

Humans tend to think for longer on difficult problems to reliably improve their decisions. Can we instill a similar capability into today's large language models (LLMs)? More specifically, given a challenging input query, can we enable language models to most effectively make use of additional computation at test time so as to improve the accuracy of their response? In theory, by applying additional computation at test time, an LLM should be able to do better than what it was trained to do. In addition, such a capability at test-time also has the potential to unlock new avenues in agentic and reasoning tasks. For instance, if pre-trained model size can be traded off for additional computation during inference, this would enable LLM deployment in use-cases where smaller on-device models could be used in place of datacenter scale LLMs. Automating the generation of improved model outputs by using additional inference-time computation also provides a path towards a general self-improvement algorithm that can function with reduced human supervision.

人类遇到难题会思考更久,以可靠地改进决策。我们能把类似能力注入今天的大语言模型吗?具体地说,给定一个有挑战性的输入查询,能否让语言模型最有效地利用测试时的额外计算来提升回答准确率?理论上,施加额外测试时计算,LLM 应能超出其训练目标的表现;这种测试时能力也有望为智能体与推理任务解锁新路径。例如,若预训练模型尺寸可与推理时额外计算互换,就能在端侧小模型替代数据中心级 LLM 的场景中部署;用额外推理时计算自动生成更优的模型输出,也提供了一条减少人类监督的通用自我改进算法之路。

EN

Prior work studying inference-time computation provides mixed results. On the one hand, some works show that current LLMs can use test-time computation to improve their outputs, on the other hand, other work shows that the effectiveness of these methods on more complex tasks such as math reasoning remains highly limited, even though reasoning problems often require drawing inferences about existing knowledge as opposed to new knowledge. These sorts of conflicting findings motivate the need for a systematic analysis of different approaches for scaling test-time compute.

此前关于推理时计算的研究结果好坏参半:一些工作显示现有 LLM 能用测试时计算改进输出;另一些工作则显示这些方法在数学推理等更复杂任务上收效甚微——尽管推理问题通常需要的是对既有知识做推断而非新知识。这些矛盾发现促使我们系统分析不同的测试时算力扩展方法。

EN

Arguably the simplest and most well-studied approach for scaling test-time computation is best-of-N sampling: sampling N outputs in "parallel" from a base LLM and selecting the one that scores the highest per a learned verifier or a reward model. However, this approach is not the only way to use test-time compute to improve LLMs. By modifying either the proposal distribution from which responses are obtained (for instance, by asking the base model to revise its original responses "sequentially") or by altering how the verifier is used (e.g. by training a process-based dense verifier and searching against this verifier), the ability scale test-time compute could be greatly improved, as we show in the paper.

可以说,最简单且研究最充分的测试时算力扩展方法是 best-of-N 采样:从基座 LLM "并行"采 N 个输出,按学习到的验证器或奖励模型选得分最高的。但这并非唯一途径:修改提议分布(如让基座模型"顺序地"修订其原始回答),或改变验证器的用法(如训练基于过程的稠密验证器并对其搜索),都能大幅提升可扩展的测试时算力——本文将展示这一点。

EN

To understand the benefits of scaling up test-time computation, we carry out experiments on the challenging MATH benchmark using PaLM-2 models specifically fine-tuned to either revise incorrect answers (e.g. improving the proposal distribution; Section 6) or verify the correctness of individual steps in an answer using a process-based reward model (PRM) (Section 5). With both approaches, we find that the efficacy of a particular test-time compute strategy depends critically on both the nature of the specific problem at hand and the base LLM used. For example, on easier problems, for which the base LLM can already readily produce reasonable responses, allowing the model to iteratively refine its initial answer by predicting a sequence of N revisions (i.e., modifying the proposal distribution), may be a more effective use of test-time compute than sampling N independent responses in parallel. On the other hand, with more difficult problems that may require searching over many different high-level approaches to solving the problem, re-sampling new responses independently in parallel or deploying tree-search against a process-based reward model is likely a more effective way to use test-time computation. This finding illustrates the need to deploy an adaptive "compute-optimal" strategy for scaling test-time compute, wherein the specific approach for utilizing test-time compute is selected depending on the prompt, so as to make the best use of additional computation. We also show that a notion of question difficulty (Section 4) from the perspective of the base LLM can be used to predict the efficacy of test-time computation, enabling us to practically instantiate this 'compute-optimal' strategy given a prompt. By appropriately allocating test-time compute in this way, we are able to greatly improve test-time compute scaling, surpassing the performance of a best-of-N baseline while only using about 4x less computation with both revisions and search (Sections 5 and 6).

为理解扩展测试时计算的好处,我们在有挑战性的 MATH 基准上实验,使用专门微调过的 PaLM-2 模型——或用于修订错误答案(改进提议分布,第 6 节),或用作过程奖励模型(PRM)验证答案中各步骤的正确性(第 5 节)。两种方法下我们都发现:特定测试时算力策略的效力,关键取决于手头问题的性质与所用的基座 LLM。例如,对基座 LLM 已能轻松产出合理回答的简单题,让模型预测 N 次修订的序列来迭代精炼初始答案(即修改提议分布),可能比并行采 N 个独立回答更划算;而对需要搜索多种不同高层解法的难题,并行重采新回答、或对过程奖励模型部署树搜索,则可能是更有效的用法。这说明需要部署自适应的"计算最优"策略:依据 prompt 选择具体的测试时算力用法,以最好地利用额外计算。我们还证明,从基座 LLM 视角定义的题目难度(第 4 节)可用于预测测试时计算的成效,使我们能在给定 prompt 时实际实例化该策略。通过这样恰当分配测试时算力,我们能大幅改进测试时算力扩展——仅用约 4 倍少的计算即可在修订与搜索两个设定下超越 best-of-N 基线(第 5、6 节)。

EN

Using our improved test-time compute scaling strategy, we then aim to understand to what extent test-time computation can effectively substitute for additional pretraining. We conduct a FLOPs-matched comparison between a smaller model with additional test-time compute and pretraining a 14x larger model. We find that on easy and intermediate questions, and even hard questions (depending on the specific conditions on the pretraining and inference workload), additional test-time compute is often preferable to scaling pretraining. This finding suggests that rather than focusing purely on scaling pretraining, in some settings it is be more effective to pretrain smaller models with less compute, and then apply test-time compute to improve model outputs. That said, with the most challenging questions, we observe very little benefits from scaling up test-time compute. Instead, we find that on these questions, it is more effective to make progress by applying additional pretraining compute, demonstrating that current approaches to scaling test-time compute may not be 1-to-1 exchangeable with scaling pretraining. Overall, this suggests that even with a fairly naïve methodology, scaling up test-time computation can already serve to be more preferable to scaling up pretraining, with only more improvements to be attained as test-time strategies mature. Longer term, this hints at a future where fewer FLOPs are spent during pretraining and more FLOPs are spent at inference.

利用改进的测试时算力扩展策略,我们进而想理解:测试时计算能在多大程度上有效替代额外预训练?我们在"小模型+额外测试时算力"与"预训练 14 倍大模型"之间做 FLOPs 对齐比较。发现在容易与中等难度的题目上(取决于预训练与推理负载的具体条件,甚至部分难题上),额外测试时计算通常优于扩大预训练。这提示:与其单纯堆预训练,某些设定下更有效的是用更少算力预训练小模型,再用测试时计算改进输出。不过,在最具挑战性的题目上,扩展测试时计算收益甚微——这些问题上,追加预训练算力更有效。这说明当前的测试时算力扩展方法与预训练扩展并非一一等价可互换。总体上,即便方法相当朴素,扩展测试时计算也已可优于扩展预训练,且随策略成熟还有更大改进空间。长期看,这预示着未来:预训练阶段花费的 FLOPs 更少,而推理阶段花费的 FLOPs 更多。

2 测试时计算的统一视角:提议者与验证器

EN

We first unify approaches for using test-time computation and then analyze some representative methods. First, we view the use of additional test-time compute through the lens of modifying the model's predicted distribution adaptively at test-time, conditioned on a given prompt. Ideally, test-time compute should modify the distribution so as to generate better outputs than naïvely sampling from the LLM itself would. In general, there are two knobs to induce modifications to an LLM's distribution: (1) at the input level: by augmenting the given prompt with an additional set of tokens that the LLM conditions on to obtain the modified distribution, or (2) at the output level: by sampling multiple candidates from the standard LM and performing surgery on these candidates. In other words, we could either modify the proposal distribution induced by the LLM itself such that it is an improvement over naïvely conditioning on the prompt or we could use some post-hoc verifiers or scorers to perform output modifications. This process is reminiscent of Markov chain Monte Carlo (MCMC) sampling from a complex target distribution but by combining a simple proposal distribution and a score function. Modifying the proposal distribution directly by altering input tokens and using a verifier form two independent axes of our study.

我们首先统一各类测试时计算方法,再分析代表性方法。我们把额外测试时算力的使用看作:在给定 prompt 条件下,于测试时自适应地修改模型的预测分布——理想情况下,修改后的分布应产出比朴素采样更好的输出。一般而言,有两个旋钮可诱导分布变化:(1) 输入层面:给 prompt 追加一组 token 让 LLM 条件于其上;(2) 输出层面:从标准 LM 采样多个候选,再对这些候选"动手术"。换言之,要么直接修改 LLM 自身诱导的提议分布使其优于朴素条件化,要么用事后验证器/打分器做输出修改。该过程令人联想到用"简单提议分布 + 打分函数"从复杂目标分布采样的 MCMC。"直接改输入 token 修改提议分布"与"使用验证器"构成本研究的两条独立轴线。

EN

**Modifying the proposal distribution.** One way to improve the proposal distribution is to directly optimize the model for a given reasoning task via RL-inspired finetuning methods such as STaR or ReSTEM. Note that these techniques do not utilize any additional input tokens but specifically finetune the model to induce an improved proposal distribution. Instead, techniques such as self-critique enable the model itself to improve its own proposal distribution at test time by instructing it to critique and revise its own outputs in an iterative fashion. Since prompting off-the-shelf models is not effective at enabling effective revisions at test time, we specifically finetune models to iteratively revise their answers in complex reasoning-based settings. To do so, we utilize the approach of finetuning on on-policy data with Best-of-N guided improvements to the model response.

修改提议分布 —— 一种途径是用 STaR、ReSTEM 等 RL 式微调方法直接为给定推理任务优化模型:这些技术不使用任何额外输入 token,而是专门微调模型以诱导改进的提议分布。另一类是自我批评(self-critique)式技术:指示模型迭代地批评并修订自己的输出,使其在测试时自行改进提议分布。由于直接提示现成模型做有效修订并不可行,我们专门在复杂推理设定下微调"迭代修订"模型,做法是用 best-of-N 引导的改进响应在 on-policy 数据上微调。

EN

**Optimizing the verifier.** In our abstraction of the proposal distribution and verifier, the verifier is used to aggregate or select the best answer from the proposal distribution. The most canonical way to use such a verifier is by applying best-of-N sampling, wherein we sample N complete solutions and then select the best one according to a verifier. However, this approach can be further improved by training a process-based verifier, or a process reward model (PRM), which produces a prediction of the correctness of each intermediate step in an solution, rather than just the final answer. We can then utilize these per-step predictions to perform tree search over the space of solutions, enabling a potentially more efficient and effective way to search against a verifier, compared to naïve best-of-N.

优化验证器 —— 在"提议分布 + 验证器"的抽象中,验证器用于从提议分布中聚合或选出最佳答案。最经典的用法是 best-of-N:采 N 个完整解,按验证器选最佳。但还可以更进一步:训练基于过程的验证器(过程奖励模型,PRM),对解题过程的每个中间步骤(而不只是最终答案)给出正确性预测;再利用这些逐步预测在解空间上做树搜索——相比朴素 best-of-N,这是潜在更高效的验证器搜索方式。

3 如何最优地扩展测试时计算

EN

Given the unification of various methods, we would now like to understand how to most effectively utilize test-time computation to improve LM performance on a given prompt. Concretely we wish to answer: We are given a prompt and a test-time compute budget within which to solve the problem. Under the abstraction above, there are different ways to utilize test-time computation. Each of these methods may be more or less effective depending on the specific problem given. How can we determine the most effective way to utilize test-time compute for a given prompt? And how well would this do against simply utilizing a much bigger pretrained model?

统一各类方法后,我们想理解如何最有效地利用测试时计算来提升 LM 在给定 prompt 上的表现。具体要回答:给定一个 prompt 与测试时算力预算,在上述抽象下存在多种用法,各自效力因题而异——如何为给定 prompt 确定最有效的用法?以及这样做比直接用大得多的预训练模型好多少?

EN

When either refining the proposal distribution or searching against a verifier, there are several different hyper-parameters that can be adjusted to determine how a test-time compute budget should be allocated. For example, when using a model finetuned for revisions as the proposal distribution and an ORM as the verifier, we could either spend the full test-time compute budget on generating N independent samples in parallel from the model and then apply best-of-N, or we could sample N revisions in sequence using a revision model and then select the best answer in the sequence with an ORM, or strike a balance between these extremes. Intuitively, we might expect "easier" problems to benefit more from revisions, since the model's initial samples are more likely to be on the right track but may just need further refinement. On the other hand, challenging problems may require more exploration of different high-level problem solving strategies, so sampling many times independently in parallel may be preferable in this setting. In the case of verifiers, we also have the option to choose between different search algorithms (e.g. beam-search, lookahead-search, best-of-N), each of which may exhibit different properties depending on the quality of the verifier and proposal distribution at hand. More sophisticated search procedures might be more useful in harder problems compared to a much simpler best-of-N or majority baseline.

无论精炼提议分布还是对验证器搜索,都有若干超参数决定算力预算如何分配。例如,用"修订模型"作提议分布、ORM 作验证器时:可以把全部预算花在并行采 N 个独立样本再 best-of-N;也可以用修订模型顺序采 N 次修订、用 ORM 从序列中选最佳;或在这两个极端之间取平衡。直觉上,"较容易"的问题更受益于修订——初始样本更可能方向对、只欠打磨;而难题可能需要更多探索不同的高层解题策略,并行多次独立采样更合适。验证器方面,还可选择不同搜索算法(束搜索、前瞻搜索、best-of-N),各自性质取决于验证器与提议分布的质量;相对简单的 best-of-N 或多数投票,更精巧的搜索过程或许在难题上更有用。

EN

**Test-Time Compute-Optimal Scaling Strategy** — In general, we would therefore like to select the optimal allocation of our test-time compute budget for a given problem. To this end, for any given approach of utilizing test-time compute (e.g., revisions and search against a verifier in this paper, various other methods elsewhere), we define the "test-time compute-optimal scaling strategy" as the strategy that chooses hyperparameters corresponding to a given test-time strategy for maximal performance benefits on a given prompt at test time. Formally, define Target(θ, N, q) as the distribution over natural language output tokens induced by the model for a given prompt q, using test-time compute hyper-parameters θ, and a compute budget of N. We would like to select the hyper-parameters θ which maximize the accuracy of the target distribution for a given problem, i.e. θ* = argmax_θ E_{y~Target(θ,N,q)}[1(y = y*(q))], where y*(q) denotes the ground-truth correct response for q.

测试时计算最优扩展策略 —— 一般地,我们希望为给定问题选择测试时算力预算的最优分配。为此,对任意给定的测试时算力用法(本文为修订与对验证器搜索,其他工作可为各种方法),我们把"测试时计算最优扩展策略"定义为:在给定 prompt 上为该策略选择能带来最大性能收益的超参数。形式化地:设 Target(θ, N, q) 为模型在 prompt q、超参 θ、预算 N 下诱导的自然语言输出 token 分布;我们要选使该分布准确率最大的 θ,即 θ = argmax_θ E[1(y = y(q))],其中 y*(q) 为 q 的真值回答。

EN

**Estimating Question Difficulty for Compute-Optimal Scaling** — In order to effectively analyze the test-time scaling properties of the different mechanisms discussed in Section 2 (e.g. the proposal distribution and the verifier), we will prescribe an approximation to this optimal strategy as a function of a statistic of a given prompt. This statistic estimates a notion of difficulty for a given prompt. The compute-optimal strategy is defined as a function of the difficulty of this prompt. Despite being only an approximate solution, we find that it can still induce substantial improvements in performance over a baseline strategy of allocating this inference-time compute in an ad-hoc or uniformly-sampled manner. Our estimate of the question difficulty assigns a given question to one of five difficulty levels. We can then use this discrete difficulty categorization to estimate the optimal strategy on a validation set for a given test-time compute budget, then apply these compute-optimal strategies on the test set. Concretely, we select the best performing test-time compute strategy for each difficulty bin independently. In this way, question difficulty acts as a sufficient statistic of a question when designing the compute-optimal strategy.

为计算最优策略估计题目难度 —— 为有效分析第 2 节各机制(提议分布、验证器)的测试时扩展性质,我们给出最优策略关于 prompt 某个统计量的近似:该统计量估计 prompt 的难度;计算最优策略被定义为难度的函数。尽管只是近似解,它仍能带来实质性能提升,胜过临时或均匀分配推理算力的基线策略。我们的难度估计把题目归入 5 个难度档;用这个离散分类在验证集上为给定预算估计最优策略,再应用到测试集——具体做法是对每个难度箱独立选择表现最好的测试时算力策略。这样,题目难度就充当了设计计算最优策略时关于题目的充分统计量。

EN

Defining difficulty of a problem. Following the approach of Lightman et al., we define question difficulty as a function of a given base LLM. Specifically, we bin the model's pass@1 rate – estimated from 2048 samples – on each question in the test set into five quantiles, each corresponding to increasing difficulty levels. We found this notion of model-specific difficulty bins to be more predictive of the efficacy of using test-time compute in contrast to the hand-labeled difficulty bins in the MATH dataset. That said, we do note that assessing a question's difficulty as described above assumes oracle access to a ground-truth correctness checking function, which is of course not available upon deployment where we are only given access to test prompts that we don't know the answer to. In order to be feasible in practice, a compute-optimal scaling strategy conditioned on difficulty needs to first assess difficulty and then utilize the right scaling strategy to solve this problem. Therefore, we approximate the problem's difficulty via a model-predicted notion of difficulty, which performs the same binning procedure over the averaged final answer score from a learned verifier (and not ground-truth answer correctness checks) on the same set of 2048 samples per problem. We refer to this setting as model-predicted difficulty and the setting which relies on the ground-truth correctness as oracle difficulty. While model-predicted difficulty removes the need for knowing the ground truth label, estimating difficulty in this way still incurs additional computation cost during inference. That said, this one-time inference cost can be subsumed within the cost for actually running an inference-time strategy (e.g., when using a verifier, one could use the same inference computation for also running search). More generally, this is akin to exploration-exploitation tradeoff in reinforcement learning: in actual deployment conditions, we must balance the compute spent in assessing difficulty vs applying the most compute-optimal approach. This is a crucial avenue for future work and our experiments do not account for this cost largely for simplicity. So as to avoid confounders with using the same test set for computing difficulty bins and for selecting the compute-optimal strategy, we use two-fold cross validation on each difficulty bin in the test set.

难度的定义 —— 沿用 Lightman et al. 的方法,我们把题目难度定义为给定基座 LLM 的函数:用 2048 个样本估计模型在测试集每题上的 pass@1,按分位数分成五档递增难度。我们发现这种"模型相关"的难度箱比 MATH 数据集人工标注的难度更能预测测试时计算的成效。但要指出,上述难度评估假设了可访问真值正确性判定函数——部署时当然没有(只有不知道答案的测试 prompt)。为实际可行,我们用模型预测的难度近似:用学习到的验证器(而非真值判定)在同样 2048 个样本上的平均最终答案得分做同样的分箱;依赖真值的设定则称为 oracle 难度。model-predicted 难度免去了真值标签,但估计难度本身仍带来额外推理成本——不过这次性成本可被实际运行推理策略的成本吸收(如用验证器时,同一批推理计算也能用来跑搜索)。更一般地,这类似 RL 的探索-利用权衡:实际部署中必须平衡"花在评估难度上的算力"与"花在最有效方法上的算力",这是未来工作的重要方向;出于简洁,我们的实验未计入该成本。为避免"用同一测试集既算难度箱又选策略"的混淆,我们对测试集的每个难度箱做两折交叉验证。

EN

**Experimental Setup** — We expect test-time compute to be most helpful when models already have all the basic "knowledge" needed to answer a question, and instead the primary challenge is about drawing (complex) inferences from this knowledge. To this end, we focus on the MATH benchmark, which consists of high-school competition level math problems with a range of difficulty levels. For all experiments, we use the dataset split consisting of 12k train and 500 test questions, used in Lightman et al. Models. We conduct our analysis using the PaLM 2-S* (Codey) base model. We believe this model is representative of the capabilities of many contemporary LLMs, and therefore think that our findings likely transfer to similar models. Most importantly, this model attains a non-trivial performance on MATH and yet has not saturated, so we expect this model to provide a good test-bed for us.

实验设置 —— 我们预期测试时计算在"模型已具备答题所需的全部基础知识、难点在于(复杂)推断"时最有帮助。因此聚焦 MATH 基准(高中竞赛级数学题,难度分层);所有实验用 Lightman et al. 的切分:12k 训练 + 500 测试。模型用 PaLM 2-S*(Codey)基座:它对当代 LLM 的能力有代表性、发现很可能可迁移;且在 MATH 上非平凡而未饱和,是理想的试验台。

5 通过验证器扩展测试时算力

EN

In this section we analyze how test-time compute can be scaled by optimizing a verifier, as effectively as possible. To this end, we study different approaches for performing test-time search with process verifiers (PRMs) and analyze the test-time compute scaling properties of these different approaches. PRM training. Originally PRM training used human crowd-worker labels. While Lightman et al. released their PRM training data (i.e., the PRM800k dataset), we found this data to be largely ineffective for us. We found that it was easy to exploit a PRM trained on this dataset via even naïve strategies such as best-of-N sampling. We hypothesize that this is likely a result of the distribution shift between the GPT-4 generated samples in their dataset and our PaLM 2 models. Rather than proceeding with the expensive process of collecting crowd-worker PRM labels for our PaLM 2 models, we instead apply the approach of Wang et al. to supervise PRMs without human labels, using estimates of per-step correctness obtained from running Monte Carlo rollouts from each step in the solution. Our PRM's per-step predictions therefore correspond to value estimates of reward-to-go for the base model's sampling policy, similar to recent work. We also compared to an ORM baseline (Appendix F) but found that our PRM consistently outperforms the ORM. Hence, all of the search experiments in this section use a PRM model.

本节分析如何通过尽可能有效地优化验证器来扩展测试时算力:研究用过程验证器(PRM)做测试时搜索的不同方法及其扩展性质。PRM 训练:最初的 PRM 训练用众包人工标签;Lightman et al. 发布了 PRM 训练数据(PRM800k),但我们发现它对我们基本无效——即便 best-of-N 这样的朴素策略也能"骗过"在其上训练的 PRM。我们推测这源于其数据集中 GPT-4 生成样本与我们 PaLM 2 模型之间的分布偏移。我们没有走昂贵的众包标注之路,而是采用 Wang et al. 的免人工标签方案:从解的每个中间步骤做 Monte Carlo rollout,以"该步之后最终答对的频率"作为该步的监督信号。因此我们的 PRM 逐步预测对应基座模型采样策略下的 reward-to-go 价值估计。我们也对比了 ORM 基线(附录 F),PRM 一致占优,故本节搜索实验全部用 PRM。

EN

Answer aggregation. At test time, process-based verifiers can be used to score each individual step in a set of solutions sampled from the base model. In order to select the best-of-N answers with the PRM, we need a function that can aggregate across all the per-step scores for each answer to determine the best candidate for the correct answer. To do this, we first aggregate each individual answer's per-step scores to obtain a final score for the full answer (step-wise aggregation). We then aggregate across answers to determine the best answer (inter-answer aggregation). Concretely, we handle step-wise and inter-answer aggregation as follows: Step-wise aggregation. Rather than aggregating the per-step scores by taking the product or minimum, we instead use the PRM's prediction at the last step as the full-answer score. We found this to perform the best out of all aggregation methods we studied (see Appendix E). Inter-answer aggregation. We follow Li et al. and apply "best-of-N weighted" selection rather than standard best-of-N. Best-of-N weighted selection marginalizes the verifier's correctness scores across all solutions with the same final answer, selecting final answer with the greatest total sum.

答案聚合 —— 测试时,过程验证器可对基座模型采出的一组解的每个步骤打分。要用 PRM 选 best-of-N,需要一个跨"每答案逐步分数"的聚合函数来确定最佳候选。分两层:步级聚合——不用连乘或取最小,而用 PRM 对最后一步的预测作为整题得分(消融中最优,附录 E);答案间聚合——沿用 Li et al. 的 best-of-N weighted:把最终答案相同的所有解的验证器分数边际化求和,选总分最高的最终答案(而非标准的单解最高分)。

EN

**Search Methods Against a PRM** — We optimize the PRM at test time via search methods. We study three search approaches that sample outputs from a few-shot prompted base LLM. Best-of-N weighted. We sample N answers independently from the base LLM and then select the best answer according to the PRM's final answer judgement. Beam search. Beam search optimizes the PRM by searching over its per-step predictions. Our implementation is similar to BFS-V. Concretely, we consider a fixed number of beams N and a beam width M. We then run the following steps: 1. sample N initial predictions for the first step in the solution; 2. score the generated steps according to the PRM's predicted step-wise reward-to-go estimate; 3. filter for only the top N/M highest scoring steps; 4. now from each candidate, sample M proposals from the next step, resulting in a total of N/M × M candidate prefixes again. Then repeat steps 2-4 again. We run this algorithm until the end of a solution or the maximum number of rounds of beam expansion are attained (40 in our case). We conclude the search with N final answer candidates, to which we apply best-of-N weighted selection described above to make our final answer prediction. Lookahead search. Lookahead search modifies how beam search evaluates individual steps. It uses lookahead rollouts to improve the accuracy of the PRM's value estimation in each step of the search process. Specifically, at each step in the beam search, rather than using the PRM score at the current step to select the top candidates, lookahead search performs a simulation, rolling out up to k steps further while stopping early if the end of solution is reached. To minimize variance in the simulation rollout, we perform rollouts using temperature 0. The PRM's prediction at the end of this rollout is then used to score the current step in the beam search. That is, in other words, we can view beam search as a special case of lookahead search with k= 0. Given an accurate PRM, increasing k should improve the accuracy of the per-step value estimates at the cost of additional compute. Also note that this version of lookahead search is a special case of MCTS, wherein the stochastic elements of MCTS, designed to facilitate exploration, are removed since the PRM is already trained and is frozen. These stochastic elements are largely useful for learning the value function, but less useful at test-time when we want to exploit rather than explore. Therefore, lookahead search is largely representative of how MCTS-style methods would be applied at test-time.

对 PRM 的搜索方法 —— 我们通过搜索方法在测试时优化 PRM 的用法,研究三种从少样本提示的基座 LLM 采样的搜索方式。Best-of-N weighted:从基座 LLM 独立采 N 个答案,按 PRM 的最终答案判断选最佳。束搜索:在 PRM 逐步预测上搜索,实现类似 BFS-V:固定束数 N、束宽 M,循环执行——(1) 为解的第一步采 N 个初始预测;(2) 按 PRM 的逐步 reward-to-go 估计打分;(3) 只保留得分最高的 N/M 个;(4) 从每个候选为下一步采 M 个提案,再次得到 N/M×M 个候选前缀;重复直至解结束或达最大束扩展轮数(我们取 40)。搜索结束时得到 N 个最终答案候选,再用 best-of-N weighted 做最终预测。前瞻搜索:修改束搜索对单步的评估方式,用前瞻 rollout 提高每步 PRM 价值估计的准确性:束搜索的每一步不用当前步 PRM 分数选候选,而是做一次模拟——向前 rollout 至多 k 步(到达解结尾则提前停止),为降方差用温度 0 采样,以 rollout 终点的 PRM 预测为当前步打分。换言之,束搜索可视为 k=0 的前瞻搜索特例;PRM 足够准时,增大 k 应能提高逐步价值估计的准确性,代价是额外计算。还要注意,这版前瞻搜索是 MCTS 的特例——去掉了 MCTS 中为促进探索设计的随机成分(PRM 已训练好并冻结;这些随机成分主要对学习价值函数有用,测试时要利用而非探索)。因此前瞻搜索基本代表了 MCTS 式方法在测试时的实际用法。

EN

**Analysis Results: Test-Time Scaling for Search with Verifiers** — Comparing search algorithms. We first conduct a sweep over various search settings. In addition to the standard best-of-N approach, we sweep over the two main parameters that distinguish different tree-search methods: beam-width M and number of lookahead steps k. While we are not able to extensively sweep every single configuration, we sweep over the following settings with a maximum budget of 256: 1) Beam search with the beam width set to √N, where N is the generation budget. 2) Beam search with a fixed beam width of 4. 3) Lookahead search with k = 3 applied to both beam-search settings 1) and 2). 4) Lookahead search with k = 1 applied to beam-search setting 1). To compare search methods as a function of generation budget fairly, we build a protocol for estimating the cost of each method. We consider a generation to be a sampled answer from the base LLM. For beam search and best-of-N the generation budget corresponds to the number of beams and N respectively. Lookahead search, however, utilizes additional compute: at each step of the search, we sample k additional steps ahead. Therefore, we define the cost of lookahead-search to be N × (k + 1) samples. Results. As shown in Figure 3 (left), with smaller generation budgets, beam search significantly outperforms best-of-N. However, as the budget is scaled up, these improvements greatly diminish, with beam search often underperforming the best-of-N baseline. We also see that, lookahead-search generally underperforms other methods at the same generation budget, likely due to the additional computation inducted by simulating the lookahead rollouts. The diminishing returns from search are likely due to exploitation of the PRM's predictions. For example, we see some instances, where search causes the model to generate low-information repetitive steps at the end of a solution. In other cases, we find that over-optimizing search can result in overly short solutions consisting of just 1-2 steps. This explains why the most powerful search method (i.e., lookahead search) underperforms the most.

分析结果:验证器搜索的测试时扩展 —— 比较搜索算法:除标准 best-of-N 外,我们扫过区分树搜索方法的两主参(束宽 M、前瞻步数 k),最大预算 256:(1) 束宽取 √N 的束搜索;(2) 束宽固定 4;(3) 对 (1)(2) 施加 k=3 前瞻;(4) 对 (1) 施加 k=1 前瞻。为公平按生成预算比较,我们建立成本协议:一次"生成"= 从基座 LLM 采样一个答案;束搜索与 best-of-N 的预算即束数与 N;前瞻搜索每步额外向前采 k 步,故成本定义为 N×(k+1)。结果(图 3 左):预算小时束搜索显著胜 best-of-N;预算增大后优势大减,常反被 best-of-N 反超;前瞻搜索同预算下普遍最差——可能是模拟 rollout 的额外计算拖累。搜索的回报递减很可能源于对 PRM 预测的过度优化(利用):一些实例中,搜索诱使模型在解尾生成低信息量的重复步骤;另一些情况中,过度优化的搜索产生仅 1-2 步的过短解。这解释了为何最强的搜索方法(前瞻)反而表现最差。

EN

Which problems does search improve? To understand how to compute-optimally scale search methods, we now conduct a difficulty bin analysis. Specifically, we compare beam-search (M = 4) against best-of-N. In Figure 3 (right) we see that while in aggregate, beam search and best-of-N perform similarly with a high generation budget, evaluating their efficacy over difficulty bins reveals very different trends. On the easy questions (levels 1 and 2), the stronger optimizer of the two approaches, beam search, degrades performance as the generation budget increases, suggesting signs of exploitation of the PRM signal. In contrast, on the harder questions (levels 3 and 4), beam search consistently outperforms best-of-N. On the most difficult questions (level 5), no method makes much meaningful progress. These findings match intuition: we might expect that on the easy questions, the verifier will make mostly correct assessments of correctness. Therefore, by applying further optimization via beam search, we only further amplify any spurious features learned by the verifier, causing performance degradation. On the more difficult questions, the base model is much less likely to sample the correct answer in the first place, so search can serve to help guide the model towards producing the correct answer more often.

搜索改进哪些题? 为理解如何计算最优地扩展搜索,我们做难度箱分析:比较束搜索(M=4)与 best-of-N。图 3(右)显示:高预算下二者总体相当,但按难度箱分解则趋势迥异——易题(1-2 档)上,更强的优化器(束搜索)随预算增大性能反而下降,呈现利用 PRM 信号的迹象;较难题(3-4 档)上束搜索持续占优;最难档(5 档)所有方法都无实质进展。这符合直觉:易题上验证器基本都能正确评估,再用束搜索加码优化只会放大验证器学到的伪特征、损害性能;难题上基座模型一开始就很难采到正确答案,搜索能引导模型更常产出正确答案。

EN

Compute-optimal search. Given the above results, it is clear that question difficulty can be a useful statistic to predict the optimal search strategy to use at a given compute budget. Additionally, the best choice of search strategy can vary drastically as a function of this difficulty statistic. We therefore visualize the "compute-optimal" scaling trend, as represented by the best performing search strategy at each difficulty level in Figure 4. We see that in the low generation budget regime, using both the oracle and predicted difficulty, compute-optimal scaling can nearly outperform best-of-N using up to 4x less test-time compute (e.g. 16 verses 64 generations). While in the higher budget regime, some of these benefits diminish with the use of predicted difficulty, with oracle bins we still see continued improvements from optimally scaling test-time compute. This result demonstrates the performance gains that could be obtained by adaptively allocating test-time compute during search. Takeaways for compute-optimal scaling of verifiers: We find that the efficacy of any given verifier search method depends critically on both the compute budget and the question at hand. Specifically, beam-search is more effective on harder questions and at lower compute budgets, whereas best-of-N is more effective on easier questions and at higher budgets. Moreover, by selecting the best search setting for a given question difficulty and test-time compute budget, we can nearly outperform best-of-N using up to 4x less test-time compute.

计算最优搜索 —— 上述结果表明,题目难度是预测"给定预算下最优搜索策略"的有用统计量,且最优策略随难度剧变。我们可视化每个难度档表现最好的搜索策略构成的"计算最优"扩展趋势(图 4):低预算区间,用 oracle 或 predicted 难度,计算最优扩展都能以最多 4 倍少的测试时算力逼近/超越 best-of-N(如 16 次 vs 64 次生成);高预算区间,predicted 难度的部分收益衰减,但 oracle 箱下仍见持续改进。这展示了自适应分配搜索算力可获得的性能增益。验证器计算最优扩展要点:任一验证器搜索方法的效力关键取决于算力预算与题目——束搜索在难题、低预算下更有效;best-of-N 在易题、高预算下更有效;按难度与预算选择最优搜索配置,可用最多 4 倍少的测试时算力胜过 best-of-N。

6 精炼提议分布

EN

So far, we studied the test-time compute scaling properties of search against verifiers. Now we turn to studying the scaling properties of modifying the proposal distribution. Concretely, we enable the model to revise their own answers iteratively, allowing the model to dynamically improve its own distribution at test time. Simply prompting existing LLMs to correct their own mistakes tends to be largely ineffective for obtaining performance improvements on reasoning problems. Therefore, we build on the recipe prescribed by Qu et al., incorporate modifications for our setting, and finetune language models to iteratively revise their own answers. We first describe how we train and use models that refine their own proposal distribution by sequentially conditioning on their own previous attempts at the question. We then analyze the inference-time scaling properties of revision models.

至此我们研究了"对验证器搜索"的扩展性质;现在转向"修改提议分布"。具体地,让模型迭代修订自己的答案,从而在测试时动态改进自身分布。直接提示现成 LLM 纠正自己的错误在推理问题上基本无效,因此我们沿用 Qu et al. 的配方并按我们的设定改造,微调出能迭代修订自身答案的模型。我们先描述如何训练与使用这种"顺序条件于自己先前尝试"来精炼提议分布的模型,再分析修订模型的推理时扩展性质。

EN

**Generating revision data.** The on-policy approach of Qu et al. for obtaining several multi-turn rollouts was shown to be effective, but it was not entirely feasible in our infrastructure due to compute costs associated with running multi-turn rollouts. Therefore, we sampled 64 responses in parallel at a higher temperature and post-hoc constructed multi-turn rollouts from these independent samples. Specifically, following the recipe of [1], we pair up each correct answer with a sequence of incorrect answers from this set as context to construct multi-turn finetuning data. We include up to four incorrect answers in context, where the specific number of solutions in context is sampled randomly from a uniform distribution over categories 0 to 4. We use a character edit distance metric to prioritize selecting incorrect answers which are correlated with the final correct answer (see Appendix H). Note that token edit distance is not a perfect measure of correlation, but we found this heuristic to be sufficient to correlate incorrect in-context answers with correct target answers to facilitate training a meaningful revision model, as opposed to randomly pairing incorrect and correct responses with uncorrelated responses.

构造修订数据 —— Qu et al. 的 on-policy 多轮 rollout 方案有效,但在我们的基础设施上算力成本不可行。因此我们高温并行采 64 个回答,事后从这些独立样本构造多轮 rollout:沿用 [1] 的配方,把每个正确答案与一组错误答案配对作上下文,构成多轮微调数据;上下文中的错误答案最多 4 个,具体个数从 0-4 均匀采样。我们用字符编辑距离优先挑选与最终正确答案相关的错误答案(附录 H)——编辑距离不是完美的相关性度量,但这个启发式足以让"上下文中的错误答案"与"目标正确答案"相关,从而训出有意义的修订模型,而不是随机配对互不相关的答案。

EN

**Using revisions at inference-time.** Given a finetuned revision model, we can then sample a sequence of revisions from the model at test-time. While our revision model is only trained with up to four previous answers in-context, we can sample longer chains by truncating the context to the most recent four revised responses. In Figure 6 (left), we see that as we sample longer chains from the revision model, the model's pass@1 at each step gradually improves, demonstrating that we are able to effectively teach the model to learn from mistakes made by previous answers in context. That said, there is a distribution shift at inference time: the model was trained on only sequences with incorrect answers in context, but at test-time the model may sample correct answers that are included in the context. In this case, it may incidentally turn the correct answer into an incorrect one in the next revision step. We find that indeed, similar to Qu et al., around 38% of correct answers get converted back to incorrect ones with our revision model using a naïve approach. Therefore, we employ a mechanism based on sequential majority voting or verifier-based selection to select the most correct answer from the sequence of revisions made by the model to produce the best answer.

推理时使用修订 —— 给定微调好的修订模型,测试时即可从中采样一串修订。模型训练时上下文最多 4 个先前答案,但推理时可以把上下文截断为最近 4 次修订来采任意长的链。图 6(左)显示,链越长,各步的 pass@1 逐步提升——证明我们有效教会了模型从上下文中先前答案的错误里学习。但存在分布偏移:训练时上下文全是错误答案,推理时链上可能出现正确答案被纳入上下文,下一次修订可能把它改错。确实,与 Qu et al. 类似,朴素做法下约 38% 的正确答案会被改回错误。因此我们用序列多数投票或验证器选择机制,从模型的修订序列中选出最正确的答案作为最终输出。

EN

**Comparisons.** To test the efficacy of modifying the proposal distribution via revisions, we setup an even comparison between the performance of sampling N revisions in sequence and sampling N attempts at a question in parallel. We see in Figure 6 (right), that with both the verifier-based and majority-based selection mechanisms sampling solutions in sequence outperforms sampling them in parallel.

对比 —— 为检验"用修订修改提议分布"的效力,我们做公平对比:顺序采 N 次修订 vs 并行采 N 次尝试。图 6(右)显示,无论用验证器选择还是多数投票,顺序采样都优于并行采样。

EN

**Trading off sequential and parallel test-time compute.** To understand how to optimally allocate sequential and parallel compute, we perform a sweep over a number of different ratios. We see, in Figure 7 (left), that indeed, at a given generation budget, there exists an ideal sequential to parallel ratio, that achieves the maximum accuracy. We also see in Figure 7 (right) that the ideal ratio of sequential to parallel varies depending on a given question's difficulty. In particular, easy questions benefit more from sequential revisions, whereas on difficult questions it is optimal to strike a balance between sequential and parallel computation. This finding supports the hypothesis that sequential revisions (i.e., varying the proposal distribution) and parallel sampling (i.e., search with verifiers) are two complementary axes for scaling up test-time compute, which may be more effective on a per-prompt basis.

串行与并行测试时算力的权衡 —— 为理解如何最优分配串/并行算力,我们扫过多种比例。图 7(左)显示,给定生成预算确实存在使准确率最大的理想串:并比;图 7(右)显示该理想比例随难度变化——易题更受益于纯串行修订,难题则需串并行平衡。这支持了如下假设:串行修订(变提议分布)与并行采样(带验证器的搜索)是扩展测试时算力的两条互补轴线,按 prompt 组合使用可能更有效。

EN

**Compute-optimal revisions.** Given that the efficacy of sequential and parallel sampling depends on question difficulty, we can select the ideal ratio of sequential to parallel compute per difficulty bin. In Figure 8, we plot results using this compute-optimal scaling strategy when employing both our oracle and predicted notions of difficulty. In both cases, we're able to substantially improve test-time compute scaling by improving the proposal distribution via revisions. In particular, we see that at higher generation budgets, parallel sampling seems to plateau, whereas compute-optimal scaling demonstrates continued improvements. For both oracle and predicted difficulty bins, we see that compute-optimal scaling can outperform best-of-N using up to 4x less test-time compute (e.g. 64 samples verses 256). Overall, these results demonstrate the potential for improved test-time compute scaling by adjusting the proposal distribution on a per-prompt basis. Takeaways for compute-optimal scaling by refining the proposal distribution with revisions: We find that there exists a tradeoff between sequential (e.g., revisions) and parallel (e.g., standard best-of-N) test-time computation, and the ideal ratio of sequential to parallel test-time compute depends critically on both the compute budget and the specific question at hand. Specifically, easier questions benefit from purely sequential test-time compute, whereas harder questions often perform best with some ideal ratio of sequential to parallel compute. Moreover, by optimally selecting the best setting for a given question difficulty and test-time compute budget, we can outperform the parallel best-of-N baseline using up to 4x less test-time compute.

计算最优修订 —— 既然串/并行的效力取决于难度,我们便可按难度箱选择理想的串:并比。图 8 给出用 oracle 与 predicted 难度的计算最优策略结果:两种情形下都大幅改进了测试时算力扩展——高预算下并行采样趋于平台,而计算最优策略持续提升;oracle 与 predicted 难度下,计算最优都能以最多 4 倍少的测试时算力胜过 best-of-N(如 64 vs 256 采样)。修订提议分布的计算最优要点:串行(修订)与并行(标准 best-of-N)测试时计算存在权衡,理想串并比关键取决于算力预算与题目——易题受益于纯串行,难题常在某个理想配比下最佳;按难度与预算选最优配置,可用最多 4 倍少算力超过并行 best-of-N 基线。

7 综合:兑换预训练与测试时算力

EN

So far, we saw that utilizing additional test-time computation can enable us to represent more complex distributions than the one predicted by the base LLM itself, thereby improving performance. We now posit that this increased flexibility of representing distributions means that we can expect additional test-time compute to make up for the lack of a higher-capacity model or training for more FLOPs during pre-training. In this section, we study to what extent this is possible. We pose the following question: Suppose a model was pre-trained with X FLOPs. Assume that we plan to run Y FLOPs of inference with this model. If we want to improve performance by increasing the total FLOPs budget by a factor of M (i.e., M(X+Y) total FLOPs across both pretraining and inference), should we spend our FLOPs on increased pretraining compute or on additional test-time compute? Increasing pretraining FLOPS introduces the additional design decision of whether to allocate compute to training with more data or more parameters. We focus on the setting in which model parameters are scaled up and training data amount is fixed, matching the approach taken with the open-source LLaMA series of models. We choose this setting as it is representative of a canonical approach to scaling pretraining compute.

至此我们看到,额外测试时计算使我们能表达比基座 LLM 自身更复杂的分布、从而提升性能。我们由此推断:这种表达分布的额外灵活性,意味着测试时算力有望弥补"更高容量的模型"或"预训练更多 FLOPs"的缺失。本节研究这在多大程度上可行。问题:设模型以 X FLOPs 预训练,计划以 Y FLOPs 推理。若想把总 FLOPs 提高 M 倍(即预训练+推理共 M(X+Y)),该把 FLOPs 花在预训练还是测试时? 增加预训练 FLOPs 还引入"多数据还是多参数"的设计抉择;我们聚焦"参数扩大、数据量固定"的设定(与开源 LLaMA 系列一致),这是扩展预训练算力的典型做法。

EN

Defining an exchange rate between FLOPs. We now describe how we define the exchange rate between pretraining and inference FLOPs. To determine pretraining FLOPs, use the common approximation X = 6N·D_pretrain, and for inference FLOPs, we use Y = 2N·D_inference. Here N represents model parameters, D_pretrain is the number of tokens used for pretraining, and D_inference the total number of tokens generated at inference time. With these approximations, we can see that, if we multiply the model parameters by a factor of M, then both the pretraining and inference FLOPs (due to the cost of greedy decoding with the larger model), increase by a factor of M (giving M(X+Y) total FLOPs). To match the FLOPs from scaling up model parameters using test-time compute with the smaller model we can multiply the smaller model's inference compute by a factor of M + 3(D_pretrain/D_inference)(M−1). Notably, the amount of inference compute we can utilize to match the FLOPs for the larger model depends on the ratio D_pretrain/D_inference. We refer to the inverse of this ratio as R (e.g. D_inference/D_pretrain). Depending on the specific production setting or use-case, we should expect very different values of R. In particular, in many large scale production settings, we may expect significantly more inference tokens than pretraining tokens, in which case we would have R >> 1. On the other hand, in many contemporary self-improvement setups, that would use test-time compute to improve the model, we would likely generate significantly fewer inference tokens than pretraining tokens, giving R << 1. Therefore, since the scale of test-time compute we can apply is dependent on this ratio, we expect differing conclusions depending on the specific setting.

定义 FLOPs 兑换率 —— 预训练 FLOPs 用常用近似 X = 6N·D_pretrain,推理 FLOPs 用 Y = 2N·D_inference(N 为参数量,D 为 token 数)。据此,参数乘 M 则预训练与推理 FLOPs(大模型贪心解码的成本)都乘 M,共 M(X+Y)。要用小模型的测试时算力追平大模型的 FLOPs,需把小模型推理算力乘以 M + 3(D_pretrain/D_inference)(M−1)——即取决于比值 D_pretrain/D_inference,其倒数记 R = D_inference/D_pretrain。不同生产场景下 R 大不相同:大规模生产场景推理 token 远多于预训练 token,R≫1;当代自我改进式场景(用测试时算力改进模型)则推理 token 远少于预训练 token,R≪1。由于可施加的测试时算力规模依赖该比值,不同设定下的结论也会不同。

EN

In Figure 9, we use this approach to exchanging test-time and pretraining compute to compare our compute-optimal scaling against scaling up model parameters by a factor of ∼14. We conduct comparisons for 3 different values of R: 0.16 (R << 1), 0.79 (R ∼ 1), and 22 (R >> 1), with each ratio corresponding to an inference budget. Observe that if we only expect to see very difficult questions (e.g. difficulty bins 4/5) or have a larger D_inference (corresponding to a larger R value), then it is often more effective to allocate our budget towards pretraining (e.g. the star is above the line). If instead, we expect mostly easy or intermediate difficulty questions (e.g. bins 1/2/3 and sometimes 4) or have lower inference requirements (as is the case in self-improvement pipelines), then utilizing test-time compute is better. Takeaways for exchanging pretraining and test-time compute: Test-time and pretraining compute are not 1-to-1 "exchangeable". On easy and medium questions, which are within a model's capabilities, or in settings with small inference requirement, test-time compute can easily cover up for additional pretraining. However, on challenging questions which are outside a given base model's capabilities or under higher inference requirement, pretraining is likely more effective for improving performance.

图 9 用这套兑换方法,把我们的计算最优扩展与"参数扩大约 14 倍"作比较,取 R = 0.16(R≪1)、0.79(R≈1)、22(R≫1)三个值(各对应一个推理预算)。观察:若预期只遇到很难的题(4/5 档)或 D_inference 较大(R 较大),把预算投给预训练通常更有效(星标在曲线上方);反之,若主要是易/中档题(1/2/3 档,有时 4 档)或推理需求较低(如自我改进管线),用测试时算力更好。兑换要点:测试时与预训练算力不是一一等价可兑换——在模型能力范围内的易/中档题、或推理需求小的设定下,测试时算力可轻松补足额外预训练;在超出基座模型能力的难题、或高推理需求下,预训练更可能有效提升性能。

8 讨论与未来工作

EN

In this work, we conducted a thorough analysis of the efficacy of different techniques that aim to either improve search against a verifier or to refine an LLM's proposal distribution, for scaling test-time compute for math reasoning. In general, we found that the efficacy of a given approach heavily correlates with the difficulty of the problem from the perspective of the base LLM's capabilities. This motivated us to introduce the notion of "compute-optimal" scaling of test-time computation, which prescribes an adaptive, prompt-dependent strategy to improve performance under a given test-time compute budget. By applying such a compute-optimal scaling strategy, we find that can improve the efficiency of test-time compute scaling by a factor of 2−4×. When comparing benefits obtained from additional test-time compute against benefits from additional pre-training compute in a FLOPs-matched setting, we show for the first time that using test-time computation with seemingly simple methods (i.e., revisions and search) can already scale well on certain types of prompts, providing gains over spending those FLOPs in pretraining. That said, there are also limitations associated with our study that future work can aim to address. Further improving test-time compute scaling. In this work we focused on improving the test-time compute scaling of two primary mechanisms: the verifier and the proposal distribution (via revisions). While we combined verifiers with revisions in Section 6, we did not experiment with PRM tree-search techniques in combination with revisions. Neither did we study other techniques such as critique and revise. Future work should investigate how test-time compute scaling can be further improved by combining a variety of these approaches. Additionally, we found that across the board these schemes provided small gains on hard problems; future work should work to develop new ways of using test-time compute which can circumvent this limitation. Assessing question difficulty quickly. We used a notion question difficulty as a simple sufficient statistic for approximating the compute-optimal test-time scaling strategy. While this scheme was effective, estimating our notion of difficulty requires applying a non-trivial amount of test-time compute itself. Future work should consider alternative ways of more efficiently estimating question difficulty (e.g., by pretraining or finetuning models to directly predict difficulty of a question) or dynamically switching between assessing difficulty and attempting to solve a question. Interleaving test-time and training-time compute. We focused purely on test-time compute scaling in this work and the degree to which test-time compute can be traded off for additional pretraining. However, in the future, we envision that the outputs of applying additional test-time compute can be distilled back into the base LLM, enabling an iterative self-improvement loop that operates on open-ended natural language. To this end, future work should extend our findings and study how the outputs of applying test-time compute can be used to improve the base LLM itself.

本工作对"改进验证器搜索"与"精炼 LLM 提议分布"两大类技术扩展数学推理测试时算力的效力做了透彻分析。总体发现:给定方法的效力与"从基座 LLM 能力视角看的问题难度"高度相关。这促使我们提出测试时计算的"计算最优"扩展概念——在给定预算下采用自适应、依赖 prompt 的策略。应用该策略可将测试时算力扩展效率提升 2-4 倍。在 FLOPs 对齐设定下比较额外测试时算力与额外预训练算力的收益,我们首次展示:用看似简单的方法(修订与搜索)做测试时计算,已能在特定类型 prompt 上良好扩展,胜过把同样 FLOPs 花在预训练。本研究也有局限,待未来工作解决:进一步改进测试时算力扩展——本文只聚焦验证器与提议分布(修订)两大机制;第 6 节虽组合了验证器与修订,但未实验 PRM 树搜索与修订的组合,也未研究"批评并修订"等其他技术;且这些方案在难题上普遍收益小,未来需开发能绕开该限制的新用法。快速评估题目难度——难度只是近似计算最优策略的简单充分统计量,有效但估计难度本身也需要不少测试时算力;未来可研究更高效的难度估计(如预训练/微调模型直接预测难度),或在"评估难度"与"尝试解题"之间动态切换。交错测试时与训练时算力——本文纯粹研究测试时算力扩展及其与预训练的兑换;未来我们设想把额外测试时计算的产出蒸馏回基座 LLM,形成在开放自然语言上运行的迭代自我改进闭环;未来工作应研究如何用测试时计算的输出来改进基座 LLM 本身。

要点速览

  • 两大机制:改提议分布(串行修订) 与 优化验证器用法(对 PRM 搜索),互补(局部精炼 vs 全局探索);有效性都关键取决于题目难度。
  • 难度=充分统计量:以基座模型 pass@1(2048 样本)分 5 档;model-predicted 难度(验证器均分)与 oracle 难度效果几乎一致,部署可行。
  • 计算最优策略:按难度×预算自适应选方法/超参,比 best-of-N 省最多 4 倍算力(修订与搜索两设定均验证,效率总提升 2-4×)。
  • 束搜索:难题+低预算占优;易题+高预算被 PRM 过度优化反噬(重复步骤、过短解);lookahead/MCTS 式同预算普遍不划算(N×(k+1) 成本)。
  • 修订模型:训练数据需"相关错误→正确"配对(编辑距离启发式,高温并行 64 采样事后构造);朴素链式修订会把 38% 正确答案改错,必须配多数投票或验证器选择。
  • FLOPs 对齐结论(X=6ND_pretrain,Y=2ND_inference,R=D_inference/D_pretrain):小模型+测试时计算在易/中档题上可胜 14× 大模型;难题与高推理负载(R≫1)下预训练更优——两种算力非一一等价。
  • PRM 训练:人工标注 PRM800k 跨模型分布偏移下失效;Monte Carlo rollout 估每步 reward-to-go 的免标签方案更稳;答案聚合用"最后一步 PRM 分数 + best-of-N weighted(同答案分数求和)"。
  • 行业含义:某些场景更应"小模型预训练 + 推理算力";长期 FLOPs 将从预训练侧向推理侧迁移——这正是 o1 式推理模型与本文后续工作的方向。