GAM-CoT Transformer: Hierarchical Attention Networks for Anomaly Detection in Blockchain Transactions

Authors

  • Xinyue Huang Independent Researcher
  • Chen Zhao Department of Informatics, University of California
  • Xiang Li Department of Electrical & Computer Engineering, Rutgers University,
  • Chengwei Feng School of Engineering, Computer & Mathematical Sciences (ECMS), Auckland University of Technology
  • Wuyang Zhang Department of Electrical and Computer Engineering, University of Massachusetts

Keywords:

Blockchain security, Illicit transaction detection, Temporal modeling

Abstract

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

2025-06-30