arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2408.08343cs.SEcs.AI
收藏

API引导的数据集合成以微调大型代码模型

API-guided Dataset Synthesis to Finetune Large Code Models

The Hong Kong University of Science and Technology(香港科技大学);ETH Zurich(苏黎世联邦理工学院)

Zongjie Li, Daoyuan Wu, Shuai Wang, Zhendong Su

AI总结:

提出API引导的数据集合成框架DataScope,通过Dsel和Dgen组件提升大型代码模型在通用和特定领域的SFT效果,用更少高质量数据超越5倍未优化数据集。

摘要:

大型代码模型(LCMs)在庞大的代码语料库上预训练,在广泛的代码相关任务中展现出卓越性能。监督微调(SFT)在使这些模型与特定需求对齐并提升其在特定领域性能方面发挥着至关重要的作用。然而,由于数据集质量参差不齐以及特定领域数据集稀缺,合成高质量SFT数据集面临重大挑战。受API作为代码高级抽象、在简洁结构中封装丰富语义信息的启发,我们提出DataScope,一个API引导的数据集合成框架,旨在增强LCMs在通用和特定领域场景下的SFT过程。DataScope包含两个主要组件:Dsel和Dgen。一方面,Dsel采用API覆盖率作为核心指标,通过选择具有更高API覆盖率的现有(质量参差不齐的)数据集子集,实现通用场景下的高效数据集合成。另一方面,Dgen将领域数据集合成为使用API指定的高级功能和刻意构成的代码骨架来合成具体代码的过程。大量实验证明DataScope的有效性,在其合成数据集上微调的模型优于在5倍大的未优化数据集上微调的模型。此外,对模型内部机制、相关超参数和案例研究的一系列分析为所提方法的有效性提供了额外证据。这些发现强调了SFT中数据集质量的重要性,通过提供高效、高性价比的高质量数据集构建框架推动LCMs领域发展。该贡献提升了通用和特定领域场景下的性能,为更强大、更定制化的LCMs铺平道路。

英文摘要:

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: Dsel and Dgen. On one hand, Dsel 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. This contribution enhances performance across both general and domain-specific scenarios, paving the way for more powerful and tailored LCMs.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑