paperbot · PL 论文追踪

全部论文 待读 收藏

P2 AST-Transformer: Encoding Abstract Syntax Trees Efficiently for Code Summarization

AST-Transformer:高效编码抽象语法树用于代码摘要
ASE 2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE)2021匹配度 3/10 · 论文涉及 AST 编码与代码摘要,属于 PL 与机器学习交叉,但核心任务是代码摘要而非静态分析、Agentic 程序或形式化验证,也不涉及浮点程序分析或贝叶斯程序分析,因此与用户当前追问题匹配度较低。引用 21 inbox
Ze Tang, Chuanyi Li, Jidong Ge, Xiaoyu Shen, Zheling Zhu, Bin Luo
crossref: 2026-09-12

AI 速览

一句话:提出 AST-Transformer,高效编码树结构 AST 用于代码摘要,显著优于 SOTA 并降低约 90%–95% 编码计算复杂度。

代码摘要旨在为源代码生成简短的自然语言描述。由于源代码具有高度结构化并遵循严格的编程语言文法,现有方法常利用抽象语法树(AST)向编码器提供结构信息。然而,AST 通常远长于源代码,而当前方法忽视编码器长度限制,直接将完整线性化 AST 输入编码器,导致计算开销大、难以扩展。为此,本文提出 AST-Transformer,能够高效编码树结构 AST。实验表明,AST-Transformer 在多个基准上显著优于当时的最先进方法,同时在编码阶段减少约 90%–95% 的计算复杂度,兼顾性能与效率。

问题
当前代码摘要方法需要编码抽象语法树(AST)以利用代码结构,但 AST 远长于源代码,且现有方法忽视编码器长度限制,直接输入完整线性化 AST,导致计算开销过大。
方法
提出 AST-Transformer,直接且高效地编码树结构 AST,而非简单线性化后整体输入,以降低编码复杂度。
评估
实验表明,AST-Transformer 显著优于当时最先进方法,并在编码过程中减少约 90%–95% 的计算复杂度。
原文摘要(Abstract)

Code summarization aims to generate brief natural language descriptions for source code. As source code is highly structured and follows strict programming language grammars, its Abstract Syntax Tree (AST) is often leveraged to inform the encoder about the structural information. However, ASTs are usually much longer than the source code. Current approaches ignore the size limit and simply feed the whole linearized AST into the encoder. To address this problem, we propose AST-Transformer to efficiently encode tree-structured ASTs. Experiments show that AST-Transformer outperforms the state-of-arts by a substantial margin while being able to reduce 90 ~ 95% of the computational complexity in the encoding process.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot6549,
  title = {AST-Transformer: Encoding Abstract Syntax Trees Efficiently for Code Summarization},
  author = {Ze Tang and Chuanyi Li and Jidong Ge and Xiaoyu Shen and Zheling Zhu and Bin Luo},
  booktitle = {ASE},
  year = {2021},
  doi = {10.1109/ase51524.2021.9678882}
}