2025-02-21 · 进阶 · 计算机视觉 · 机器学习

S*: Test Time Scaling for Code Generation

提出S∗,一个混合测试时间缩放框架,显著提高了代码生成的覆盖率和选择准确性。

更新于 2025-02-21。作者:Dacheng Li、Shiyi Cao、Chengkun Cao、Xiuyu Li、Shangyin Tan、Kurt Keutzer、Jiarong Xing、Joseph E. Gonzalez、Ion Stoica。

中文摘要

增加大型语言模型(LLM)的测试时计算量在多个领域显示出潜力,但在代码生成领域却研究不足,尽管在数学领域已有广泛研究。在本文中,我们提出了S*,这是第一个混合测试时缩放框架,它显著提高了生成代码的覆盖率选择准确性。S*通过引入顺序缩放扩展了现有的并行缩放范式,以推动性能边界。它进一步利用了一种新颖的选择机制,该机制自适应地为成对比较生成区分性输入,并结合执行基础信息,以稳健地识别正确解。我们在12个大型语言模型和大型推理模型上进行了评估,结果显示:(1) S*在模型家族和大小上持续提高性能,使一个30亿参数的模型能够超越GPT-4o-mini;(2) S*使非推理模型能够超越推理模型——使用S*的GPT-4o-mini在LiveCodeBench上的表现比o1-preview高出3.7%;(3) S*进一步提升了最先进的推理模型——DeepSeek-R1-Distill-Qwen-32B使用S*在LiveCodeBench上达到了85.7%,接近o1(高)的88.5%。代码将在https://github.com/NovaSky-AI/SkyThought上提供。

英文摘要

Increasing test-time compute for LLMs shows promise across domains but remains underexplored in code generation, despite extensive study in math. In this paper, we propose S*, the first hybrid test-time scaling framework that substantially improves the coverage and selection accuracy of generated code. S* extends the existing parallel scaling paradigm with sequential scaling to push performance boundaries. It further leverages a novel selection mechanism that adaptively generates distinguishing inputs for pairwise comparison, combined with execution-grounded information to robustly identify correct solutions. We evaluate across 12 Large Language Models and Large Reasoning Model and show: (1) S* consistently improves performance across model families and sizes, enabling a 3B model to outperform GPT-4o-mini; (2) S* enables non-reasoning models to surpass reasoning models - GPT-4o-mini with S* outperforms o1-preview by 3.7% on LiveCodeBench; (3) S* further boosts state-of-the-art reasoning models - DeepSeek-R1-Distill-Qwen-32B with S* achieves 85.7% on LiveCodeBench, approaching o1 (high) at 88.5%. Code will be available under https://github.com/NovaSky-AI/SkyThought.

解读

一句话总结

提出S∗,一个混合测试时间缩放框架,显著提高了代码生成的覆盖率和选择准确性。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源