Lune

EMNLP2025Top-tier venue

UnitCoder: Scalable Code Synthesis from Pre-training Corpora

Yichuan Ma, Yunfan Shao, Peiji Li, Demin Song, Qipeng Guo, Linyang Li, Xipeng Qiu, Kai Chen

Abstract

Large Language Models (LLMs) have demonstrated remarkable capabilities in various tasks, yet code generation remains a major challenge. Despite the abundant sources of code data, constructing high-quality training datasets at scale poses a significant challenge. Pre-training code data typically suffers from inconsistent data quality issues. Conversely, instruction-based methods which use a high-quality subset as seed samples suffer from limited task diversity. In this paper, we introduce UnitCoder, which directly supervises pre-training data quality through automatically generated unit tests, while ensuring the correctness via an iterative fix and refine flow. Code synthesized by Unit-Coder benefits from both the diversity of pretraining corpora and the high quality ensured by unit test supervision. Our experiments demonstrate that models fine-tuned on our synthetic dataset exhibit consistent performance improvements. Our work presents a scalable approach that leverages model-generated unit tests to guide the synthesis of high-quality code data from pre-training corpora, demonstrating the potential for producing diverse and high-quality post-training data at scale. All code and data will be released 1 .

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Teaching Large Language Models to Self-Debug cites CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis
  • WizardCoder: Empowering Code Large Language Models with Evol-Instruct cites CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis
  • WizardCoder: Empowering Code Large Language Models with Evol-Instruct cites DS-1000: A Natural and Reliable Benchmark for Data Science Code Generation
Builds onCited byLeft to right by year; the more cited, the higher.

Builds on13

  1. Teaching Large Language Models to Self-DebugXinyun Chen, Maxwell Lin, Nathanael Schärli, Denny ZhouICLR 2024 · 1,085 citations
  2. WizardCoder: Empowering Code Large Language Models with Evol-InstructZiyang Luo, Can Xu, Pu Zhao, Qingfeng Sun et al.ICLR 2024 · 945 citations
  3. DS-1000: A Natural and Reliable Benchmark for Data Science Code GenerationYuhang Lai, Chengxi Li, Yiming Wang, Tianyi Zhang et al.ICML 2023 · 504 citations
  4. CodeGen: An Open Large Language Model for Code with Multi-Turn Program SynthesisErik Nijkamp, Bo Pang, Hiroaki Hayashi, Lifu Tu et al.ICLR 2023 · 234 citations
  5. Code-Aware Prompting: A Study of Coverage-Guided Test Generation in Regression Setting using LLMGabriel Ryan, Siddhartha Jain, Mingyue Shang, Shiqi Wang et al.FSE 2024 · 68 citations

Related papers

  1. Automatic Unit Test Data Generation and Actor-Critic Reinforcement Learning for Code SynthesisPhilip John Gorinski, Matthieu Zimmer, Gerasimos Lampouras, Derrick-Goh-Xin Deik et al.EMNLP Findings 2023 · 1 citation
  2. KodCode: A Diverse, Challenging, and Verifiable Synthetic Dataset for CodingZhangchen Xu, Yang Liu, Yueqin Yin, Mingyuan Zhou et al.ACL Findings 2025 · 9 citations
  3. UniTSyn: A Large-Scale Dataset Capable of Enhancing the Prowess of Large Language Models for Program TestingYifeng He, Jiabo Huang, Yuyang Rong, Yiwen Guo et al.ISSTA 2024 · 10 citations
  4. Evaluating and Improving ChatGPT for Unit Test GenerationZhiqiang Yuan, Mingwei Liu, Shiji Ding, Kaixin Wang et al.FSE 2024 · 89 citations
  5. FrontCoder: Scaling Visual Fidelity in Front-End Code GenerationJun Feng, Jian Yang, Wei Zhang, Jing Wang et al.ACL Findings 2026
Dusk over the sea between two cliffs drawn in fine vertical lines