paperbot · PL 论文追踪

全部论文 待读 收藏

P2 An extensive study on pre-trained models for program understanding and generation

程序理解与生成预训练模型的广泛研究
ISSTA Proceedings of the 31st ACM SIGSOFT International Symposium on Software Testing and Analysis2022匹配度 3/10 · 该论文统一评测程序预训练模型在代码理解与生成任务上的效果、通用性和鲁棒性,属于代码智能与机器学习交叉,但未涉及静态分析、Agentic 程序、浮点程序分析或贝叶斯程序分析等用户核心方向。引用 153 inbox
Zhengran Zeng, Hanzhuo Tan, Haotian Zhang, Jing Li, Yuqun Zhang, Lingming Zhang
crossref: 2026-09-12

AI 速览

一句话:统一复现并对比八个程序预训练模型在七类代码任务上的效果、通用性与对抗鲁棒性,并给出实践指南。

预训练范式已被广泛用于程序理解与生成,但现有模型往往在不同基准、任务与设置下评估,彼此缺乏可比性。本文对八个开源预训练模型在统一的大规模基准与七类代表性代码任务上进行复现研究,并与领域专用的最先进方法对比,同时首次通过对抗攻击考察自然语言-编程语言预训练模型的鲁棒性。研究发现:多数模型可复现原报告性能,但细微波动足以推翻原文结论;没有任何模型能在所有任务上全面占优;预训练模型在程序理解任务上显著优于非预训练方法;简单的随机攻击即可轻易欺骗最先进模型并带来安全隐患。文中还给出了推进该方向未来研究的若干实践建议。

问题
预训练模型在程序理解与生成任务上声称优于既有技术,但评估协议不统一,其有效性、通用性与局限缺乏系统性认识。
方法
在统一的大规模基准上复现八个开源预训练模型在七个代表性代码任务上的表现,与领域专用最先进技术对比,并通过对抗攻击检验其鲁棒性。
评估
通过跨基准、跨任务的复现实验与对抗攻击实验,发现性能难以完全稳定复现、无单一模型全面占优,预训练在程序理解上优势明显,且随机攻击即可欺骗先进模型。
原文摘要(Abstract)

Automatic program understanding and generation techniques could significantly advance the productivity of programmers and have been widely studied by academia and industry. Recently, the advent of pre-trained paradigm enlightens researchers to develop general-purpose pre-trained models which can be applied for a broad range of program understanding and generation tasks. Such pre-trained models, derived by self-supervised objectives on large unlabelled corpora, can be fine-tuned in downstream tasks (such as code search and code generation) with minimal adaptations. Although these pre-trained models claim superiority over the prior techniques, they seldom follow equivalent evaluation protocols, e.g., they are hardly evaluated on the identical benchmarks, tasks, or settings. Consequently, there is a pressing need for a comprehensive study of the pre-trained models on their effectiveness, versatility as well as the limitations to provide implications and guidance for the future development in this area. To this end, we first perform an extensive study of eight open-access pre-trained models over a large benchmark on seven representative code tasks to assess their reproducibility. We further compare the pre-trained models and domain-specific state-of-the-art techniques for validating pre-trained effectiveness. At last, we investigate the robustness of the pre-trained models by inspecting their performance variations under adversarial attacks. Through the study, we find that while we can in general replicate the original performance of the pre-trained models on their evaluated tasks and adopted benchmarks, subtle performance fluctuations can refute the findings in their original papers. Moreover, none of the existing pre-trained models can dominate over all other models. We also find that the pre-trained models can significantly outperform non-pre-trained state-of-the-art techniques in program understanding tasks. Furthermore, we perform the first study for natural language-programming language pre-trained model robustness via adversarial attacks and find that a simple random attack approach can easily fool the state-of-the-art pre-trained models and thus incur security issues. At last, we also provide multiple practical guidelines for advancing future research on pre-trained models for program understanding and generation.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot7400,
  title = {An extensive study on pre-trained models for program understanding and generation},
  author = {Zhengran Zeng and Hanzhuo Tan and Haotian Zhang and Jing Li and Yuqun Zhang and Lingming Zhang},
  booktitle = {ISSTA},
  year = {2022},
  doi = {10.1145/3533767.3534390}
}