A Multi-Modal Transformer-based Code Summarization Approach for Smart Contracts
Zhen Yang, Jacky Keung, Xiao Yu, Xiaodong Gu, Zhengyuan Wei, Xiaoxue, Ma, and Miao Zhang

TL;DR
This paper introduces MMTrans, a multi-modal Transformer-based approach for automatic code summarization in smart contracts, leveraging AST structures to generate high-quality comments and improve understanding of blockchain programs.
Contribution
The paper presents a novel multi-modal Transformer model that combines AST sequences and graphs for better code comment generation in smart contracts.
Findings
MMTrans outperforms existing baselines on a large dataset.
It effectively captures both global and local semantic information.
Generated comments are of higher quality and more accurate.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Topic Modeling · Advanced Malware Detection Techniques
