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

Zhangchen Xu, Yang Liu, Yueqin Yin, Mingyuan Zhou, Radha Poovendran

arXiv:2503.02951 · 2026-07-27 공개 · arXiv · PDF

llm-finetuning human-eval deepseek-r1 synthetic-dataset livecodebench mbpp coding-benchmarks bigcodebench

Abstract

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는 447K개의 검증된 코딩 질문-해결-테스트 세트로 구성된 대규모 합성 데이터셋으로, 코드 생성 모델의 성능을 기존 모델 대비 최대 1.8% 개선한다.

핵심 기여도

핵심 아이디어

기존 합성 코드 데이터셋은 다양성과 검증성 사이에서 균형을 잃는 경우가 많았다. KodCode는 이 문제를 해결하기 위해 세 단계의 파이프라인을 도입한다. 첫째, 12개의 소스에서 다각도로 질문을 생성해 다양성을 확보한다. 둘째, solution과 test case를 생성한 후, self-verification 절차를 통해 정확도를 검증한다. 셋째, DeepSeek R1을 활용한 test-based reject sampling과 question rewriting을 통해 post-training 데이터를 생성한다. 특히, 어려운 문제는 reject sampling 과정에서 버리지 않고 추가 시도를 통해 포함시켜 데이터셋의 난이도 범위를 확장한다. 이는 기존 합성 데이터셋에서 흔히 발생하는 '쉬운 문제만 남는' 문제를 해결한다.

기술적 접근법

주요 결과

의의 및 한계

KodCode는 기존 합성 데이터셋의 한계를 극복한 체계적인 데이터 생성 파이프라인을 제시하며, 코드 생성 모델의 SFT 및 RL 튜닝에 유용한 자원을 제공한다. 특히, self-verification과 test-based reject sampling을 통해 정확성과 다양성을 동시에 확보한 점이 학술적 가치가 있다. 그러나 데이터셋의 447K 규모는 여전히 대형 모델의 학습에 한계가 있을 수 있으며, 실제 개발 환경에서의 유용성 검증이 필요하다. 또한, 기존 벤치마크와의 중복 가능성은 데이터셋의 독창성에 영향을 줄 수 있다.

실용적 활용

KodCode는 코드 생성 모델의 fine-tuning에 활용되어 개발자 도구, 코드 자동완성, 버그 수정 등 다양한 소프트웨어 개발 과정에 적용 가능하다. 특히, RL 기반 튜닝에 필요한 정확한 unit test와 함께 제공되는 점에서, 인공지능 기반 코드 리뷰 시스템 및 자동 테스트 생성 도구 개발에도 유용할 것으로 기대된다.