Semantics-Compressed and Attention-Guided Framework for Smart Contract Vulnerability Detection
Abstract
Smart contracts have become a foundational component in blockchain ecosystems, yet their vulnerabilities continue to pose significant security risks and financial losses. Traditional vulnerability detection approaches, such as symbolic execution and rule-based static analysis, often suffer from high computational cost. Recent deep learning methods attempt to learn patterns from smart contract bytecode but typically encode the entire opcode sequence without filtering, introducing noise among opcodes. To address these limitations, this paper proposes a semantics-compressed and attention-guided (SCAG) framework for smart contract vulnerability detection. SCAG introduces an Opcode Semantic Compression (OSC) mechanism to extract a compact set of semantically significant opcodes, thereby reducing noise from redundant or irrelevant instructions. These filtered opcodes are then processed by a self-attention module to capture contextual dependencies that are critical to vulnerability identification. Experiments on the SmartBugs dataset demonstrate that SCAG achieves an F1-score of 0.88 and an AUC of 0.93, outperforming Transformer-based models by approximately 5% and 4.5%, respectively, while also reducing training and inference times by over 50% and maintaining the smallest model size among all deep learning baselines.
Community
0 commentsNo discussion yet
Be the first to share a question or observation.