arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2502.14382cs.LGcs.AI
收藏

S*:代码生成的测试时扩展

S*: Test Time Scaling for Code Generation

University of California, Berkeley(加利福尼亚大学伯克利分校)

Dacheng Li, Shiyi Cao, Chengkun Cao, Xiuyu Li, Shangyin Tan, Kurt Keutzer, Jiarong Xing, Joseph E. Gonzalez, Ion Stoica

AI总结:

本研究提出混合测试时扩展框架S*,结合并行与串行扩展及自适应选择机制,在12款模型上验证其能跨模型规模持续提升代码生成性能,甚至让小模型或非推理模型超越更强模型。

摘要:

增加大语言模型(LLM)的测试时计算量在多个领域展现出潜力,但在代码生成领域仍未得到充分探索,尽管该方向在数学领域已有大量研究。本文提出S*,这是首个混合测试时扩展框架,可大幅提升生成代码的覆盖率和选择准确率。S*在现有并行扩展范式的基础上加入了串行扩展,以突破性能边界。它还采用了一种新颖的选择机制:自适应生成可区分的输入用于两两比较,并结合基于执行的信息来稳健地识别正确的解决方案。我们在12个大语言模型和大推理模型上进行了评估,结果表明:(1)S*在不同模型家族和规模下均能持续提升性能,可使3B参数的模型表现优于GPT-4o-mini;(2)S*能让非推理模型超越推理模型——搭载S*的GPT-4o-mini在LiveCodeBench上的表现比o1-preview高出3.7%;(3)S*可进一步增强最先进的推理模型——搭载S*的DeepSeek-R1-Distill-Qwen-32B在LiveCodeBench上达到85.7%的准确率,接近o1 (high)的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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑