Source Code Summarization with Structural Relative Position Guided Transformer
Not on the map. Why?
Abstract (arXiv)
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 structural relative positions between tokens via parsing the ASTs of source code, and then passes them into two types of Transformer encoders. One Transformer directly adjusts the input according to the structural relative distance; and the other Transformer encodes the structural relative positions during computing the self-attention scores. Finally, we stack these two types of Transformer encoders to learn representations of source code. Experimental results show that the proposed SCRIPT outperforms the state-of-the-art methods by at least 1.6%, 1.4% and 2.8% with respect to BLEU, ROUGE-L and METEOR on benchmark datasets, respectively. We further show that how the proposed SCRIPT captures the structural relative dependencies.
Key facts. Cited by 14 papers in the map (data through 7 Oct 2026). Builds on 32 of its 54 references that are in the map. First posted on arXiv 14 Feb 2022.
Builds on
32 of 54 references.
References · 32
- 2017Attention Is All You Needcited by 59,932
- 2014Adam: A Method for Stochastic Optimizationcited by 36,960
- 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
- 2014Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translationcited by 4,016
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2017Get To The Point: Summarization with Pointer-Generator Networkscited by 1,281
- 2018Self-Attention with Relative Position Representationscited by 1,112
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
- 2021Unified Pre-training for Program Understanding and Generationcited by 361
- 2018code2seq: Generating Sequences from Structured Representations of Codecited by 177
- 2020A Transformer-based Approach for Source Code Summarizationcited by 129
20 more
- 2018Improving Automatic Source Code Summarization via Deep Reinforcement Learningcited by 99
- 2020Retrieval-Augmented Generation for Code Summarization via Hybrid GNNcited by 89
- 2020Improved Code Summarization via a Graph Neural Networkcited by 79
- 2019A Neural Model for Generating Natural Language Summaries of Program Subroutinescited by 76
- 2019Code Generation as a Dual Task of Code Summarizationcited by 62
- 2017A parallel corpus of Python functions and documentation strings for automated code documentation and code generationcited by 56
- 2017Automatically Generating Commit Messages from Diffs using Neural Machine Translationcited by 42
- 2019Multi-Modal Attention Network Learning for Semantic Source Code Retrievalcited by 40
- 2019Retrieve and Refine: Exemplar-based Neural Comment Generationcited by 36
- 2020Incorporating External Knowledge through Pre-training for Natural Language to Code Generationcited by 36
- 2020Learning to Update Natural Language Comments Based on Code Changescited by 30
- 2020Code Summarization with Structure-induced Transformercited by 29
- 2016Tree-to-Sequence Attentional Neural Machine Translationcited by 28
- 2019Automatic Source Code Summarization with Extended Tree-LSTMcited by 28
- 2017A Neural Architecture for Generating Natural Language Descriptions from Source Code Changescited by 23
- 2021Improving Code Summarization with Block-wise Abstract Syntax Tree Splittingcited by 19
- 2018Automatic Generation of Text Descriptive Comments for Code Blockscited by 18
- 2020Leveraging Code Generation to Improve Code Retrieval and Summarization via Dual Learningcited by 16
- 2021Code to Comment Translation: A Comparative Study on Model Effectiveness & Errorscited by 6
- 2020Language Modelling for Source Code with Transformer-XLcited by 2
Built on by
Citing papers per year: 2022: 1; 2023: 5; 2024: 5; 2025: 1; 2026: 2.
14 papers.
Sort:
By area:
- 2023Automatic Code Summarization via ChatGPT: How Far Are We?cited by 34
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
- 2022An Extractive-and-Abstractive Framework for Source Code Summarizationcited by 15
- 2023Learning a Fourier Transform for Linear Relative Positional Encodings in Transformerscited by 10
- 2024EyeTrans: Merging Human and Machine Attention for Neural Code Summarizationcited by 9
- 2023Tram: A Token-level Retrieval-augmented Mechanism for Source Code Summarizationcited by 6
- 2024ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarizationcited by 6
- 2023Abstract Syntax Tree for Programming Language Understanding and Representation: How Far Are We?cited by 5
- 2024The Role of Transformer Models in Advancing Blockchain Technology: A Systematic Surveycited by 3
- 2024PecSched: Preemptive and Efficient Cluster Scheduling for LLM Inferencecited by 3
- 2024FDC: Fast KV Dimensionality Compression for Efficient LLM Inferencecited by 2
- 2025Variational Prefix Tuning for Diverse and Accurate Code Summarization Using Pre-trained Language Modelscited by 1
2 more
- 2026Syntax vs. Semantics: How Transformers Learn Deep Dependencies26 Jun 2026
- 2026Revisiting the Role of Natural Language Code Comments in Code Translation23 Jan 2026
- 2025Variational Prefix Tuning for Diverse and Accurate Code Summarization Using Pre-trained Language Models14 May 2025
- 2024PecSched: Preemptive and Efficient Cluster Scheduling for LLM Inference23 Sep 2024
- 2024The Role of Transformer Models in Advancing Blockchain Technology: A Systematic Survey2 Sep 2024
- 2024FDC: Fast KV Dimensionality Compression for Efficient LLM Inference7 Aug 2024
- 2024ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarization1 Jul 2024
- 2024EyeTrans: Merging Human and Machine Attention for Neural Code Summarization21 Feb 2024
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkit30 Dec 2023
- 2023Abstract Syntax Tree for Programming Language Understanding and Representation: How Far Are We?1 Dec 2023
- 2023Automatic Code Summarization via ChatGPT: How Far Are We?22 May 2023
- 2023Tram: A Token-level Retrieval-augmented Mechanism for Source Code Summarization18 May 2023
- 2023Automatic Code Summarization via ChatGPT: How Far Are We?cited by 34
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
- 2022An Extractive-and-Abstractive Framework for Source Code Summarizationcited by 15
- 2023Learning a Fourier Transform for Linear Relative Positional Encodings in Transformerscited by 10
- 2024EyeTrans: Merging Human and Machine Attention for Neural Code Summarizationcited by 9
- 2024ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarizationcited by 6
- 2023Abstract Syntax Tree for Programming Language Understanding and Representation: How Far Are We?cited by 5
- 2024The Role of Transformer Models in Advancing Blockchain Technology: A Systematic Surveycited by 3
- 2024PecSched: Preemptive and Efficient Cluster Scheduling for LLM Inferencecited by 3
- 2025Variational Prefix Tuning for Diverse and Accurate Code Summarization Using Pre-trained Language Modelscited by 1
- 2026Revisiting the Role of Natural Language Code Comments in Code Translationcited by 0
- 2026Syntax vs. Semantics: How Transformers Learn Deep Dependenciescited by 0
- 2026Syntax vs. Semantics: How Transformers Learn Deep Dependencies26 Jun 2026
- 2026Revisiting the Role of Natural Language Code Comments in Code Translation23 Jan 2026
- 2025Variational Prefix Tuning for Diverse and Accurate Code Summarization Using Pre-trained Language Models14 May 2025
- 2024PecSched: Preemptive and Efficient Cluster Scheduling for LLM Inference23 Sep 2024
- 2024The Role of Transformer Models in Advancing Blockchain Technology: A Systematic Survey2 Sep 2024
- 2024ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarization1 Jul 2024
- 2024EyeTrans: Merging Human and Machine Attention for Neural Code Summarization21 Feb 2024
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkit30 Dec 2023
- 2023Abstract Syntax Tree for Programming Language Understanding and Representation: How Far Are We?1 Dec 2023
- 2023Automatic Code Summarization via ChatGPT: How Far Are We?22 May 2023
- 2023Learning a Fourier Transform for Linear Relative Positional Encodings in Transformers3 Feb 2023
- 2022An Extractive-and-Abstractive Framework for Source Code Summarization15 Jun 2022