Code Structure–Guided Transformer for Source Code Summarization
ACM Transactions on Software Engineering and Methodology · 31.01.2023 · 32 (1) · 1-32
DOI: 10.1145/3522674 ↗Kurz gefasst
Fachartikel in der Zeitschrift ACM Transactions on Software Engineering and Methodology, online erschienen am 13.02.2023. Verfasst von Shuzheng Gao und 6 weiteren Autor:innen. Die Arbeit wurde bisher 94-mal zitiert (Crossref) und nennt 70 Literaturangaben. Gefördert von: National Natural Science Foundation of China, Stable Support Plan for Colleges and Universities in Shenzhen, Research Grants Council of the Hong Kong Special Administrative Region, China.
Abstract (Originalsprache)
Code summaries help developers comprehend programs and reduce their time to infer the program functionalities during software maintenance. Recent efforts resort to deep learning techniques such as sequence-to-sequence models for generating accurate code summaries, among which Transformer-based approaches have achieved promising performance. However, effectively integrating the code structure information into the Transformer is under-explored in this task domain. In this article, we propose a novel approach named SG-Trans to incorporate code structural properties into Transformer. Specifically, we inject the local symbolic information (e.g., code tokens and statements) and global syntactic structure (e.g., dataflow graph) into the self-attention module of Transformer as inductive bias. To further capture the hierarchical characteristics of code, the local information and global structure are designed to distribute in the attention heads of lower layers and high layers of Transformer. Extensive evaluation shows the superior performance of SG-Trans over the state-of-the-art approaches. Compared with the best-performing baseline, SG-Trans still improves 1.4% and 2.0% on two benchmark datasets, respectively, in terms of METEOR score, a metric widely used for measuring generation quality.
Förderung
- National Natural Science Foundation of China
- Stable Support Plan for Colleges and Universities in Shenzhen
- Research Grants Council of the Hong Kong Special Administrative Region, China
- UK Engineering and Physical Sciences Research Council
- UK Research and Innovation
Zitieren
APA
Gao, S., Gao, C., He, Y., Zeng, J., Nie, L., Xia, X., & Lyu, M. (2023). Code Structure–Guided Transformer for Source Code Summarization. ACM Transactions on Software Engineering and Methodology, 32(1), 1-32. https://doi.org/10.1145/3522674
Vancouver
Gao S, Gao C, He Y, Zeng J, Nie L, Xia X, et al. Code Structure–Guided Transformer for Source Code Summarization. ACM Transactions on Software Engineering and Methodology. 2023;32(1):1-32. doi:10.1145/3522674
BibTeX
@article{Gao2023,
author = {Gao, Shuzheng and Gao, Cuiyun and He, Yulan and Zeng, Jichuan and Nie, Lunyiu and Xia, Xin and Lyu, Michael},
title = {Code Structure–Guided Transformer for Source Code Summarization},
journal = {ACM Transactions on Software Engineering and Methodology},
year = {2023},
volume = {32},
number = {1},
pages = {1--32},
doi = {10.1145/3522674}
}
EUVIMED