How Do Your Code LLMs perform? Empowering Code Instruction Tuning with Really Good Data

Yejie Wang, Keqing He, Dayuan Fu, Zhuoma Gongque, Heyang Xu, Yanxu Chen, Zhexu Wang, Yujia Fu, Guanting Dong, Muxi Diao, Jingang Wang, Mengdi Zhang, Xunliang Cai, Weiran Xu

Abstract

Recent advancements in code Large Language Models (LLMs) have been driven by instruction tuning on massive datasets. However, high performance on popular benchmarks like HumanEval often stems from data leakage rather than genuine reasoning capabilities. This paper presents a systematic approach to data pruning and decontamination, resulting in the XCoder model family. By filtering for instruction complexity, response quality via unit testing, and sample diversity, XCoder achieves state-of-the-art results on "pollution-free" benchmarks like LiveCodeBench using significantly less data than its predecessors.

Introduction

The rapid progress in coding assistants has largely focused on "instruction tuning"—fine-tuning models on (instruction, code) pairs. While models such as Magicoder and WizardCoder exhibit exceptional performance on HumanEval, their effectiveness often diminishes on newer, uncontaminated benchmarks like LiveCodeBench. This suggests a "HumanEval-chasing" phenomenon where training sets are inadvertently contaminated with test data. This research addresses two critical challenges: quantifying and mitigating data leakage, and identifying high-quality data to train robust models.

Methodology: Three-Dimensional Data Selection

To move beyond simple volume-based training, the authors developed a three-dimensional strategy to prune a pool of 2.5 million samples into a high-quality core.

The XCoder data selection and training pipeline, illustrating the roles of the Complexity Scorer and Unit Test Model.
  1. Instruction Complexity: An "Evolved Complexity Scorer" was trained to predict the difficulty of instructions. This follows the "Evol-Instruct" philosophy, where simple seeds are evolved into complex tasks using an LLM.
  2. Response Quality: Rather than relying on subjective "LLM-as-a-judge" metrics, the authors employed a Unit Test Model. This model generates 12 test cases for each code snippet; the quality score is defined by the pass rate of the code against these tests.
  3. Instruction Diversity: To minimize redundancy, diversity-based sampling was used. Instructions were embedded into a vector space, and new samples were only added if they were sufficiently distinct from the existing set.

Additionally, a Test Leakage Indicator (TLI) based on n-gram overlaps was implemented to identify and remove contaminated samples from the initial pool.

The Impact of Decontamination

The study revealed significant leakage in existing datasets. For instance, Magicoder-Evol-Instruct showed a TLI score of 43.2% on HumanEval. Interestingly, removing just 3.4% of leaked data from the Code-Feedback dataset caused a 7% drop in HumanEval scores but led to an increase in performance on the clean LiveCodeBench. This confirms that leakage inflates scores on specific benchmarks while potentially hindering generalizability.

Key Results

XCoder models demonstrate that quality and diversity are more critical than raw data volume, aligning with the "Less Is More for Alignment" (LIMA) philosophy.

Performance comparison of XCoder against leading open-source and proprietary models on LiveCodeBench.
  • Efficiency: XCoder-8B (based on LLaMA3) achieved a 16.5 Pass@1 score on LiveCodeBench using only 40K samples, outperforming larger models like StarCoder2-15B-Instruct.
  • State-of-the-Art Performance: XCoder-70B emerged as a top-tier open-source model, rivaling GPT-4 on several metrics and demonstrating the effectiveness of the pruning strategy at scale.
  • Clean Benchmark Dominance: By focusing on vetted data, XCoder achieves the highest performance levels on HumanEval among models trained on strictly decontaminated datasets.

Conclusion and Future Work

XCoder proves that rigorous data selection and decontamination are essential for developing truly capable code LLMs. While the current work focuses on the LLaMA3 architecture and code generation, future research will explore the portability of these pruned datasets to other architectures and expand the task scope to include debugging, code explanation, and repository-level reasoning. The challenge remains to develop even more sophisticated semantic decontamination methods to catch leakage that simple n-gram filtering might miss.

Summary updated

BibTeX
@inproceedings{wang2024how,
  author = {Yejie Wang and Keqing He and Dayuan Fu and Zhuoma Gongque and Heyang Xu and Yanxu Chen and Zhexu Wang and Yujia Fu and Guanting Dong and Muxi Diao and Jingang Wang and Mengdi Zhang and Xunliang Cai and Weiran Xu},
  title = {{How Do Your Code LLMs perform? Empowering Code Instruction Tuning with Really Good Data}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.777},
}
Figure