2025-05-28 · 专家 · 机器学习 · 计算机视觉

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

rStar-Coder通过构建一个大规模、经过验证的编程问题数据集,显著提升了大型语言模型在代码推理方面的能力。

更新于 2025-05-28。作者:Yifei Liu、Li Lyna Zhang、Yi Zhu、Bingcheng Dong、Xudong Zhou、Ning Shang、Fan Yang、Mao Yang。

中文摘要

在大型语言模型(LLMs)中推进代码推理的能力,从根本上受到高难度数据集稀缺性的限制,特别是那些具有可验证的输入输出测试案例的数据集,这对于大规模严格解决方案验证至关重要。我们介绍了rStar-Coder,该系统通过构建一个包含418K个竞赛级别代码问题、580K个长推理解决方案以及丰富、难度各异的测试案例的大型、可验证数据集,显著提升了LLM的代码推理能力。这是通过以下三个核心贡献实现的:(1)我们精心挑选编程竞赛代码问题和求解器解决方案,以合成新的、可解决的问题;(2)我们引入了一个可靠的输入输出测试案例合成流程,该流程将生成过程解耦为三步输入生成方法和一个相互验证机制,以实现有效的输出标签;(3)我们在问题中加入高质量的、经过测试案例验证的长推理解决方案。在Qwen模型(1.5B-14B)和各个代码推理基准测试上进行的广泛实验表明,rStar-Coder数据集具有优越性,实现了与前沿推理LLMs相当但模型规模更小的领先性能。在LiveCodeBench上,rStar-Coder将Qwen2.5-7B的准确率从17.4%提升至令人印象深刻的57.3%,将Qwen2.5-14B的准确率从23.3%提升至62.5%,超越了o3-mini(低)3.1%。在更具挑战性的美国计算机奥林匹克竞赛中,我们的7B模型平均通过率达到了16.15%,超过了前沿级别的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.

解读

一句话总结

rStar-Coder通过构建一个大规模、经过验证的编程问题数据集,显著提升了大型语言模型在代码推理方面的能力。

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

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

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

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

来源

机器可读索引:llms.txt