Graph Conditioned Sparse-Attention for Improved Source Code Understanding
Not on the map. Why?
Abstract (arXiv)
Transformer architectures have been successfully used in learning source code representations. The fusion between a graph representation like Abstract Syntax Tree (AST) and a source code sequence makes the use of current approaches computationally intractable for large input sequence lengths. Source code can have long-range dependencies that require larger sequence lengths to model effectively. Current approaches have a quadratic growth in computational and memory costs with respect to the sequence length. Using such models in practical scenarios is difficult. In this work, we propose the conditioning of a source code snippet with its graph modality by using the graph adjacency matrix as an attention mask for a sparse self-attention mechanism and the use of a graph diffusion mechanism to model longer-range token dependencies. Our model reaches state-of-the-art results in BLEU, METEOR, and ROUGE-L metrics for the code summarization task and near state-of-the-art accuracy in the variable misuse task. The memory use and inference time of our model have linear growth with respect to the input sequence length as compared to the quadratic growth of previous works.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 22 of its 32 references that are in the map. First posted on arXiv 1 Dec 2021.
Builds on
22 of 32 references.
References · 22
- 2017Attention Is All You Needcited by 60,361
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
- 2020Big Bird: Transformers for Longer Sequencescited by 1,684
- 2020Reformer: The Efficient Transformercited by 1,668
- 2020Rethinking Attention with Performerscited by 1,601
- 2014DeepWalk: Online Learning of Social Representationscited by 1,547
- 2019Generating Long Sequences with Sparse Transformerscited by 1,546
- 2018Relational inductive biases, deep learning, and graph networkscited by 1,360
- 2020Efficient Transformers: A Surveycited by 790
- 2020Efficient Content-Based Sparse Attention with Routing Transformerscited by 471
- 2021Attention is Not All You Need: Pure Attention Loses Rank Doubly Exponentially with Depthcited by 419
- 2019Diffusion Improves Graph Learningcited by 414
10 more
- 2018Graph Convolutional Networks for Text Classificationcited by 345
- 2015Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networkscited by 306
- 2018code2vec: Learning Distributed Representations of Codecited by 250
- 2017Learning to Represent Programs with Graphscited by 220
- 2020A Transformer-based Approach for Source Code Summarizationcited by 133
- 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 57
- 2020Tree-structured Attention with Hierarchical Accumulationcited by 30
- 2018Balanced Sparsity for Efficient DNN Inference on GPUcited by 27
Built on by
Citing papers per year: 2023: 1.
1 paper.