2025-03-06 · 专家 · 数据科学 · 机器学习

KodCode: A Diverse, Challenging, and Verifiable Synthetic Dataset for Coding

KODCODE是一个大规模的、多样化的、可验证的编码合成数据集,旨在解决训练编码大型语言模型所需的高质量、可验证训练数据的问题。

更新于 2025-08-14。作者:Zhangchen Xu、Yang Liu、Yueqin Yin、Mingyuan Zhou、Radha Poovendran。

中文摘要

我们引入了KodCode,这是一个合成数据集,旨在解决在多样化难度和领域内获取高质量、可验证训练数据以训练编码大型语言模型的持续挑战。现有的以代码为重点的资源通常无法确保覆盖范围的广度(例如,从简单的编码任务到高级算法问题)或可验证的正确性(例如,单元测试)。相比之下,KodCode包含通过自我验证程序系统验证的问题-解决方案-测试三元组。我们的流程首先合成广泛范围的编码问题,然后生成解决方案和测试用例,对难题分配额外的尝试。最后,通过将问题重写为不同格式并在基于测试的拒绝采样程序下从推理模型(DeepSeek R1)生成响应,进行训练后数据合成。这个流程产生了一个大规模、稳健且多样化的编码数据集。KodCode适用于监督式微调,并且成对的单元测试也为RL调优提供了巨大潜力。在编码基准(HumanEval(+), MBPP(+), BigCodeBench和LiveCodeBench)上的微调实验表明,KodCode调优的模型实现了最先进的性能,超越了Qwen2.5-Coder-32B-Instruct和DeepSeek-R1-Distill-Llama-70B等模型。

英文摘要

We introduce KodCode, a synthetic dataset that addresses the persistent challenge of acquiring high-quality, verifiable training data across diverse difficulties and domains for training Large Language Models for coding. Existing code-focused resources typically fail to ensure either the breadth of coverage (e.g., spanning simple coding tasks to advanced algorithmic problems) or verifiable correctness (e.g., unit tests). In contrast, KodCode comprises question-solution-test triplets that are systematically validated via a self-verification procedure. Our pipeline begins by synthesizing a broad range of coding questions, then generates solutions and test cases with additional attempts allocated to challenging problems. Finally, post-training data synthesis is done by rewriting questions into diverse formats and generating responses under a test-based reject sampling procedure from a reasoning model (DeepSeek R1). This pipeline yields a large-scale, robust and diverse coding dataset. KodCode is suitable for supervised fine-tuning and the paired unit tests also provide great potential for RL tuning. Fine-tuning experiments on coding benchmarks (HumanEval(+), MBPP(+), BigCodeBench, and LiveCodeBench) demonstrate that KodCode-tuned models achieve state-of-the-art performance, surpassing models like Qwen2.5-Coder-32B-Instruct and DeepSeek-R1-Distill-Llama-70B.

解读

一句话总结

KODCODE是一个大规模的、多样化的、可验证的编码合成数据集,旨在解决训练编码大型语言模型所需的高质量、可验证训练数据的问题。

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

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

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

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

来源