GAM-CoT Transformer: Hierarchical Attention Networks for Anomaly Detection in Blockchain Transactions
Keywords:
Blockchain security, Illicit transaction detection, Temporal modelingAbstract
Illicit transaction detection on blockchain networks presents a critical challenge due to the pseudonymous, decentralized, and high-volume nature of decentralized finance (DeFi) ecosystems. Traditional machine learning models struggle to effectively capture the temporal dynamics and irregular patterns of illicit behavior, while graph-based methods often incur high computational costs and rely on static relational structures. In this paper, we propose a novel dual-attention framework—GAM-CoT Transformer—for robust transaction-level anomaly detection.
The proposed model integrates two key components: a Global Attention Module (GAM) that adaptively reweights feature channels and temporal steps to emphasize salient patterns, and a Contextual Transformer (CoT) block that efficiently models short-range dependencies using grouped convolutions instead of full self-attention. This design enables the model to simultaneously achieve computational efficiency, temporal expressiveness, and improved detection sensitivity.
We evaluate our approach on a real-world blockchain transaction dataset and demonstrate its superiority over conventional classifiers including Random Forest, XGBoost, and LSTM-based models. The GAM-CoT Transformer achieves higher recall and F1 scores, particularly for the minority illicit class, while maintaining fast convergence and deployment scalability. Our method offers a practical and effective solution for enhancing the security of blockchain systems through intelligent transaction behavior modeling.
Downloads
Published
Issue
Section
License
Copyright (c) 2025 Xinyue Huang, Chen Zhao, Xiang Li, Chengwei Feng, Wuyang Zhang

This work is licensed under a Creative Commons Attribution 4.0 International License.