JOURNAL ARTICLE

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

Ze TangChuanyi LiJidong GeXiaoyu ShenZheling ZhuBin Luo

Year: 2021 Journal:   2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE)

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.

Keywords:
Computer science Encoder Automatic summarization Abstract syntax tree Programming language Source code Transformer ENCODE Abstract syntax Syntax L-attributed grammar Natural language processing Parsing Artificial intelligence Context-free grammar

Metrics

18
Cited By
1.23
FWCI (Field Weighted Citation Impact)
25
Refs
0.83
Citation Normalized Percentile
Is in top 1%
Is in top 10%

Citation History

Topics

Natural Language Processing Techniques
Physical Sciences →  Computer Science →  Artificial Intelligence
Topic Modeling
Physical Sciences →  Computer Science →  Artificial Intelligence
Software Engineering Research
Physical Sciences →  Computer Science →  Information Systems

Related Documents

BOOK-CHAPTER

Code Summarization Through Learning Linearized AST Paths with Transformer

Zhenzhou TianCuiping ZhangBinhui Tian

Lecture notes on data engineering and communications technologies Year: 2023 Pages: 53-60
BOOK-CHAPTER

Code Summarization with Abstract Syntax Tree

Qiuyuan ChenHu HanZhaoyi Liu

Communications in computer and information science Year: 2019 Pages: 652-660
JOURNAL ARTICLE

CSJSS: Augmenting code summarization with joint structural semantic of abstract syntax trees

Rongzhi QiJun YangShuiyan LiYingchi Mao

Journal:   Information and Software Technology Year: 2025 Vol: 190 Pages: 107953-107953
JOURNAL ARTICLE

CAST: Enhancing Code Summarization with Hierarchical Splitting and Reconstruction of Abstract Syntax Trees

Ensheng ShiYanlin WangLun DuHongyu ZhangShi HanDongmei ZhangHongbin Sun

Journal:   Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing Year: 2021
© 2026 ScienceGate Book Chapters — All rights reserved.