CodeChain: An Open, Million-scale Dataset for Code Language Models at the Repository Level

Hongcheng Guo, Junjia Du, Jian Yang, Jiaheng Liu, Minghao Li, Xinnian Liang, Kai Hui, Hao Sun, Liang Chen, Tianyu Liu, Jiaqi Bai, Yixin Cheng, Wenhan Cao, Zhoujun LiOpenReview 2025 · Submission to ICLR 2025 · Withdrawn

Its authors withdrew this paper, so there is no full text to read or summarize.

Abstract

Code large language models (LLMs) have shown remarkable advances in code understanding and generation tasks. Programming corpora serve as the foundation for various code LLMs. In reality, repositories consist of multiple files with numerous cross-file dependencies. Leveraging the dependency information can effectively enhance the code understanding and generation capabilities. However, existing works fail to utilize dependencies effectively. Consequently, there is a pressing need for an open dataset that specifically focuses on capturing and leveraging the cross-file dependencies. To fill in this gap, we release Codechain, an augmentation of the code dataset at the repository level, provides a rich context for code LLMs to learn from. Specifically, to capture the cross-file dependencies, we first parse the code project into a topological graph where nodes represent files and edges denote dependencies. Then, we employ a novel random walk method to determine the code chain and concatenate the corresponding files. To utilize such corpus for supervised fine-tuning, we design Codechain to enable the model to thoroughly learn the code contents and its dependencies. Ultimately, we produce 562,587 code chains and 1,021,550 instruction samples. With Codechain, we train our model on multi-task learning objectives and evaluate on the public benchmarks. The experimental results demonstrate that model by learning the interconnected nature of codes significantly outperforms the previous methods, showcasing the effectiveness of Codechain in advancing the code understanding and generation
BibTeX
@misc{guo2025codechain,
  author = {Hongcheng Guo and Junjia Du and Jian Yang and Jiaheng Liu and Minghao Li and Xinnian Liang and Kai Hui and Hao Sun and Liang Chen and Tianyu Liu and Jiaqi Bai and Yixin Cheng and Wenhan Cao and Zhoujun Li},
  title = {{CodeChain: An Open, Million-scale Dataset for Code Language Models at the Repository Level}},
  year = {2025},
  url = {https://openreview.net/forum?id=RrWAtQNGAg},
  howpublished = {OpenReview},
  note = {Submitted to ICLR 2025},
}
Figure