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. 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 perpetual "cat-and-mouse" game where deceptive actors constantly evolve their behaviors to evade detection. Modern research typically models this data as multi-relation graphs (e.g., users connected by shared IP addresses or merchants). However, existing models often suffer from a "one-sided" perspective. GNN-based models excel at learning graph topology (the "where" and "who" of connections) but struggle with deep node attributes. Conversely, Transformer-based models are masters of semantics (the "what" of node attributes) but are surprisingly "blind" to graph structure.
This paper identifies a critical "dilemma": these two feature types are nearly orthogonal, meaning they provide non-overlapping, complementary information. By picking only one side, current models leave significant evidence on the table.
The Orthogonality of Fraudulent Features
Through empirical studies using Centered Kernel Alignment (CKA) and Cosine Similarity, we demonstrated that features learned by GNNs and Transformers have near-zero correlation. This confirms that combining them provides a missing piece of the puzzle rather than redundant information.
Furthermore, we observed "Transformer Blindness" in preliminary experiments. Increasing the subgraph size from 1-hop to 5-hops for state-of-the-art Transformer models like GAGA resulted in almost no performance gain. This suggests that Transformers primarily act as high-powered attribute encoders rather than true graph learners.
RAGFormer: A Dual-Stream Approach
To bridge the gap between topology and semantics, we propose RAGFormer, a dual-stream architecture designed to fuse these distinct perspectives.
Semantic and Topology Encoders
- Semantic Encoder: This module uses a Transformer to learn node interactions across different relations. We introduce a cross-relation aggregation layer between Transformer layers to facilitate "relational crosstalk," ensuring information doesn't stay siloed.
- Topology Encoder: Instead of a single GNN, we use a Relation-Aware GNN composed of multiple independent GCNs. Each GCN specializes in a specific relation, capturing the unique structural nuances of different interaction types.
Attention Fusion Module
Rather than simple concatenation, we use a self-attention mechanism with residual connections to fuse these features. This allows the model to dynamically weigh whether structural evidence or semantic evidence is more critical for a specific node's classification.
Experimental Results
We evaluated RAGFormer on three datasets: the public YelpChi and Amazon benchmarks, and a massive real-world industrial credit card dataset named Pay, containing over 45 million edges.
Key Findings
- State-of-the-Art Performance: RAGFormer outperformed all baselines, achieving a 12.08% improvement in Average Precision (AP) over the previous best method (GAGA) on YelpChi.
- Data Efficiency: RAGFormer is remarkably efficient, reaching the performance of previous SOTA models using only 10% of the training data that they required 40% to achieve.
- Industrial Success: On the "Pay" dataset, RAGFormer maintained a consistent 3-5% lead across all metrics (AUC, AP, F1), proving its utility in high-stakes production environments.
- Low Overhead: Despite the dual-stream design, the model only adds approximately 6.7% computational overhead (MACs) and 11% inference latency compared to single-stream baselines.
Conclusion
RAGFormer successfully integrates the orthogonal strengths of GNNs and Transformers. By binding global semantic interactions with local topological structures, it sets a new standard for fraud detection performance and data efficiency. Future work will explore more complex GNN backbones and broader fraud domains such as money laundering.
Summary updated