一句话:提出 API 引导的数据集合成框架 DataScope,以 API 覆盖率筛选与合成高质量微调数据,显著提升大型代码模型的微调效果。
大型代码模型(LCM)的监督微调(SFT)高度依赖高质量数据,但现有数据集质量参差、领域特定数据稀缺,合成高质量 SFT 数据集十分困难。本文受 API 作为代码高层抽象、以简洁结构封装丰富语义这一观察启发,提出 API 引导的数据集合成框架 DataScope,包含两个组件:Dslt 以 API 覆盖率为核心指标,从质量不均的现有数据集中挑选高 API 覆盖的子集,实现通用场景下的高效数据集合成;Dgen 将领域数据集合成转化为依据 API 指定的高层功能与刻意构造的代码骨架来合成具体代码。实验表明,在 DataScope 合成数据上微调的模型优于在规模大五倍的未优化数据集上微调的模型;论文还对模型内部表示、相关超参数与案例进行分析,进一步证明数据质量对 SFT 的重要性。
Large code models (LCMs), pre-trained on vast code corpora, have demonstrated remarkable performance across a wide array of code-related tasks. Supervised fine-tuning (SFT) plays a vital role in aligning these models with specific requirements and enhancing their performance in particular domains. However, synthesizing high-quality SFT datasets poses a significant challenge due to the uneven quality of datasets and the scarcity of domain-specific datasets. Inspired by APIs as high-level abstractions of code that encapsulate rich semantic information in a concise structure, we propose DataScope , an API-guided dataset synthesis framework designed to enhance the SFT process for LCMs in both general and domain-specific scenarios. DataScope comprises two main components: Dslt and Dgen . On the one hand, Dslt employs API coverage as a core metric, enabling efficient dataset synthesis in general scenarios by selecting subsets of existing (uneven-quality) datasets with higher API coverage. On the other hand, Dgen recasts domain dataset synthesis as a process of using API-specified high-level functionality and deliberately constituted code skeletons to synthesize concrete code. Extensive experiments demonstrate DataScope’s effectiveness, with models fine-tuned on its synthesized datasets outperforming those tuned on unoptimized datasets five times larger. Furthermore, a series of analyses on model internals, relevant hyperparameters, and case studies provide additional evidence for the efficacy of our proposed methods. These findings underscore the significance of dataset quality in SFT and advance the field of LCMs by providing an efficient, cost-effective framework for constructing high-quality datasets, which in turn lead to more powerful and tailored LCMs for both general and domain-specific scenarios.
@article{paperbot3194,
title = {API-Guided Dataset Synthesis to Finetune Large Code Models},
author = {Zongjie Li and Daoyuan Wu and Shuai Wang and Zhendong Su},
journal = {Proceedings of the ACM on Programming Languages},
volume = {9},
number = {OOPSLA1},
year = {2025},
doi = {10.1145/3720449}
}