mlsanityData to 7 Oct 2026

Source Code Summarization with Structural Relative Position Guided Transformer

arXiv 2202.06521 ↗First posted 14 Feb 2022cs.CL cs.SEcited by 14

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

  1. 2017Attention Is All You Needcited by 59,932
  2. 2014Adam: A Method for Stochastic Optimizationcited by 36,960
  3. 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
  4. 2014Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translationcited by 4,016
  5. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  6. 2017Get To The Point: Summarization with Pointer-Generator Networkscited by 1,281
  7. 2018Self-Attention with Relative Position Representationscited by 1,112
  8. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
  9. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
  10. 2021Unified Pre-training for Program Understanding and Generationcited by 361
  11. 2018code2seq: Generating Sequences from Structured Representations of Codecited by 177
  12. 2020A Transformer-based Approach for Source Code Summarizationcited by 129
20 more
  1. 2018Improving Automatic Source Code Summarization via Deep Reinforcement Learningcited by 99
  2. 2020Retrieval-Augmented Generation for Code Summarization via Hybrid GNNcited by 89
  3. 2020Improved Code Summarization via a Graph Neural Networkcited by 79
  4. 2019A Neural Model for Generating Natural Language Summaries of Program Subroutinescited by 76
  5. 2019Code Generation as a Dual Task of Code Summarizationcited by 62
  6. 2017A parallel corpus of Python functions and documentation strings for automated code documentation and code generationcited by 56
  7. 2017Automatically Generating Commit Messages from Diffs using Neural Machine Translationcited by 42
  8. 2019Multi-Modal Attention Network Learning for Semantic Source Code Retrievalcited by 40
  9. 2019Retrieve and Refine: Exemplar-based Neural Comment Generationcited by 36
  10. 2020Incorporating External Knowledge through Pre-training for Natural Language to Code Generationcited by 36
  11. 2020Learning to Update Natural Language Comments Based on Code Changescited by 30
  12. 2020Code Summarization with Structure-induced Transformercited by 29
  13. 2016Tree-to-Sequence Attentional Neural Machine Translationcited by 28
  14. 2019Automatic Source Code Summarization with Extended Tree-LSTMcited by 28
  15. 2017A Neural Architecture for Generating Natural Language Descriptions from Source Code Changescited by 23
  16. 2021Improving Code Summarization with Block-wise Abstract Syntax Tree Splittingcited by 19
  17. 2018Automatic Generation of Text Descriptive Comments for Code Blockscited by 18
  18. 2020Leveraging Code Generation to Improve Code Retrieval and Summarization via Dual Learningcited by 16
  19. 2021Code to Comment Translation: A Comparative Study on Model Effectiveness & Errorscited by 6
  20. 2020Language Modelling for Source Code with Transformer-XLcited by 2

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2022: 1; 2023: 5; 2024: 5; 2025: 1; 2026: 2.

14 papers.

Sort:

By area: