mlsanityData to 13 Oct 2026

AST-MHSA : Code Summarization using Multi-Head Self-Attention

arXiv 2308.05646 ↗First posted 10 Aug 2023cs.CL cs.LG cs.PLcited by 0

Not on the map. Why?

Abstract (arXiv)

Code summarization aims to generate concise natural language descriptions for source code. The prevailing approaches adopt transformer-based encoder-decoder architectures, where the Abstract Syntax Tree (AST) of the source code is utilized for encoding structural information. However, ASTs are much longer than the corresponding source code, and existing methods ignore this size constraint by directly feeding the entire linearized AST into the encoders. This simplistic approach makes it challenging to extract truly valuable dependency relations from the overlong input sequence and leads to significant computational overhead due to self-attention applied to all nodes in the AST. To address this issue effectively and efficiently, we present a model, AST-MHSA that uses multi-head attention to extract the important semantic information from the AST. The model consists of two main components: an encoder and a decoder. The encoder takes as input the abstract syntax tree (AST) of the code and generates a sequence of hidden states. The decoder then takes these hidden states as input and generates a natural language summary of the code. The multi-head attention mechanism allows the model to learn different representations of the input code, which can be combined to generate a more comprehensive summary. The model is trained on a dataset of code and summaries, and the parameters of the model are optimized to minimize the loss between the generated summaries and the ground-truth summaries.

Key facts. No citing papers in the map yet (data through 13 Oct 2026). Builds on 23 of its 52 references that are in the map. First posted on arXiv 10 Aug 2023.

Builds on

23 of 52 references.

References · 23

  1. 2017Attention Is All You Needcited by 60,106
  2. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,549
  3. 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,539
  4. 2014Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translationcited by 4,024
  5. 2017Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layercited by 3,463
  6. 2020Longformer: The Long-Document Transformercited by 3,393
  7. 2016Enriching Word Vectors with Subword Informationcited by 1,581
  8. 2015Pointer Networkscited by 884
  9. 2019A Theoretical Analysis of Contrastive Unsupervised Representation Learningcited by 530
  10. 2017A Survey of Machine Learning for Big Code and Naturalnesscited by 221
  11. 2017Learning to Represent Programs with Graphscited by 220
  12. 2018code2seq: Generating Sequences from Structured Representations of Codecited by 179
11 more
  1. 2020A Transformer-based Approach for Source Code Summarizationcited by 132
  2. 2014word2vec Explained: deriving Mikolov et al.'s negative-sampling word-embedding methodcited by 112
  3. 2014Word Representations via Gaussian Embeddingcited by 96
  4. 2016A Convolutional Attention Network for Extreme Summarization of Source Codecited by 91
  5. 2017Learning to Remember Rare Eventscited by 63
  6. 2018Deep Communicating Agents for Abstractive Summarizationcited by 50
  7. 2016Dynamic Coattention Networks For Question Answeringcited by 49
  8. 2016Tree-to-Sequence Attentional Neural Machine Translationcited by 28
  9. 2021On Training Instance Selection for Few-Shot Neural Text Generationcited by 26
  10. 2017Adversarial Neural Machine Translationcited by 21
  11. 2019Assessing the Ability of Self-Attention Networks to Learn Word Ordercited by 9

Built on by

Not cited yet.