用41.8万道可验证代码题训练模型,显著提升小模型编程推理能力。
rStar-Coder: Scaling Competitive Code Reasoning with a Large-Scale Verified Dataset
- 构建41.8万道竞赛级代码题与58万条带测试用例的长推理解法
- 在LiveCodeBench上使7B模型准确率从17.4%提升至57.3%
- 适合想用小模型实现顶尖编程推理能力的研究者和开发者
大型语言模型(LLMs)的代码推理能力受限于高难度、可验证数据集的稀缺性。本文提出rStar-Coder,构建了一个包含41.8万道竞赛级代码问题、580万条长推理解法及多样化难度测试用例的大规模验证数据集。核心贡献包括:(1) 通过合成新可解问题来扩充竞赛编程题目;(2) 设计三步输入生成与互验机制,确保输出标签准确;(3) 增加高质量、经测试验证的长推理解法。在Qwen系列模型(1.5B-14B)上的实验表明,rStar-Coder显著提升性能:在LiveCodeBench上,Qwen2.5-7B准确率由17.4%升至57.3%,Qwen2.5-14B从23.3%升至62.5%,超越o3-mini(low)3.1%;在更难的美国信息学奥林匹克竞赛(USA Computing Olympiad)中,7B模型平均通过率(pass@1)达16.15%,优于前沿模型QWQ-32B。代码与数据集将开源。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。