Source Code Summarization with Structural Relative Position Guided Transformer
Zi Gong, Cuiyun Gao, Yasheng Wang, Wenchao Gu, Yun Peng, Zenglin Xu

TL;DR
This paper introduces SCRIPT, a Transformer-based model that incorporates structural relative positions from Abstract Syntax Trees to improve source code summarization, outperforming existing methods on standard benchmarks.
Contribution
The paper proposes a novel Structural Relative Position guided Transformer (SCRIPT) that models structural dependencies in source code using AST-based relative positions, enhancing code semantic understanding.
Findings
SCRIPT outperforms state-of-the-art methods by at least 1.6% in BLEU score.
SCRIPT achieves 1.4% higher ROUGE-L score than previous approaches.
SCRIPT improves METEOR score by 2.8% on benchmark datasets.
Abstract
Source code summarization aims at generating concise and clear natural language descriptions for programming languages. Well-written code summaries are beneficial for programmers to participate in the software development and maintenance process. To learn the semantic representations of source code, recent efforts focus on incorporating the syntax structure of code into neural networks such as Transformer. Such Transformer-based approaches can better capture the long-range dependencies than other neural networks including Recurrent Neural Networks (RNNs), however, most of them do not consider the structural relative correlations between tokens, e.g., relative positions in Abstract Syntax Trees (ASTs), which is beneficial for code semantics learning. To model the structural dependency, we propose a Structural Relative Position guided Transformer, named SCRIPT. SCRIPT first obtains the…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Software System Performance and Reliability · Software Reliability and Analysis Research
MethodsAttention Is All You Need · Linear Layer · Softmax · Layer Normalization · Multi-Head Attention · Dense Connections · Byte Pair Encoding · Dropout · Label Smoothing · Position-Wise Feed-Forward Layer
