TL;DR
This paper explores using Large Language Models (LLMs) to analyze cryptocurrency transaction graphs for cybercrime detection, moving away from traditional "black-box" machine learning models. By introducing a token-efficient graph text format (LLM4TG) and a smart graph sampling algorithm (CETraS), the authors demonstrate that LLMs can effectively interpret complex transaction behaviors and explain their reasoning, even with highly limited labeled data.
What Problem Does This Paper Address?
Detecting illicit activities like money laundering, scams, and ransomware on blockchains typically relies on Graph Neural Networks (GNNs) or tree-based machine learning models. While highly accurate, these models operate as black boxes, providing little to no explanation for why an address is flagged as suspicious.
LLMs offer a promising alternative due to their reasoning and natural language generation capabilities. However, applying LLMs to cryptocurrency transaction networks faces two major hurdles:
- Structural Mismatch: LLMs are designed for sequential text, not complex graph structures.
- The Token Bottleneck: Standard graph exchange formats (like GEXF or GraphML) are incredibly verbose. Feeding a moderately sized transaction graph into an LLM quickly exhausts its input token limit, making graph analysis prohibitively expensive or impossible.
Methods
The authors propose a three-tiered evaluation framework to systematically test LLM capabilities on transaction graphs, spanning from basic structural retrieval to complex contextual classification.
To make this framework viable, they introduced two core innovations:
- LLM4TG (Large Language Model for Transaction Graphs): A novel, human-readable text format designed specifically to minimize syntactic noise. Instead of listing edges separately, LLM4TG organizes nodes hierarchically into layers (separating Bitcoin addresses from transactions) and embeds edge details and attributes directly within the node definitions. This drastically reduces token consumption compared to traditional formats.
- CETraS (Connectivity-Enhanced Transaction Graph Sampling): A graph summarization algorithm that condenses mid-sized transaction graphs. It calculates an importance metric ($I_{node}$) for each node based on token amounts, degrees, and distance from the target node, prioritizing the elimination of low-importance nodes while strictly preserving critical connectivity paths.
Datasets
The framework was evaluated using two datasets derived from a 22-month slice of the real-world Bitcoin transaction graph (July 2019 – May 2021):
- BASD: A dataset containing eight types of subgraphs, each originating from a labeled address and extending up to five hops (up to 3,000 nodes per subgraph).
- BABD: A large, publicly available Bitcoin address behavior dataset containing labeled addresses, each mapped to 148 engineered statistical features.
Key Insights and Ideas
- The Local vs. Global Gap: LLMs possess an excellent capacity for retrieving localized, explicit node information (e.g., finding a specific node's in-degree), but their performance plummets when asked to perform holistic, global graph reasoning or cross-node math (e.g., identifying the node with the highest difference between input and output values).
- Raw Data Trumps Engineered Features for Advanced Models: While traditional ML relies heavily on pre-computed features, advanced models like GPT-4o actually performed better when fed the raw, sampled graph structure via LLM4TG than when given engineered feature sets. This indicates that state-of-the-art LLMs can inherently discern structural behavioral patterns directly from raw text-based graphs.
- Few-Shot Superpowers: In data-scarce environments—a common issue in cybercrime forensics where new scam variants emerge constantly—LLMs excel at narrowing down possibilities using only a handful of examples, outperforming traditional models like SVMs and MLPs under identical few-shot constraints.
Key Results
The authors evaluated five prominent models (including the GPT family, DeepSeek, and LLaMA).
- Foundational Metrics (Level 1): LLMs achieved over 98.50% accuracy in recognizing basic node-level characteristics. However, global graph metrics hovered much lower, between 24.00% and 58.00%.
- Characteristic Overview (Level 2): GPT-4o demonstrated a clear understanding of graph anomalies, delivering meaningful structural overviews in 95.00% of test cases compared to GPT-4's 70.00%.
- Contextual Interpretation (Level 3): In explainable classification tasks (e.g., identifying if an address belongs to a darknet market, mining pool, or Ponzi scheme), LLMs achieved a top-3 accuracy of up to 72.43%. When processing raw graphs, GPT-4o achieved an exact classification accuracy of 50.49% and a precision of 63.33%, putting its performance on par with specialized tree-based methods.
Limitations and Future Work
Despite these promising results, the authors note several lingering challenges:
- Token Limits Still Bind: Even with LLM4TG and CETraS, massive, enterprise-scale transaction networks cannot be processed in a single prompt.
- Unreliable Explanations: While LLMs generate highly plausible explanations for their classifications, these rationales occasionally contain subtle inaccuracies or logical leaps (hallucinations).
- Temporal Loss: The current iteration of LLM4TG sacrifices some precise timestamp data to save tokens, which can impact the analysis of highly time-sensitive transaction flows.
Future research directions include integrating Chain-of-Thought (CoT) prompting to improve global mathematical reasoning and connecting LLMs with external blockchain knowledge bases to ground their explanations in factual data.
Summary updated