Large Language Monkeys: Scaling Inference Compute with Repeated Sampling

LLM MQIA CoT
将用于训练语言模型的计算量进行扩展,可以显著提高其性能。然而,在推断时,我们通常仅限于每个问题尝试一次的计算量。在这里,我们探讨了推断计算作为另一个扩展维度,通过增加生成样本的数量来扩展。在多个任务和模型中,我们观察到,覆盖率(任何尝试解决的问题的比例)随着样本数量的增加而增加了四个数量级。在编码和形式证明等领域,所有答案都可以自动验证,这些覆盖率的增加直接转化为性能的提高。当我们将重复采样应用于SWE-bench Lite时,使用250个样本的DeepSeek-V2-Coder-Instruct的解决问题的比例从一个样本的15.9%增加到了56%,超过了使用更强大的前沿模型的单次尝试的最先进水平43%。此外,使用当前的API定价,将更便宜的DeepSeek模型放大五倍的样本比支付GPT-4o或Claude 3.5 Sonnet的一个样本更具成本效益,并解决了更多的问题。有趣的是,覆盖率和样本数量之间的关系通常是对数线性的,并且可以用指数幂律进行建模,这表明存在推断时间的扩展规律。最后,我们发现,在没有自动验证器的领域中,从许多生成的样本中识别正确的样本仍然是未来研究的重要方向。当解决GSM8K和MATH中的数学问题时,使用Llama-3模型的覆盖率随着样本数量的增加而增长,使用10,000个样本时超过95%。然而,常见的从样本集中选择正确解决方案的方法,例如多数投票或奖励模型,在几百个样本后就会停滞不前,并且无法完全扩展样本预算。
Scaling the amount of compute used to train language models has dramatically improved their capabilities. However, when it comes to inference, we often limit the amount of compute to only one attempt per problem. Here, we explore inference compute as another axis for scaling by increasing the number of generated samples. Across multiple tasks and models, we observe that coverage - the fraction of problems solved by any attempt - scales with the number of samples over four orders of magnitude. In domains like coding and formal proofs, where all answers can be automatically verified, these increases in coverage directly translate into improved performance. When we apply repeated sampling to SWE-bench Lite, the fraction of issues solved with DeepSeek-V2-Coder-Instruct increases from 15.9% with one sample to 56% with 250 samples, outperforming the single-attempt state-of-the-art of 43% which uses more capable frontier models. Moreover, using current API pricing, amplifying the cheaper DeepSeek model with five samples is more cost-effective and solves more issues than paying a premium for one sample from GPT-4o or Claude 3.5 Sonnet. Interestingly, the relationship between coverage and the number of samples is often log-linear and can be modelled with an exponentiated power law, suggesting the existence of inference-time scaling laws. Finally, we find that identifying correct samples out of many generations remains an important direction for future research in domains without automatic verifiers. When solving math word problems from GSM8K and MATH, coverage with Llama-3 models grows to over 95% with 10,000 samples. However, common methods to pick correct solutions from a sample collection, such as majority voting or reward models, plateau beyond several hundred samples and fail to fully scale with the sample budget.
许愿