AST-Trans: Code Summarization with Efficient Tree-Structured Attention
Ze Tang, Xiaoyu Shen, Chuanyi Li, Jidong Ge, Liguo Huang, Zheling Zhu, Bin Luo
摘要
Code summarization aims to generate brief natural language descriptions for source codes. The state-of-the-art approaches follow a transformer-based encoder-decoder architecture. As the source code is highly structured and follows strict grammars, its Abstract Syntax Tree (AST) is widely used for encoding structural information. However, ASTs are much longer than the corresponding source code. Existing approaches ignore the size constraint and simply feed the whole linearized AST into the encoders. We argue that such a simple process makes it difficult to extract the truly useful dependency relations from the overlong input sequence. It also incurs significant computational overhead since each node needs to apply self-attention to all other nodes in the AST. To encode the AST more effectively and efficiently, we propose AST-Trans in this paper which exploits two types of node relationships in the AST: ancestor-descendant and sibling relationships. It applies the tree-structured attention to dynamically allocate weights for relevant nodes and exclude irrelevant nodes based on these two relationships. We further propose an efficient implementation to support fast parallel computation for tree-structure attention. On the two code summarization datasets, experimental results show that AST-Trans significantly outperforms the state-of-the-arts while being times more efficient than standard transformers 1 .
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper9
- Tare: Type-Aware Neural Program RepairQihao Zhu, Zeyu Sun, Wenjie Zhang, Yingfei Xiong 等ICSE 2023 · 被引用 29 次
- Developer-Intent Driven Code Comment GenerationFangwen Mu, Xiao Chen, Lin Shi, Song Wang 等ICSE 2023 · 被引用 25 次
- Learning in the Wild: Towards Leveraging Unlabeled Data for Effectively Tuning Pre-trained Code ModelsShuzheng Gao, Wenxin Mao, Cuiyun Gao, Li Li 等ICSE 2024 · 被引用 15 次
- EyeTrans: Merging Human and Machine Attention for Neural Code SummarizationYifan Zhang, Jiliang Li, Zachary Karas, Aakash Bansal 等FSE 2024 · 被引用 15 次
- Keeping Pace with Ever-Increasing Data: Towards Continual Learning of Code Intelligence ModelsShuzheng Gao, Hongyu Zhang, Cuiyun Gao, Chaozheng WangICSE 2023 · 被引用 14 次
它引用的顶会 Paper5
- Deberta: decoding-Enhanced Bert with Disentangled AttentionPengcheng He, Xiaodong Liu, Jianfeng Gao, Weizhu ChenICLR 2021 · 被引用 3,729 次
- Big Bird: Transformers for Longer SequencesManzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie 等NeurIPS 2020 · 被引用 3,159 次
- Code Prediction by Feeding Trees to TransformersSeohyun Kim, Jinman Zhao, Yuchi Tian, Satish ChandraICSE 2021 · 被引用 179 次
- Language-Agnostic Representation Learning of Source Code from Structure and ContextDaniel Zügner, Tobias Kirschstein, Michele Catasta, Jure Leskovec 等ICLR 2021 · 被引用 131 次
- MovieChats: Chat like Humans in a Closed DomainHui Su, Xiaoyu Shen, Xiao Zhou, Zheng Zhang 等EMNLP 2020 · 被引用 24 次
相关 Paper
- CAST: Enhancing Code Summarization with Hierarchical Splitting and Reconstruction of Abstract Syntax TreesEnsheng Shi, Yanlin Wang, Lun Du, Hongyu Zhang 等EMNLP 2021 · 被引用 42 次
- Integrating Tree Path in Transformer for Code RepresentationHan Peng, Ge Li, Wenhan Wang, Yunfei Zhao 等NeurIPS 2021 · 被引用 56 次
- MGF-ESE: An Enhanced Semantic Extractor with Multi-Granularity Feature Fusion for Code SummarizationXiaolong Xu, Yuxin Cao, Hongsheng Hu, Haolong Xiang 等WWW 2025 · 被引用 4 次
- Modeling Hierarchical Syntax Structure with Triplet Position for Source Code SummarizationJuncai Guo, Jin Liu, Yao Wan, Li Li 等ACL 2022
- Rethinking Positional Encoding in Tree Transformer for Code RepresentationHan Peng, Ge Li, Yunfei Zhao, Zhi JinEMNLP 2022 · 被引用 10 次
