通过优化样本计算分配扩展大语言模型推理
Scaling LLM Inference with Optimized Sample Compute Allocation
AI总结:
本研究针对大语言模型推理的样本计算预算分配问题,将其建模为学习问题并提出OSCA算法,通过优化不同推理配置的组合,在代码生成、推理任务及智能体工作流中均以更少计算量实现了更优准确率。
摘要:
采样是大语言模型(LLM)诸多推理时算法中的基础操作。为在有限计算资源下高效扩展推理规模,找到样本计算预算的最优分配至关重要:我们应使用哪些采样配置(模型、温度、语言等)?每种配置下生成多少样本?我们将这些选择建模为一个学习问题,提出OSCA(优化样本计算分配算法),该算法通过寻找不同推理配置的最优组合来实现样本计算分配的优化。实验表明,采用我们学习得到的混合分配策略,在代码生成任务上,仅用1/128的计算量就能取得优于最佳单一配置的准确率;在4项推理任务上,仅用1/25的计算量即可实现更优效果。OSCA在单轮任务之外的智能体工作流中同样有效,在SWE-Bench基准上,相比默认配置仅用1/3的计算量就获得了更高的准确率。我们的代码和生成结果已发布于https://github.com/LeiLiLab/OSCA。
英文摘要:
Sampling is a basic operation in many inference-time algorithms of large language models (LLMs). To scale up inference efficiently with a limited compute, it is crucial to find an optimal allocation for sample compute budgets: Which sampling configurations (model, temperature, language, etc.) do we use? How many samples do we generate in each configuration? We formulate these choices as a learning problem and propose OSCA, an algorithm that Optimizes Sample Compute Allocation by finding an optimal mix of different inference configurations. Our experiments show that with our learned mixed allocation, we can achieve accuracy better than the best single configuration with 128x less compute on code generation and 25x less compute on 4 reasoning tasks. OSCA is also shown to be effective in agentic workflows beyond single-turn tasks, achieving a better accuracy on SWE-Bench with 3x less compute than the default configuration. Our code and generations are released at https://github.com/LeiLiLab/OSCA.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。