Large Language Models Are Qualified Benchmark Builders: Rebuilding Pre-Training Datasets for Advancing Code Intelligence Tasks
Pre-trained code models are essential for various code intelligence tasks. Yet, their effectiveness is heavily influenced by the quality of the pre-training dataset, particularly human-written reference comments, which usually serve as a bridge between the programming language and natural language. One significant challenge is that such comments could become inconsistent with the corresponding code as the software evolves, leading to suboptimal model performance. Large language models (LLMs) have demonstrated superior capabilities in generating high-quality code comments. This work investigates whether substituting original human-written comments with LLM-generated ones can improve pre-training datasets for more effective pretrained code models. As existing reference-based metrics cannot evaluate the quality of human-written reference comments themselves, to enable direct comparison between LLM-generated and human reference comments, we introduce two auxiliary tasks as novel reference-free metrics, including code-comment inconsistency detection and semantic code search. Experimental results show that LLM-generated comments exhibit superior semantic consistency with the code compared to human-written reference comments. Our manual evaluation also corroborates this conclusion, which indicates the potential of utilizing LLMs to enhance the quality of the pre-training dataset. Based on this finding, we rebuilt the CodeSearchNet dataset with LLM-generated comments and re-pre-trained the CodeT5 model. Evaluations on multiple code intelligence tasks demonstrate that models pretrained by LLM-enhanced data outperform their counterparts (pre-trained by original human reference comments data) on code summarization, code generation, and code translation tasks. This research validates the feasibility of rebuilding the pre-training dataset by LLMs to advance code intelligence tasks. It advocates rethinking the reliance on human reference comments for coderelated tasks.
Authors
- Kamal Al‐Sabahi (ORCID: https://orcid.org/0000-0001-5554-9533)
- Tanghaoran Zhang (ORCID: https://orcid.org/0000-0001-7241-9730)
- Yanlin Wang (ORCID: https://orcid.org/0009-0009-1171-1768)
- Shangwen Wang (ORCID: https://orcid.org/0000-0003-1469-2063)
- Xinjun Mao (ORCID: https://orcid.org/0000-0001-6003-5748)
- Zhang Zhang (ORCID: https://orcid.org/0000-0002-9914-026X)
- Yihao Qin (ORCID: https://orcid.org/0000-0003-3257-2524)
- Yao Lu (ORCID: https://orcid.org/0000-0002-2803-534X)
- Kang Yang (ORCID: https://orcid.org/0000-0003-2313-7141)
- Bo Lin (ORCID: https://orcid.org/0009-0002-0215-4700)
Institutions
- Sun Yat-sen University (CN)
- National University of Defense Technology (CN)
Publication Details
- Published
- 2025-04-27
- DOI
- https://doi.org/10.1109/icpc66645.2025.00038
- Primary Topic
- Topic Modeling
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- National Natural Science Foundation of China
- National Key Research and Development Program of China