mlsanityData to 7 Oct 2026

Code Structure Guided Transformer for Source Code Summarization

arXiv 2104.09340 ↗First posted 19 Apr 2021cs.CLcited by 29

Not on the map. Why?

Abstract (arXiv)

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 paper, 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., data flow 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% in terms of METEOR score, a metric widely used for measuring generation quality, respectively on two benchmark datasets.

Key facts. Cited by 29 papers in the map (data through 7 Oct 2026). Builds on 41 of its 74 references that are in the map. First posted on arXiv 19 Apr 2021.

Builds on

41 of 74 references.

References · 41

  1. 2017Attention Is All You Needcited by 59,932
  2. 2015Deep Residual Learning for Image Recognitioncited by 51,809
  3. 2016Layer Normalizationcited by 5,579
  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. 2019Analyzing Multi-Head Self-Attention: Specialized Heads Do the Heavy Lifting, the Rest Can Be Prunedcited by 844
  8. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
  9. 2019RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parserscited by 420
  10. 2016How NOT To Evaluate Your Dialogue System: An Empirical Study of Unsupervised Evaluation Metrics for Dialogue Response Generationcited by 356
  11. 2017Learning to Represent Programs with Graphscited by 219
  12. 2016Incorporating Copying Mechanism in Sequence-to-Sequence Learningcited by 217
29 more
  1. 2018code2seq: Generating Sequences from Structured Representations of Codecited by 177
  2. 2020A Transformer-based Approach for Source Code Summarizationcited by 129
  3. 2018The Adverse Effects of Code Duplication in Machine Learning Models of Codecited by 123
  4. 2018Improving Automatic Source Code Summarization via Deep Reinforcement Learningcited by 99
  5. 2019Star-Transformercited by 94
  6. 2020Retrieval-Augmented Generation for Code Summarization via Hybrid GNNcited by 89
  7. 2020Improved Code Summarization via a Graph Neural Networkcited by 79
  8. 2020Contrastive Code Representation Learningcited by 76
  9. 2020Detecting Code Clones with Graph Neural Networkand Flow-Augmented Abstract Syntax Treecited by 68
  10. 2018Guiding Neural Machine Translation with Retrieved Translation Piecescited by 63
  11. 2021Language-Agnostic Representation Learning of Source Code from Structure and Contextcited by 63
  12. 2019Code Generation as a Dual Task of Code Summarizationcited by 62
  13. 2017A parallel corpus of Python functions and documentation strings for automated code documentation and code generationcited by 56
  14. 2018Structured Neural Summarizationcited by 53
  15. 2020Big Code != Big Vocabulary: Open-Vocabulary Models for Source Codecited by 53
  16. 2017Automatically Generating Commit Messages from Diffs using Neural Machine Translationcited by 42
  17. 2019Retrieve and Refine: Exemplar-based Neural Comment Generationcited by 36
  18. 2020Code Summarization with Structure-induced Transformercited by 29
  19. 2016Tree-to-Sequence Attentional Neural Machine Translationcited by 28
  20. 2019Automatic Source Code Summarization with Extended Tree-LSTMcited by 28
  21. 2018Automatic Generation of Text Descriptive Comments for Code Blockscited by 18
  22. 2019Multi-Scale Self-Attention for Text Classificationcited by 15
  23. 2020CoreGen: Contextualized Code Representation Learning for Commit Message Generationcited by 15
  24. 2019Multi-style Generative Reading Comprehensioncited by 14
  25. 2019Automatic Generation of Pull Request Descriptionscited by 13
  26. 2020Repulsive Attention: Rethinking Multi-head Attention as Bayesian Inferencecited by 13
  27. 2020CRaDLe: Deep Code Retrieval Based on Semantic Dependency Learningcited by 12
  28. 2018Open Vocabulary Learning on Source Code with a Graph-Structured Cachecited by 10
  29. 2021Exploiting Method Names to Improve Code Summarization: A Deliberation Multi-Task Learning Approachcited by 5

Built on by

Cited by year (2026 to 7 Oct)

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

29 papers.

Sort:

By area:

  1. 2021Multilingual training for Software Engineeringcited by 43
  2. 2024Search-Based LLMs for Code Optimizationcited by 27
  3. 2021ProTo: Program-Guided Transformer for Program-Guided Taskscited by 19
  4. 2022M2TS: Multi-Scale Multi-Modal Approach Based on Transformer for Source Code Summarizationcited by 14
  5. 2024Generative AI for Unmanned Vehicle Swarms: Challenges, Applications and Opportunitiescited by 14
  6. 2022An Exploratory Study on Code Attention in BERTcited by 12
  7. 2024JavaBench: A Benchmark of Object-Oriented Code Generation for Evaluating Large Language Modelscited by 10
  8. 2024RAMBO: Enhancing RAG-based Repository-Level Method Body Completioncited by 10
  9. 2025Towards an Understanding of Context Utilization in Code Intelligencecited by 10
  10. 2024EyeTrans: Merging Human and Machine Attention for Neural Code Summarizationcited by 9
  11. 2024An Empirical Study on Capability of Large Language Models in Understanding Code Semanticscited by 7
  12. 2024Can Developers Prompt? A Controlled Experiment for Code Documentation Generationcited by 7
17 more
  1. 2024ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarizationcited by 6
  2. 2024XMainframe: A Large Language Model for Mainframe Modernizationcited by 6
  3. 2022GypSum: Learning Hybrid Representations for Code Summarizationcited by 5
  4. 2023Semantic Similarity Loss for Neural Source Code Summarizationcited by 5
  5. 2023TransformCode: A Contrastive Learning Framework for Code Embedding via Subtree Transformationcited by 4
  6. 2024Improving Retrieval-Augmented Code Comment Generation by Retrieving for Generationcited by 4
  7. 2025RAG or Fine-tuning? A Comparative Study on LCMs-based Code Completion in Industrycited by 4
  8. 2022Automatic Comment Generation via Multi-Pass Deliberationcited by 3
  9. 2023LIVABLE: Exploring Long-Tailed Classification of Software Vulnerability Typescited by 3
  10. 2024CSA-Trans: Code Structure Aware Transformer for ASTcited by 3
  11. 2024The Role of Transformer Models in Advancing Blockchain Technology: A Systematic Surveycited by 3
  12. 2023Statement-based Memory for Neural Source Code Summarizationcited by 2
  13. 2025Variational Prefix Tuning for Diverse and Accurate Code Summarization Using Pre-trained Language Modelscited by 1
  14. 2025TREAT: A Code LLMs Trustworthiness / Reliability Evaluation and Testing Frameworkcited by 1
  15. 2022Understanding Long Programming Languages with Structure-Aware Sparse Attentioncited by 0
  16. 2024LSem2Vec: A Simple yet Effective Two-Stage Approach for Source Code Embeddingcited by 0
  17. 2026Revisiting the Role of Natural Language Code Comments in Code Translationcited by 0