Skip to main navigation Skip to search Skip to main content

MANDO-LLM: Heterogeneous Graph Transformers with Large Language Models for Smart Contract Vulnerability Detection

  • Nhat-Minh NGUYEN*
  • , Hoang H. NGUYEN
  • , Long Le THANH
  • , Zahra AHMADI
  • , Thanh-Nam DOAN
  • , Daoyuan WU
  • , Lingxiao JIANG
  • *Corresponding author for this work

Research output: Journal PublicationsJournal Article (refereed)peer-review

Abstract

Detecting vulnerabilities in smart contracts is vital for the security and reliability of decentralized apps. To facilitate vulnerability detection, contract codes, including bug patterns, are represented as heterogeneous graphs with various nodes and edges, like control-flow and function-call graphs. However, existing graph-learning techniques struggle with large, complex graphs. This article presents MANDO-LLM, a novel framework that combines heterogeneous graph transformers (HGTs) with large language models (LLMs) for detecting vulnerabilities in smart contracts represented as heterogeneous contract graphs built upon control-flow and call graphs. MANDO-LLM uses LLMs to capture code features from control-flow and call data, customizes HGTs to learn embeddings with specific node-edge meta relations, and employs classifiers for vulnerability detection in Solidity code at both contract and line levels. Our evaluation shows that MANDO-LLM significantly outperforms existing methods on real-world large-scale imbalanced datasets, with F1-score improvements from 0.59% to 80.72% at the contract level. It is also one of the first effective methods for identifying line-level vulnerabilities, with performance boosts ranging from 3.09% to over 95% across different vulnerability types. MANDO-LLM’s versatility allows easy retraining for various vulnerabilities without needing manually defined patterns.

Original languageEnglish
Article number144
Number of pages30
JournalACM Transactions on Software Engineering and Methodology
Volume35
Issue number6
Early online date3 Dec 2025
DOIs
Publication statusPublished - Jun 2026

Bibliographical note

Publisher Copyright:
© 2026 Copyright held by the owner/author(s).

Funding

This research is supported by the Ministry of Education, Singapore under its Academic Research Fund Tier 3 (Award ID: MOET32020-0004).

Keywords

  • code embedding
  • graph embedding
  • graph transformer
  • heterogeneous graph learning
  • large language model
  • smart contracts
  • source code
  • vulnerability detection

Fingerprint

Dive into the research topics of 'MANDO-LLM: Heterogeneous Graph Transformers with Large Language Models for Smart Contract Vulnerability Detection'. Together they form a unique fingerprint.

Cite this