Abstract
Fraud detection remains a challenging task due to the complex and deceptive nature of fraudulent activities. Current approaches primarily concentrate on learning only one perspective of the graph: either the topological structure of the graph or the attributes of individual nodes. However, we conduct empirical studies to reveal that these two types of features, while nearly orthogonal, are each independently effective. As a result, previous methods can not fully capture the comprehensive characteristics of the fraud graph. To address this dilemma, we present a novel framework called Relation-Aware GNN with transFormer (RAGFormer) which simultaneously embeds both semantic and topological features into a target node. The simple yet effective network consists of a semantic encoder, a topology encoder, and an attention fusion module. The semantic encoder utilizes Transformer to learn semantic features and node interactions across different relations. We introduce Relation-Aware GNN as the topology encoder to learn topological features and node interactions within each relation. These two complementary features are interleaved through an attention fusion module to support prediction by both orthogonal features. Extensive experiments on two popular public datasets demonstrate that RAGFormer achieves state-of-the-art performance. The significant improvement of RAGFormer in an industrial credit card fraud detection dataset further validates the applicability of our method in real-world business scenarios.
Introduction
Fraud detection is a critical yet challenging task due to the sophisticated tactics used by fraudsters to blend in with legitimate users. While graph-based models have become the standard for uncovering these deceptive patterns, existing approaches often suffer from "tunnel vision." They typically focus on either the topological structure (the connectivity patterns or "who you know") using Graph Neural Networks (GNNs) or the semantic attributes (the intrinsic features or "who you are") using Transformer-based models.
Empirical studies reveal a significant "dilemma": these two types of features are nearly orthogonal, meaning they provide independent and complementary signals. Models that prioritize one over the other fail to capture the full picture. Furthermore, researchers observed that Transformer performance does not improve with increased graph "hops," suggesting they primarily act as attribute learners rather than structural learners in this context.
The RAGFormer Framework
To bridge this gap, the authors propose RAGFormer (Relation-Aware GNN with transFormer), a dual-stream architecture designed to simultaneously embed both semantic and topological features.
The framework consists of three core components:
- Semantic Encoder: Utilizes a Transformer architecture to process subgraphs as sequences. A novel cross-relation aggregation layer is interleaved between Transformer blocks to fuse information across different interaction types (e.g., shared devices vs. shared addresses).
- Topology Encoder: Employs a Relation-Aware GNN consisting of independent GCN streams for each relation. This ensures the model explicitly captures the unique connectivity patterns inherent to different relationship types.
- Attention Fusion Module: Instead of simple concatenation, a self-attention mechanism with residual connections is used to merge semantic and topological embeddings. This allows the model to dynamically weigh the importance of each feature set for a specific target node.
Experimental Evaluation
RAGFormer was evaluated against a wide range of baselines on two public benchmarks, YelpChi and Amazon, as well as a large-scale industrial credit card transaction dataset ("Pay").
As shown in the results table, RAGFormer achieves state-of-the-art performance across all metrics. Notably, it achieved a 12.08% improvement in Average Precision (AP) on the YelpChi dataset compared to the previous best method. On the industrial "Pay" dataset, RAGFormer maintained a consistent 3–5% lead, demonstrating its practical utility in real-world financial scenarios.
Key Insights and Conclusion
The success of RAGFormer stems from its ability to leverage the statistical independence of semantic and topological features. The authors' "orthogonality proof" using Cosine Similarity and Centered Kernel Alignment (CKA) confirms that GNNs and Transformers capture fundamentally different signals. By fusing these perspectives, RAGFormer achieves superior data efficiency, reaching performance levels with only 10% of training data that previous models required 40% to achieve.
While RAGFormer introduces some additional computational overhead (approximately 11% increase in inference latency), the gains in detection accuracy are substantial. Future work will explore more complex GNN backbones and the application of this framework to other fraud domains like money laundering and insurance fraud.
Summary updated