arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2505.21297cs.CL
收藏

rStar-Coder:通过大规模已验证数据集扩展竞争性代码推理

rStar-Coder: Scaling Competitive Code Reasoning with a Large-Scale Verified Dataset

Microsoft Research Asia(微软亚洲研究院);Dalian University of Technology(大连理工大学);Shanghai Jiao Tong University(上海交通大学)

Yifei Liu, Li Lyna Zhang, Yi Zhu, Bingcheng Dong, Xudong Zhou, Ning Shang, Fan Yang, Mao Yang

AI总结:

本文提出rStar-Coder,通过构建包含41.8万竞赛级问题和58万长推理解的大规模已验证数据集,结合三步输入生成与互验证机制,显著提升了Qwen等小模型的代码推理能力,在多项基准上超越前沿大模型。

摘要:

大语言模型(LLM)代码推理能力的提升从根本上受限于高难度数据集的稀缺性,尤其是那些包含可验证输入输出测试用例的数据集,这些测试用例对于大规模的严格解决方案验证是必不可少的。我们提出了rStar-Coder,通过构建包含418K竞赛级代码问题、580K长推理解决方案以及不同难度的丰富测试用例的大规模已验证数据集,显著提升了LLM的代码推理能力。这通过三个核心贡献实现:(1)我们整理竞赛编程代码问题和标准解决方案,以合成新的、可解决的问题;(2)我们引入了一个可靠的输入输出测试用例合成管道,将生成过程解耦为三步输入生成方法和用于有效输出标注的互验证机制;(3)我们为问题补充了高质量、经测试用例验证的长推理解决方案。在Qwen模型(1.5B-14B)上跨各种代码推理基准的广泛实验证明了rStar-Coder数据集的优越性,以小得多的模型规模实现了与前沿推理LLM相当的领先性能。在LiveCodeBench上,rStar-Coder将Qwen2.5-7B从17.4%提升至令人瞩目的57.3%,将Qwen2.5-14B从23.3%提升至62.5%,以3.1%的优势超越了o3-mini (low)。在更具挑战性的USA Computing Olympiad上,我们的7B模型实现了16.15%的平均pass@1准确率,优于前沿水平的QWQ-32B。代码和数据集将发布于https://github.com/microsoft/rStar。

英文摘要:

Advancing code reasoning in large language models (LLMs) is fundamentally limited by the scarcity of high-difficulty datasets, especially those with verifiable input-output test cases necessary for rigorous solution validation at scale. We introduce rStar-Coder, which significantly improves LLM code reasoning capabilities by constructing a large-scale, verified dataset of 418K competition-level code problems, 580K long-reasoning solutions along with rich test cases of varying difficulty. This is achieved through three core contributions: (1) we curate competitive programming code problems and oracle solutions to synthesize new, solvable problems; (2) we introduce a reliable input-output test case synthesis pipeline that decouples the generation into a three-step input generation method and a mutual verification mechanism for effective output labeling; (3) we augment problems with high-quality, test-case-verified long-reasoning solutions. Extensive experiments on Qwen models (1.5B-14B) across various code reasoning benchmarks demonstrate the superiority of rStar-Coder dataset, achieving leading performance comparable to frontier reasoning LLMs with much smaller model sizes. On LiveCodeBench, rStar-Coder improves Qwen2.5-7B from 17.4% to an impressive 57.3%, and Qwen2.5-14B from 23.3% to 62.5%, surpassing o3-mini (low) by3.1%. On the more challenging USA Computing Olympiad, our 7B model achieves an average pass@1 accuracy of 16.15%, outperforming the frontier-level QWQ-32B. Code and the dataset will be released at https://github.com/microsoft/rStar.

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

↑