用合成数据提升大模型编程能力,关键在模拟人类思考过程。
Increasing LLM Coding Capabilities through Diverse Synthetic Coding Tasks
- 构建80万条带思维链的代码任务数据,包含问题、推理、代码和测试。
- 在多个基准上微调后,模型表现优于同类开源模型,且不依赖更大模型规模。
- 适合想提升代码生成能力的研究者和开发者,尤其关注可解释性与泛化性。
大型语言模型在代码生成方面展现出巨大潜力,但其进展受限于大规模、多样化且与人类推理对齐的数据稀缺。现有资源多仅提供问题与答案,缺少中间思考过程。为此,我们提出一种可扩展的合成数据生成管道,生成近80万条指令-推理-代码-测试四元组。每条数据包含任务、分步推理路径、可运行代码及执行测试,使模型不仅能学习结果,还能掌握解决问题的逻辑。该管道结合四大组件:精选竞赛题目、经相关性分类器过滤的网络内容、基于推理模式引导的数据扩展,以及多阶段执行验证;此外采用遗传突变算法增强任务多样性,同时保持推理与代码的一致性。关键发现表明,基于该数据集微调的模型在多个编码基准上均有稳定提升。除准确率外,具备推理意识的数据可替代模型扩容,在不同架构间具有良好泛化能力,且在相同样本预算下超越领先开源模型。本工作确立了以推理为中心的合成数据生成是提升大模型编程能力的有效途径。我们已公开数据集与生成管道,以促进后续研究。
原文摘要 · Abstract (English)
Large language models (LLMs) have shown impressive promise in code generation, yet their progress remains limited by the shortage of large-scale datasets that are both diverse and well-aligned with human reasoning. Most existing resources pair problems with solutions, but omit the intermediate thought process that guides coding. To close this gap, we present a scalable synthetic data generation pipeline that produces nearly 800k instruction-reasoning-code-test quadruplets. Each sample combines a task, a step-by-step reasoning trace, a working solution, and executable tests, enabling models to learn not just the what but also the how of problem solving. Our pipeline combines four key components: curated contest problems, web-mined content filtered by relevance classifiers, data expansion guided by reasoning patterns, and multi-stage execution-based validation. A genetic mutation algorithm further increases task diversity while maintaining consistency between reasoning traces and code implementations. Our key finding is that fine-tuning LLMs on this dataset yields consistent improvements on coding benchmarks. Beyond raw accuracy, reasoning-aware data can substitute for model scaling, generalize across architectures, and outperform leading open-source alternatives under identical sample budgets. Our work establishes reasoning-centered synthetic data generation as an efficient approach for advancing coding capabilities in LLMs. We publish our dataset and generation pipeline to facilitate further research.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。