JOURNAL ARTICLE

Transformer-XL With Graph Neural Network for Source Code Summarization

Xiaoling ZhangShouguo YangLuqian DuanZhe LangZhiqiang ShiLimin Sun

Year: 2021 Journal:   2021 IEEE International Conference on Systems, Man, and Cybernetics (SMC) Pages: 3436-3441

Abstract

Source code summarization is the task of generating a readable natural language to describe the functionality of source code. Code summarization is rapidly expanding, especially as the research takes great advantage of advances in neural networks and artificial intelligence technologies. Some mainstream methods input the structural information (abstract syntax tree (AST)) of the source code into the language model to generate relatively satisfactory comments. However, existing methods can not capture code's long dependencies from AST for effective code summarization. In this paper, we provide a novel way to generate code summaries by combining a graph-based neural network and a Transformer-XL network. We utilize the graph-based neural network to better capture the structure information of AST, and the Transformer-XL network to learn important tokens in the AST and alleviate the problem of long dependency. We evaluate our technique on the standard Java dataset. The experimental results show that the effectiveness of our model is remarkable. It pushes the precision score to 60.73% (5.21% absolute improvement) and the F1 score to 51.06%.

Keywords:
Automatic summarization Computer science Source code Java Abstract syntax tree Artificial neural network Transformer Programming language Artificial intelligence Natural language processing Graph Syntax Theoretical computer science

Metrics

9
Cited By
2.00
FWCI (Field Weighted Citation Impact)
37
Refs
0.88
Citation Normalized Percentile
Is in top 1%
Is in top 10%

Citation History

Topics

Software Engineering Research
Physical Sciences →  Computer Science →  Information Systems
Topic Modeling
Physical Sciences →  Computer Science →  Artificial Intelligence
Web Data Mining and Analysis
Physical Sciences →  Computer Science →  Information Systems

Related Documents

JOURNAL ARTICLE

Function Call Graph Context Encoding for Neural Source Code Summarization

Aakash BansalZachary EberhartZachary KarasYu HuangCollin McMillan

Journal:   IEEE Transactions on Software Engineering Year: 2023 Vol: 49 (9)Pages: 4268-4281
JOURNAL ARTICLE

Code Structure–Guided Transformer for Source Code Summarization

Shuzheng GaoCuiyun GaoYulan HeJichuan ZengLunyiu NieXin XiaMichael R. Lyu

Journal:   ACM Transactions on Software Engineering and Methodology Year: 2022 Vol: 32 (1)Pages: 1-32
JOURNAL ARTICLE

Automatic source code summarization with graph attention networks

Yu ZhouJuanjuan ShenXiaoqing ZhangWenhua YangTingting HanTaolue Chen

Journal:   Journal of Systems and Software Year: 2022 Vol: 188 Pages: 111257-111257
JOURNAL ARTICLE

SDGNN: Structure-aware Dual Graph Neural Network for Code Summarization

Zhifeng HaoZitao LinShengqiang ZhangBoyan XuRuichu Cai

Journal:   International Journal of Machine Learning and Cybernetics Year: 2025 Vol: 16 (5-6)Pages: 3663-3679
© 2026 ScienceGate Book Chapters — All rights reserved.