paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Empirical study of transformers for source code

面向源代码的 Transformer 实证研究
FSE Proceedings of the 29th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering2021匹配度 2/10 · 论文研究面向代码的Transformer变体,关注句法信息利用,属于机器学习与程序语言的交叉,但并未涉及静态分析、形式化验证、浮点或贝叶斯程序分析,也未探讨LLM/Agent在静态分析中的应用,与用户核心方向匹配度低。引用 54 inbox
Nadezhda Chirkova, Sergey Troshin
crossref: 2026-09-12

AI 速览

一句话:在统一框架下实证比较多种融合句法信息的 Transformer 变体,覆盖代码补全、函数命名与缺陷修复任务。

源码虽与自然语言格式相似,但具有严格语法结构。近年许多工作为 Transformer 引入句法信息,却因任务不同、实现各异而难以比较。本文在统一框架中复现多种捕获句法的 Transformer 修改,并在代码补全、函数命名和缺陷修复三个任务上系统评估。实验表明,Transformer 仅依赖句法信息也能做出有意义的预测;同时作者总结出将句法信息纳入模型以提升性能的最佳实践。

问题
现有面向代码的 Transformer 句法增强方法互不比较且面向不同任务,难以判断句法信息何时及如何有用。
方法
在统一框架中复现多种句法捕获修改,并在代码补全、函数命名、缺陷修复三个任务上开展系统性实证比较。
评估
通过三个任务上的统一实验,发现 Transformer 可仅凭句法信息做出有意义预测,并总结出利用句法信息提升性能的最佳实践。
原文摘要(Abstract)

Initially developed for natural language processing (NLP), Transformers are now widely used for source code processing, due to the format similarity between source code and text. In contrast to natural language, source code is strictly structured, i.e., it follows the syntax of the programming language. Several recent works develop Transformer modifications for capturing syntactic information in source code. The drawback of these works is that they do not compare to each other and consider different tasks. In this work, we conduct a thorough empirical study of the capabilities of Transformers to utilize syntactic information in different tasks. We consider three tasks (code completion, function naming and bug fixing) and re-implement different syntax-capturing modifications in a unified framework. We show that Transformers are able to make meaningful predictions based purely on syntactic information and underline the best practices of taking the syntactic information into account for improving the performance of the model.

链接与引用

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

BibTeX
@inproceedings{paperbot6425,
  title = {Empirical study of transformers for source code},
  author = {Nadezhda Chirkova and Sergey Troshin},
  booktitle = {FSE},
  year = {2021},
  doi = {10.1145/3468264.3468611}
}