Code Structure Guided Transformer for Source Code Summarization
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
- 2017Attention Is All You Needcited by 59,932
- 2015Deep Residual Learning for Image Recognitioncited by 51,809
- 2016Layer Normalizationcited by 5,579
- 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
- 2019Analyzing Multi-Head Self-Attention: Specialized Heads Do the Heavy Lifting, the Rest Can Be Prunedcited by 844
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
- 2019RAT-SQL: Relation-Aware Schema Encoding and Linking for Text-to-SQL Parserscited by 420
- 2016How NOT To Evaluate Your Dialogue System: An Empirical Study of Unsupervised Evaluation Metrics for Dialogue Response Generationcited by 356
- 2017Learning to Represent Programs with Graphscited by 219
- 2016Incorporating Copying Mechanism in Sequence-to-Sequence Learningcited by 217
29 more
- 2018code2seq: Generating Sequences from Structured Representations of Codecited by 177
- 2020A Transformer-based Approach for Source Code Summarizationcited by 129
- 2018The Adverse Effects of Code Duplication in Machine Learning Models of Codecited by 123
- 2018Improving Automatic Source Code Summarization via Deep Reinforcement Learningcited by 99
- 2019Star-Transformercited by 94
- 2020Retrieval-Augmented Generation for Code Summarization via Hybrid GNNcited by 89
- 2020Improved Code Summarization via a Graph Neural Networkcited by 79
- 2020Contrastive Code Representation Learningcited by 76
- 2020Detecting Code Clones with Graph Neural Networkand Flow-Augmented Abstract Syntax Treecited by 68
- 2018Guiding Neural Machine Translation with Retrieved Translation Piecescited by 63
- 2021Language-Agnostic Representation Learning of Source Code from Structure and Contextcited by 63
- 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
- 2018Structured Neural Summarizationcited by 53
- 2020Big Code != Big Vocabulary: Open-Vocabulary Models for Source Codecited by 53
- 2017Automatically Generating Commit Messages from Diffs using Neural Machine Translationcited by 42
- 2019Retrieve and Refine: Exemplar-based Neural Comment Generationcited by 36
- 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
- 2018Automatic Generation of Text Descriptive Comments for Code Blockscited by 18
- 2019Multi-Scale Self-Attention for Text Classificationcited by 15
- 2020CoreGen: Contextualized Code Representation Learning for Commit Message Generationcited by 15
- 2019Multi-style Generative Reading Comprehensioncited by 14
- 2019Automatic Generation of Pull Request Descriptionscited by 13
- 2020Repulsive Attention: Rethinking Multi-head Attention as Bayesian Inferencecited by 13
- 2020CRaDLe: Deep Code Retrieval Based on Semantic Dependency Learningcited by 12
- 2018Open Vocabulary Learning on Source Code with a Graph-Structured Cachecited by 10
- 2021Exploiting Method Names to Improve Code Summarization: A Deliberation Multi-Task Learning Approachcited by 5
Built on by
Citing papers per year: 2021: 2; 2022: 5; 2023: 4; 2024: 13; 2025: 4; 2026: 1.
29 papers.
Sort:
By area:
- 2021Multilingual training for Software Engineeringcited by 43
- 2024Search-Based LLMs for Code Optimizationcited by 27
- 2021ProTo: Program-Guided Transformer for Program-Guided Taskscited by 19
- 2022M2TS: Multi-Scale Multi-Modal Approach Based on Transformer for Source Code Summarizationcited by 14
- 2024Generative AI for Unmanned Vehicle Swarms: Challenges, Applications and Opportunitiescited by 14
- 2022An Exploratory Study on Code Attention in BERTcited by 12
- 2024JavaBench: A Benchmark of Object-Oriented Code Generation for Evaluating Large Language Modelscited by 10
- 2024RAMBO: Enhancing RAG-based Repository-Level Method Body Completioncited by 10
- 2025Towards an Understanding of Context Utilization in Code Intelligencecited by 10
- 2024EyeTrans: Merging Human and Machine Attention for Neural Code Summarizationcited by 9
- 2024An Empirical Study on Capability of Large Language Models in Understanding Code Semanticscited by 7
- 2024Can Developers Prompt? A Controlled Experiment for Code Documentation Generationcited by 7
17 more
- 2024ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarizationcited by 6
- 2024XMainframe: A Large Language Model for Mainframe Modernizationcited by 6
- 2022GypSum: Learning Hybrid Representations for Code Summarizationcited by 5
- 2023Semantic Similarity Loss for Neural Source Code Summarizationcited by 5
- 2023TransformCode: A Contrastive Learning Framework for Code Embedding via Subtree Transformationcited by 4
- 2024Improving Retrieval-Augmented Code Comment Generation by Retrieving for Generationcited by 4
- 2025RAG or Fine-tuning? A Comparative Study on LCMs-based Code Completion in Industrycited by 4
- 2022Automatic Comment Generation via Multi-Pass Deliberationcited by 3
- 2023LIVABLE: Exploring Long-Tailed Classification of Software Vulnerability Typescited by 3
- 2024CSA-Trans: Code Structure Aware Transformer for ASTcited by 3
- 2024The Role of Transformer Models in Advancing Blockchain Technology: A Systematic Surveycited by 3
- 2023Statement-based Memory for Neural Source Code Summarizationcited by 2
- 2025Variational Prefix Tuning for Diverse and Accurate Code Summarization Using Pre-trained Language Modelscited by 1
- 2025TREAT: A Code LLMs Trustworthiness / Reliability Evaluation and Testing Frameworkcited by 1
- 2022Understanding Long Programming Languages with Structure-Aware Sparse Attentioncited by 0
- 2024LSem2Vec: A Simple yet Effective Two-Stage Approach for Source Code Embeddingcited by 0
- 2026Revisiting the Role of Natural Language Code Comments in Code Translationcited by 0
- 2026Revisiting the Role of Natural Language Code Comments in Code Translation23 Jan 2026
- 2025TREAT: A Code LLMs Trustworthiness / Reliability Evaluation and Testing Framework20 Oct 2025
- 2025RAG or Fine-tuning? A Comparative Study on LCMs-based Code Completion in Industry21 May 2025
- 2025Variational Prefix Tuning for Diverse and Accurate Code Summarization Using Pre-trained Language Models14 May 2025
- 2025Towards an Understanding of Context Utilization in Code Intelligence11 Apr 2025
- 2024RAMBO: Enhancing RAG-based Repository-Level Method Body Completion23 Sep 2024
- 2024LSem2Vec: A Simple yet Effective Two-Stage Approach for Source Code Embedding23 Sep 2024
- 2024The Role of Transformer Models in Advancing Blockchain Technology: A Systematic Survey2 Sep 2024
- 2024Search-Based LLMs for Code Optimization22 Aug 2024
- 2024Improving Retrieval-Augmented Code Comment Generation by Retrieving for Generation7 Aug 2024
- 2024XMainframe: A Large Language Model for Mainframe Modernization5 Aug 2024
- 2024Can Developers Prompt? A Controlled Experiment for Code Documentation Generation1 Aug 2024
17 more
- 2024An Empirical Study on Capability of Large Language Models in Understanding Code Semantics4 Jul 2024
- 2024ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarization1 Jul 2024
- 2024JavaBench: A Benchmark of Object-Oriented Code Generation for Evaluating Large Language Models10 Jun 2024
- 2024CSA-Trans: Code Structure Aware Transformer for AST7 Apr 2024
- 2024Generative AI for Unmanned Vehicle Swarms: Challenges, Applications and Opportunities28 Feb 2024
- 2024EyeTrans: Merging Human and Machine Attention for Neural Code Summarization21 Feb 2024
- 2023TransformCode: A Contrastive Learning Framework for Code Embedding via Subtree Transformation10 Nov 2023
- 2023Semantic Similarity Loss for Neural Source Code Summarization14 Aug 2023
- 2023Statement-based Memory for Neural Source Code Summarization21 Jul 2023
- 2023LIVABLE: Exploring Long-Tailed Classification of Software Vulnerability Types12 Jun 2023
- 2022Automatic Comment Generation via Multi-Pass Deliberation14 Sep 2022
- 2022Understanding Long Programming Languages with Structure-Aware Sparse Attention27 May 2022
- 2022GypSum: Learning Hybrid Representations for Code Summarization26 Apr 2022
- 2022An Exploratory Study on Code Attention in BERT5 Apr 2022
- 2022M2TS: Multi-Scale Multi-Modal Approach Based on Transformer for Source Code Summarization18 Mar 2022
- 2021Multilingual training for Software Engineering3 Dec 2021
- 2021ProTo: Program-Guided Transformer for Program-Guided Tasks2 Oct 2021
- 2021Multilingual training for Software Engineeringcited by 43
- 2024Search-Based LLMs for Code Optimizationcited by 27
- 2021ProTo: Program-Guided Transformer for Program-Guided Taskscited by 19
- 2022M2TS: Multi-Scale Multi-Modal Approach Based on Transformer for Source Code Summarizationcited by 14
- 2024Generative AI for Unmanned Vehicle Swarms: Challenges, Applications and Opportunitiescited by 14
- 2022An Exploratory Study on Code Attention in BERTcited by 12
- 2024JavaBench: A Benchmark of Object-Oriented Code Generation for Evaluating Large Language Modelscited by 10
- 2024RAMBO: Enhancing RAG-based Repository-Level Method Body Completioncited by 10
- 2025Towards an Understanding of Context Utilization in Code Intelligencecited by 10
- 2024EyeTrans: Merging Human and Machine Attention for Neural Code Summarizationcited by 9
- 2024An Empirical Study on Capability of Large Language Models in Understanding Code Semanticscited by 7
- 2024Can Developers Prompt? A Controlled Experiment for Code Documentation Generationcited by 7
12 most cited of 27 All 27 (JSON)
- 2026Revisiting the Role of Natural Language Code Comments in Code Translation23 Jan 2026
- 2025TREAT: A Code LLMs Trustworthiness / Reliability Evaluation and Testing Framework20 Oct 2025
- 2025Variational Prefix Tuning for Diverse and Accurate Code Summarization Using Pre-trained Language Models14 May 2025
- 2025Towards an Understanding of Context Utilization in Code Intelligence11 Apr 2025
- 2024RAMBO: Enhancing RAG-based Repository-Level Method Body Completion23 Sep 2024
- 2024LSem2Vec: A Simple yet Effective Two-Stage Approach for Source Code Embedding23 Sep 2024
- 2024The Role of Transformer Models in Advancing Blockchain Technology: A Systematic Survey2 Sep 2024
- 2024Search-Based LLMs for Code Optimization22 Aug 2024
- 2024XMainframe: A Large Language Model for Mainframe Modernization5 Aug 2024
- 2024Can Developers Prompt? A Controlled Experiment for Code Documentation Generation1 Aug 2024
- 2024An Empirical Study on Capability of Large Language Models in Understanding Code Semantics4 Jul 2024
- 2024ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarization1 Jul 2024
12 newest of 27 All 27 (JSON)