mlsanityData to 7 Oct 2026

CSA-Trans: Code Structure Aware Transformer for AST

arXiv 2404.05767 ↗First posted 7 Apr 2024cs.SE cs.AIcited by 3

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

  1. 2017Attention Is All You Needcited by 59,932
  2. 2020Language Models are Few-Shot Learnerscited by 32,199
  3. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
  4. 2016Semi-Supervised Classification with Graph Convolutional Networkscited by 11,282
  5. 2017Graph Attention Networkscited by 8,854
  6. 2017Neural Message Passing for Quantum Chemistrycited by 3,460
  7. 2020DeBERTa: Decoding-enhanced BERT with Disentangled Attentioncited by 2,157
  8. 2018Self-Attention with Relative Position Representationscited by 1,112
  9. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
  10. 2020Benchmarking Graph Neural Networkscited by 672
  11. 2018Invariant and Equivariant Graph Networkscited by 339
  12. 2021Graph Neural Networks with Learnable Structural and Positional Representationscited by 326
16 more
  1. 2021Do Transformers Really Perform Bad for Graph Representation?cited by 318
  2. 2018Session-based Recommendation with Graph Neural Networkscited by 312
  3. 2022Pure Transformers are Powerful Graph Learnerscited by 188
  4. 2018code2seq: Generating Sequences from Structured Representations of Codecited by 177
  5. 2020A Transformer-based Approach for Source Code Summarizationcited by 129
  6. 2018DeepInf: Social Influence Prediction with Deep Learningcited by 128
  7. 2018Improving Automatic Source Code Summarization via Deep Reinforcement Learningcited by 99
  8. 2022Equivariant and Stable Positional Encoding for More Powerful Graph Neural Networkscited by 94
  9. 2020Retrieval-Augmented Generation for Code Summarization via Hybrid GNNcited by 89
  10. 2018Guiding Neural Machine Translation with Retrieved Translation Piecescited by 63
  11. 2019Code Generation as a Dual Task of Code Summarizationcited by 62
  12. 2017Automatically Generating Commit Messages from Diffs using Neural Machine Translationcited by 42
  13. 2021Transformers Generalize DeepSets and Can be Extended to Graphs and Hypergraphscited by 35
  14. 2021Code Structure Guided Transformer for Source Code Summarizationcited by 29
  15. 2016Tree-to-Sequence Attentional Neural Machine Translationcited by 28
  16. 2022Transformers meet Stochastic Block Models: Attention with Data-Adaptive Sparsity and Costcited by 4

Built on by

Cited by year

Citing papers per year: 2025: 3.

3 papers.