DMG: Dual-Stream multiple instance learning network for hunting vulnerable smart contracts via adaptive granularity fusion
Na Wang, Kun Zhang, Moroti Sonde, Victor S. Sheng
Key points
From the paper's conclusion- By integrating hierarchical granularity modeling with instance-level learning, DMG shifts from fixed to adaptive granularity, enabling structured and semantically aligned vulnerability analysis.
Abstract
With the increasing complexity of smart contracts and the increasing number of vulnerabilities in real-world scenarios, ensuring smart contract security has become a critical challenge. Despite various detection methods being proposed, existing approaches primarily trained on synthetic (toy) contracts with oversimplified semantics exhibit limited generalization to deployment environments. Furthermore, their reliance on predefined patterns or single-perspective representations with fixed granularity, such as token sequences or control-flow graphs, limits their ability to capture the hierarchical structures and cross-functional dependencies of complex contracts. To this end, we propose a novel Dual-stream Multi-instance and Granularity Fusion Network (DMG). It is designed to capture the structural complexity of real-world contracts while maintaining effectiveness in simpler contracts, thereby ensuring both adaptability and practical relevance. Specifically, DMG learns representations at both the block-level and the function-level from bytecode with relatively structured dispatch organization. Then, it uses Bi-LSTM and a Multi-Head Attention mechanism to model block-level sequential dependencies and capture coarse-grained contextual relationships. Finally, it introduces a granularity-aware fusion mechanism to adaptively integrate both views, releasing the assumption of fixed granularity and enabling the model to learn the most informative representation under weak supervision. By integrating hierarchical granularity modeling with instance-level learning, DMG shifts from fixed to adaptive granularity, enabling structured and semantically aligned vulnerability analysis. Extensive experiments on toy and real-world datasets demonstrate strong performance, and compared with state-of-the-art methods, DMG delivers a balanced solution that bridges the gap between experimental settings and real-world applicability.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- SCOUT: Smart Contract Open-Set Unknown Vulnerability Detection via Multi-Perspective Feature Fusion and Anomaly-Aware RecognitionSymmetry · 2026
- Augmenting Multi-technique Static Analysis with Large Language Models: A Neuro-symbolic Approach to Smart Contract Vulnerability DetectionProceedings of the ACM on Software Engineering · 2026
- MOS: Towards Effective Smart Contract Vulnerability Detection through Mixture-of-Experts Tuning of Large Language ModelsACM Transactions on Software Engineering and Methodology · 2026
- A Survey of Smart Contract Vulnerability Detection Based on Tree RepresentationInformation · 2026
- Detecting Vulnerabilities in EOSIO Smart Contracts via Joint Static and Dynamic Feature LearningACM Transactions on Software Engineering and Methodology · 2026
- Pre-Model Representation Failures in GNN-Based Smart Contract Vulnerability DetectionarXiv · 2026