kirancodes.me
To Proof Maintenance & Beyond!

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

Ze Tang, Chuanyi Li, Jidong Ge, Xiaoyu Shen, Zheling Zhu, Bin Luo

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.

BibTeX
@inproceedings{Tang-al:ASE21,
  author    = {Ze Tang and
               Chuanyi Li and
               Jidong Ge and
               Xiaoyu Shen and
               Zheling Zhu and
               Bin Luo},
  title     = {{AST-Transformer:} Encoding Abstract Syntax Trees Efficiently for Code Summarization},
  booktitle = {ASE},
  pages     = {1193--1195},
  publisher = {{IEEE}},
  year      = {2021},
}

Related papers