Aha.
正在载入中英对照阅读…

arXiv:2408.03314 · 中英对照阅读

以最优方式扩展大型语言模型(LLM)的测试时计算,可能比扩展模型参数更有效。

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

Charlie Snell、Jaehoon Lee、Kelvin Xu、Aviral Kumar

中文速览

让语言模型在回答难题时多花推理计算,究竟能提升多少表现、又该怎么花这笔计算,是这项研究要回答的问题。研究者在数学题上比较了多种办法:让模型反复修改答案,或生成多个解法,再用逐步检查答案过程的评分器挑选和搜索,并按模型眼中的题目难度来分配计算。结果显示,题目难度会影响哪种办法最有效;按难度灵活分配计算,效果比一味多采样好,最多能省下四倍以上计算,在部分题目上,小模型也能超过大它14倍的模型。研究还发现,额外推理计算在不少情况下能替代一部分预训练投入,但极难题仍更需要更强的预训练,这为模型训练和推理阶段如何分配算力提供了依据。

摘要

使大型语言模型(LLM)能够通过使用更多测试时计算来改进输出,是构建能够处理开放式自然语言的通用自我改进智能体的一项关键步骤。在本文中,我们研究了大型语言模型(LLM)中推理时计算的扩展,重点探讨以下问题:如果允许一个大型语言模型(LLM)使用固定但不可忽略的推理时计算量,它能在多大程度上提升其在具有挑战性的提示上的表现?回答这一问题不仅关系到大型语言模型(LLM)能够达到的性能,也关系到大型语言模型(LLM)预训练的未来,以及应如何权衡推理时计算与预训练计算。尽管这一问题至关重要,尝试理解各种测试时推理方法扩展行为的研究却寥寥无几。此外,当前研究在很大程度上表明,其中若干策略效果不佳。在这项工作中,我们分析了扩展测试时计算的两种主要机制:(1)针对稠密、基于过程的验证器奖励模型进行搜索;(2)根据测试时给定的提示,自适应地更新模型在响应上的分布。我们发现,在这两种情况下,不同测试时计算扩展方法的有效性都会因提示的难度而有显著差异。这一发现促使我们采用“计算最优”的扩展策略,以便针对每个提示自适应地分配测试时计算,从而实现最高效的计算利用。采用这一计算最优策略后,与 Best-of-N 基线相比,我们能够将测试时计算扩展的效率提高 4 $\times$ 以上。此外,在 FLOPs 匹配评估中,我们发现,对于较小的基础模型能够取得一定成功率的问题,利用测试时计算可以使其表现超过大 14 $\times$ 的模型。

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 $\times$ 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 $\times$ larger model.

术语表

large language models (LLMs)
大型语言模型(LLM)
test-time computation
测试时计算
inference-time computation
推理时计算
scaling test-time compute
测试时计算扩展
self-improving agents
自我改进智能体
pretraining
预训练
inference
推理
best-of-N sampling
Best-of-N 采样
base LLM
基础 LLM
proposal distribution
提议分布
verifier
验证器
reward model
奖励模型
process-based verifier reward model
基于过程的验证器奖励模型
process-based reward model (PRM)
基于过程的奖励模型(PRM)
dense verifier
稠密验证器
tree search
树搜索
adaptive compute allocation
自适应计算分配
compute-optimal strategy
计算最优策略
question difficulty
问题难度
revision
修订
FLOPs-matched evaluation
FLOPs 匹配评估
MATH benchmark
MATH 基准测试
PaLM-2
PaLM-2
reasoning task
推理任务
inference-time and pretraining compute tradeoff
推理时计算与预训练计算的权衡