A Multi-Modal Transformer-based Code Summarization Approach for Smart Contracts
Not on the map. Why?
Abstract (arXiv)
Code comment has been an important part of computer programs, greatly facilitating the understanding and maintenance of source code. However, high-quality code comments are often unavailable in smart contracts, the increasingly popular programs that run on the blockchain. In this paper, we propose a Multi-Modal Transformer-based (MMTrans) code summarization approach for smart contracts. Specifically, the MMTrans learns the representation of source code from the two heterogeneous modalities of the Abstract Syntax Tree (AST), i.e., Structure-based Traversal (SBT) sequences and graphs. The SBT sequence provides the global semantic information of AST, while the graph convolution focuses on the local details. The MMTrans uses two encoders to extract both global and local semantic information from the two modalities respectively, and then uses a joint decoder to generate code comments. Both the encoders and the decoder employ the multi-head attention structure of the Transformer to enhance the ability to capture the long-range dependencies between code tokens. We build a dataset with over 300K <method, comment> pairs of smart contracts, and evaluate the MMTrans on it. The experimental results demonstrate that the MMTrans outperforms the state-of-the-art baselines in terms of four evaluation metrics by a substantial margin, and can generate higher quality comments.
Key facts. Cited by 16 papers in the map (data through 7 Oct 2026). First posted on arXiv 12 Mar 2021.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 2; 2022: 3; 2023: 5; 2024: 5; 2025: 1.
16 papers.
Sort:
- 2024Exploring and Unleashing the Power of Large Language Models in Automated Code Translationcited by 57
- 2023Automatic Code Summarization via ChatGPT: How Far Are We?cited by 34
- 2021A Survey on Machine Learning Techniques for Source Code Analysiscited by 23
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
- 2022An Extractive-and-Abstractive Framework for Source Code Summarizationcited by 15
- 2022M2TS: Multi-Scale Multi-Modal Approach Based on Transformer for Source Code Summarizationcited by 14
- 2024ProCQA: A Large-scale Community-based Programming Question Answering Dataset for Code Searchcited by 12
- 2023Automating Code-Related Tasks Through Transformers: The Impact of Pre-trainingcited by 8
- 2024ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarizationcited by 6
- 2021Improving Stack Overflow question title generation with copying enhanced CodeBERT model and bi-modal informationcited by 5
- 2023Abstract Syntax Tree for Programming Language Understanding and Representation: How Far Are We?cited by 5
- 2024The Role of Transformer Models in Advancing Blockchain Technology: A Systematic Surveycited by 3
4 more
- 2022Diverse Title Generation for Stack Overflow Posts with Multiple Sampling Enhanced Transformercited by 2
- 2023An Exploratory Literature Study on Sharing and Energy Use of Language Models for Source Codecited by 1
- 2024Analysing the Behaviour of Tree-Based Neural Networks in Regression Taskscited by 0
- 2025evalSmarT: An LLM-Based Framework for Evaluating Smart Contract Generated Commentscited by 0
- 2025evalSmarT: An LLM-Based Framework for Evaluating Smart Contract Generated Comments28 Jul 2025
- 2024The Role of Transformer Models in Advancing Blockchain Technology: A Systematic Survey2 Sep 2024
- 2024ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarization1 Jul 2024
- 2024Analysing the Behaviour of Tree-Based Neural Networks in Regression Tasks17 Jun 2024
- 2024Exploring and Unleashing the Power of Large Language Models in Automated Code Translation23 Apr 2024
- 2024ProCQA: A Large-scale Community-based Programming Question Answering Dataset for Code Search25 Mar 2024
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkit30 Dec 2023
- 2023Abstract Syntax Tree for Programming Language Understanding and Representation: How Far Are We?1 Dec 2023
- 2023An Exploratory Literature Study on Sharing and Energy Use of Language Models for Source Code5 Jul 2023
- 2023Automatic Code Summarization via ChatGPT: How Far Are We?22 May 2023
- 2023Automating Code-Related Tasks Through Transformers: The Impact of Pre-training8 Feb 2023
- 2022Diverse Title Generation for Stack Overflow Posts with Multiple Sampling Enhanced Transformer24 Aug 2022
4 more
- 2022An Extractive-and-Abstractive Framework for Source Code Summarization15 Jun 2022
- 2022M2TS: Multi-Scale Multi-Modal Approach Based on Transformer for Source Code Summarization18 Mar 2022
- 2021A Survey on Machine Learning Techniques for Source Code Analysis18 Oct 2021
- 2021Improving Stack Overflow question title generation with copying enhanced CodeBERT model and bi-modal information27 Sep 2021
- 2024Exploring and Unleashing the Power of Large Language Models in Automated Code Translationcited by 57
- 2023Automatic Code Summarization via ChatGPT: How Far Are We?cited by 34
- 2021A Survey on Machine Learning Techniques for Source Code Analysiscited by 23
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
- 2022An Extractive-and-Abstractive Framework for Source Code Summarizationcited by 15
- 2022M2TS: Multi-Scale Multi-Modal Approach Based on Transformer for Source Code Summarizationcited by 14
- 2024ProCQA: A Large-scale Community-based Programming Question Answering Dataset for Code Searchcited by 12
- 2023Automating Code-Related Tasks Through Transformers: The Impact of Pre-trainingcited by 8
- 2024ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarizationcited by 6
- 2021Improving Stack Overflow question title generation with copying enhanced CodeBERT model and bi-modal informationcited by 5
- 2023Abstract Syntax Tree for Programming Language Understanding and Representation: How Far Are We?cited by 5
- 2024The Role of Transformer Models in Advancing Blockchain Technology: A Systematic Surveycited by 3
12 most cited of 16 All 16 (JSON)
- 2025evalSmarT: An LLM-Based Framework for Evaluating Smart Contract Generated Comments28 Jul 2025
- 2024The Role of Transformer Models in Advancing Blockchain Technology: A Systematic Survey2 Sep 2024
- 2024ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarization1 Jul 2024
- 2024Analysing the Behaviour of Tree-Based Neural Networks in Regression Tasks17 Jun 2024
- 2024Exploring and Unleashing the Power of Large Language Models in Automated Code Translation23 Apr 2024
- 2024ProCQA: A Large-scale Community-based Programming Question Answering Dataset for Code Search25 Mar 2024
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkit30 Dec 2023
- 2023Abstract Syntax Tree for Programming Language Understanding and Representation: How Far Are We?1 Dec 2023
- 2023An Exploratory Literature Study on Sharing and Energy Use of Language Models for Source Code5 Jul 2023
- 2023Automatic Code Summarization via ChatGPT: How Far Are We?22 May 2023
- 2023Automating Code-Related Tasks Through Transformers: The Impact of Pre-training8 Feb 2023
- 2022Diverse Title Generation for Stack Overflow Posts with Multiple Sampling Enhanced Transformer24 Aug 2022
12 newest of 16 All 16 (JSON)