🤖 AI Summary
To address the security risks arising from undetected malicious intent in smart contracts, this paper proposes SmartIntentNN2—the first model to leverage the BERT pre-trained language model for smart contract intent detection. The architecture integrates Masked Language Modeling (MLM) for enhanced semantic representation, employs BiLSTM for robust sequential modeling, and combines the Universal Sentence Encoder with K-means clustering to enable multi-label intent classification. Evaluated on a real-world smart contract dataset, SmartIntentNN2 achieves an F1-score of 0.927 on a ten-class malicious intent detection task, substantially outperforming existing approaches. This work establishes the first pre-trained language model–based framework for smart contract intent detection and introduces a novel, interpretable, high-accuracy risk-alert paradigm for blockchain application security—operational at the development stage.
📝 Abstract
Malicious intent in smart contract development can lead to substantial economic losses. SmartIntentNN is a deep learning model specifically designed to identify unsafe intents in smart contracts. This model integrates the Universal Sentence Encoder, a K-means clustering-based intent highlighting mechanism, and a Bidirectional Long Short-Term Memory network for multi-label classification, achieving an F1 of 0.8633 in distinguishing ten different intent categories. In this study, we present an upgraded version of this model, SmartIntentNN2 (Smart Contract Intent Neural Network V2). A significant enhancement in V2 is the incorporation of a BERT-based pre-trained language model, which has been trained on a dataset of 16,000 real smart contracts using a Masked Language Modeling objective. SmartIntentNN2 retains the BiLSTM-based multi-label classification network. With an improved F1 of 0.927, V2 demonstrates enhanced performance compared to its predecessor, establishing itself as the state-of-the-art model for smart contract intent detection.