paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Automating Code-Related Tasks Through Transformers: The Impact of Pre-training

通过 Transformer 自动化代码相关任务:预训练的影响
ICSE 2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE)2023匹配度 3/10 · 该论文研究代码任务中Transformer的预训练目标影响,属于LLM用于代码生成的通用方向,但未涉及静态分析、形式化验证、Agentic程序、浮点程序分析或贝叶斯程序分析等用户核心研究问题,仅与'LLM作为工具'有微弱关联。引用 25 inbox
Rosalia Tufano, Luca Pascarella, Gabriele Bavota
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:系统研究预训练目标对代码任务 Transformer 性能的影响,发现预训练仅在微调数据少时有益,且 MLM 通常已足够。

预训练已成为代码相关任务中 Transformer 模型的常用手段,但不同预训练目标的具体影响尚不明确。本文首先通过系统性文献综述梳理软件工程领域采用的预训练目标,随后使用通用的掩码语言模型(MLM)目标以及为 bug 修复、代码摘要、代码补全定制的预训练目标,训练了 32 个 Transformer,并与未预训练模型在不同微调数据规模下对比。结果表明:预训练仅在微调数据较少时能提升性能;即使与面向下游任务专门设计的预训练目标相比,MLM 通常也足以最大化模型预测性能。

问题
在自动化代码相关任务中,不同预训练目标对 Transformer 性能的具体影响尚不清楚,尤其是任务定制目标能否优于通用目标。
方法
先通过系统性文献综述识别软件工程领域使用的预训练目标,再以通用目标(如 MLM)和面向 bug 修复、代码摘要、代码补全的定制目标预训练 32 个 Transformer,并与未预训练模型在不同微调数据量下对比。
评估
在 bug 修复、代码摘要与代码补全三个下游任务上,比较不同预训练目标及不同微调数据规模下模型的预测性能。
原文摘要(Abstract)

Transformers have gained popularity in the software engineering (SE) literature. These deep learning models are usually pre-trained through a self-supervised objective, meant to provide the model with basic knowledge about a language of interest (e.g., Java). A classic pre-training objective is the masked language model (MLM), in which a percentage of tokens from the input (e.g., a Java method) is masked, with the model in charge of predicting them. Once pre-trained, the model is then fine-tuned to support the specific downstream task of interest (e.g., code summarization). While there is evidence suggesting the boost in performance provided by pre-training, little is known about the impact of the specific pre-training objective(s) used. Indeed, MLM is just one of the possible pre-training objectives and recent work from the natural language processing field suggest that pre-training objectives tailored for the specific downstream task of interest may substantially boost the model's performance. For example, in the case of code summarization, a tailored pre-training objective could be the identification of an appropriate name for a given method, considering the method name to generate as an extreme summary. In this study, we focus on the impact of pre-training objectives on the performance of trans-formers when automating code-related tasks. We start with a systematic literature review aimed at identifying the pre-training objectives used in SE. Then, we pre-train 32 transformers using both (i) generic pre-training objectives usually adopted in SE; and (ii) pre-training objectives tailored to specific code-related tasks subject of our experimentation, namely bug-fixing, code summarization, and code completion. We also compare the pre-trained models with non pre-trained ones and show the advantage brought by pre-training in different scenarios, in which more or less fine-tuning data are available. Our results show that: (i) pre-training helps in boosting performance only if the amount of fine-tuning data available is small; (ii) the MLM objective is usually sufficient to maximize the prediction performance of the model, even when comparing it with pre-training objectives specialized for the downstream task at hand.

链接与引用

DOI 原文 · arXiv · PDF(开放获取) · DBLP

BibTeX
@inproceedings{abs-2302-04048,
  title = {Automating Code-Related Tasks Through Transformers: The Impact of Pre-training},
  author = {Rosalia Tufano and Luca Pascarella and Gabriele Bavota},
  booktitle = {ICSE},
  year = {2023},
  doi = {10.1109/icse48619.2023.00203}
}