mlsanityData to 7 Oct 2026

M2TS: Multi-Scale Multi-Modal Approach Based on Transformer for Source Code Summarization

arXiv 2203.09707 ↗First posted 18 Mar 2022cs.SE cs.AIcited by 14

Not on the map. Why?

Abstract (arXiv)

Source code summarization aims to generate natural language descriptions of code snippets. Many existing studies learn the syntactic and semantic knowledge of code snippets from their token sequences and Abstract Syntax Trees (ASTs). They use the learned code representations as input to code summarization models, which can accordingly generate summaries describing source code. Traditional models traverse ASTs as sequences or split ASTs into paths as input. However, the former loses the structural properties of ASTs, and the latter destroys the overall structure of ASTs. Therefore, comprehensively capturing the structural features of ASTs in learning code representations for source code summarization remains a challenging problem to be solved. In this paper, we propose M2TS, a Multi-scale Multi-modal approach based on Transformer for source code Summarization. M2TS uses a multi-scale AST feature extraction method, which can extract the structures of ASTs more completely and accurately at multiple local and global levels. To complement missing semantic information in ASTs, we also obtain code token features, and further combine them with the extracted AST features using a cross modality fusion method that not only fuses the syntactic and contextual semantic information of source code, but also highlights the key features of each modality. We conduct experiments on two Java and one Python datasets, and the experimental results demonstrate that M2TS outperforms current state-of-the-art methods. We release our code at https://github.com/TranSMS/M2TS.

Key facts. Cited by 14 papers in the map (data through 7 Oct 2026). Builds on 25 of its 59 references that are in the map. First posted on arXiv 18 Mar 2022.

Builds on

25 of 59 references.

References · 25

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2016Semi-Supervised Classification with Graph Convolutional Networkscited by 11,282
  4. 2014Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translationcited by 4,016
  5. 2014CIDEr: Consensus-based Image Description Evaluationcited by 2,027
  6. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  7. 2018code2seq: Generating Sequences from Structured Representations of Codecited by 177
  8. 2020A Transformer-based Approach for Source Code Summarizationcited by 129
  9. 2021M2TR: Multi-modal Multi-scale Transformers for Deepfake Detectioncited by 114
  10. 2018Improving Automatic Source Code Summarization via Deep Reinforcement Learningcited by 99
  11. 2020Improved Code Summarization via a Graph Neural Networkcited by 79
  12. 2019A Neural Model for Generating Natural Language Summaries of Program Subroutinescited by 76
13 more
  1. 2021Language-Agnostic Representation Learning of Source Code from Structure and Contextcited by 63
  2. 2019TreeGen: A Tree-Based Transformer Architecture for Code Generationcited by 58
  3. 2017A parallel corpus of Python functions and documentation strings for automated code documentation and code generationcited by 56
  4. 2019Recommendations for Datasets for Source Code Summarizationcited by 46
  5. 2018Graph2Seq: Graph to Sequence Learning with Attention-based Neural Networkscited by 36
  6. 2019Retrieve and Refine: Exemplar-based Neural Comment Generationcited by 36
  7. 2021Code Structure Guided Transformer for Source Code Summarizationcited by 29
  8. 2019Automatic Source Code Summarization with Extended Tree-LSTMcited by 28
  9. 2021CoCoSum: Contextual Code Summarization with Multi-Relational Graph Neural Networkcited by 22
  10. 2021A Multi-Modal Transformer-based Code Summarization Approach for Smart Contractscited by 16
  11. 2019Multi-Scale Self-Attention for Text Classificationcited by 15
  12. 2020Retrieve and Refine: Exemplar-based Neural Comment Generationcited by 10
  13. 2021Exploiting Method Names to Improve Code Summarization: A Deliberation Multi-Task Learning Approachcited by 5

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2022: 1; 2023: 5; 2024: 5; 2025: 2; 2026: 1.

14 papers.

Sort: