CSA-Trans: Code Structure Aware Transformer for AST
Not on the map. Why?
Abstract (arXiv)
When applying the Transformer architecture to source code, designing a good self-attention mechanism is critical as it affects how node relationship is extracted from the Abstract Syntax Trees (ASTs) of the source code. We present Code Structure Aware Transformer (CSA-Trans), which uses Code Structure Embedder (CSE) to generate specific PE for each node in AST. CSE generates node Positional Encoding (PE) using disentangled attention. To further extend the self-attention capability, we adopt Stochastic Block Model (SBM) attention. Our evaluation shows that our PE captures the relationships between AST nodes better than other graph-related PE techniques. We also show through quantitative and qualitative analysis that SBM attention is able to generate more node specific attention coefficients. We demonstrate that CSA-Trans outperforms 14 baselines in code summarization tasks for both Python and Java, while being 41.92% faster and 25.31% memory efficient in Java dataset compared to AST-Trans and SG-Trans respectively.
Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). Builds on 28 of its 47 references that are in the map. First posted on arXiv 7 Apr 2024.
Builds on
28 of 47 references.
References · 28
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
- 2016Semi-Supervised Classification with Graph Convolutional Networkscited by 11,282
- 2017Graph Attention Networkscited by 8,854
- 2017Neural Message Passing for Quantum Chemistrycited by 3,460
- 2020DeBERTa: Decoding-enhanced BERT with Disentangled Attentioncited by 2,157
- 2018Self-Attention with Relative Position Representationscited by 1,112
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
- 2020Benchmarking Graph Neural Networkscited by 672
- 2018Invariant and Equivariant Graph Networkscited by 339
- 2021Graph Neural Networks with Learnable Structural and Positional Representationscited by 326
16 more
- 2021Do Transformers Really Perform Bad for Graph Representation?cited by 318
- 2018Session-based Recommendation with Graph Neural Networkscited by 312
- 2022Pure Transformers are Powerful Graph Learnerscited by 188
- 2018code2seq: Generating Sequences from Structured Representations of Codecited by 177
- 2020A Transformer-based Approach for Source Code Summarizationcited by 129
- 2018DeepInf: Social Influence Prediction with Deep Learningcited by 128
- 2018Improving Automatic Source Code Summarization via Deep Reinforcement Learningcited by 99
- 2022Equivariant and Stable Positional Encoding for More Powerful Graph Neural Networkscited by 94
- 2020Retrieval-Augmented Generation for Code Summarization via Hybrid GNNcited by 89
- 2018Guiding Neural Machine Translation with Retrieved Translation Piecescited by 63
- 2019Code Generation as a Dual Task of Code Summarizationcited by 62
- 2017Automatically Generating Commit Messages from Diffs using Neural Machine Translationcited by 42
- 2021Transformers Generalize DeepSets and Can be Extended to Graphs and Hypergraphscited by 35
- 2021Code Structure Guided Transformer for Source Code Summarizationcited by 29
- 2016Tree-to-Sequence Attentional Neural Machine Translationcited by 28
- 2022Transformers meet Stochastic Block Models: Attention with Data-Adaptive Sparsity and Costcited by 4
Built on by
Citing papers per year: 2025: 3.
3 papers.
- 2025CodeCrash: Exposing LLM Fragility to Misleading Natural Language in Code Reasoningcited by 14
- 2025Clarifying Semantics of In-Context Examples for Unit Test Generationcited by 3
- 2025Seamlessly Integrating Tree-Based Positional Embeddings into Transformer Models for Source Code Representationcited by 1
- 2025Clarifying Semantics of In-Context Examples for Unit Test Generation2 Oct 2025
- 2025Seamlessly Integrating Tree-Based Positional Embeddings into Transformer Models for Source Code Representation5 Jul 2025
- 2025CodeCrash: Exposing LLM Fragility to Misleading Natural Language in Code Reasoning19 Apr 2025