Understanding Structured Financial Data with LLMs: A Case Study on Fraud Detection

Xuwei Tan, Yao Ma, Xueru ZhangarXiv 2025 · DOI

Introduction

Financial fraud detection is a critical task characterized by high-dimensional data and extreme class imbalance. Traditional machine learning models like XGBoost and LightGBM are the industry standard due to their performance on tabular data. However, these "black-box" models lack interpretability, making it difficult for human analysts to verify and justify automated decisions. Large Language Models (LLMs) offer a potential solution through natural language reasoning, but they typically struggle with raw tabular inputs and the "needle in a haystack" nature of fraud.

The FinFRE-RAG Framework

To address these challenges, this paper introduces FinFRE-RAG (FINancial Feature-REduced Retrieval-Augmented Generation). This two-stage framework bridges the gap between structured financial data and LLM reasoning by combining importance-guided feature reduction with retrieval-augmented in-context learning.

Overview of the FinFRE-RAG framework, illustrating the offline feature reduction and online retrieval-augmented reasoning stages.

1. Offline Feature Reduction

The first stage mitigates "tabular input misalignment" by reducing high-dimensional tables to their most salient components. A traditional model (e.g., Random Forest) ranks feature importance, and only the top $k$ features are retained. This focus on high-signal attributes prevents the LLM from being overwhelmed by noise and exceeding context windows.

2. Online Retrieval-Augmented In-Context Learning

When a new transaction is queried, the system retrieves the top $n$ similar historical cases from a vector dataset. These "exemplars" are serialized into natural language prompts along with their ground-truth labels. The LLM then performs in-context learning, providing a 5-point risk score and a qualitative rationale for its assessment. This allows the model to express uncertainty and mimic the logic of a human fraud analyst.

Experimental Evaluation

The framework was evaluated on four major fraud benchmarks: CCF, IEEE-CIS, CCFRAUD, and PAYSIM. These datasets represent a wide range of real-world and simulated transaction types with varying feature counts and fraud ratios.

Key Performance Metrics

The addition of FinFRE-RAG leads to dramatic improvements in model performance across all tested LLMs. For instance, Qwen3-14B's F1-score on the IEEE-CIS dataset improved from a baseline of 0.04 to 0.62. While specialized tabular classifiers still hold a slight edge in raw metrics, FinFRE-RAG narrows the gap significantly.

Performance comparison of various LLMs with and without FinFRE-RAG against traditional ML baselines across four datasets.

Insights and Discussion

  • Feature Sensitivity: LLMs are highly sensitive to feature noise. Experiments showed that providing a smaller set of high-importance features (e.g., $k=10$) often yielded better results than larger sets, suggesting that LLMs perform best when focused on high-signal attributes.
  • Reasoning vs. Pattern Matching: Advanced models like Qwen3 and GPT-OSS demonstrated true reasoning capabilities, improving as more context was provided. In contrast, smaller models tended to over-rely on the simple majority label of retrieved neighbors without analyzing feature differences.
  • Interpretability: Beyond raw metrics, the framework provides human-readable explanations. LLMs can identify specific "red flags"—such as suspicious combinations of email domains and transaction amounts—that align with historical fraud patterns, a capability traditional models lack.

Conclusion

FinFRE-RAG significantly narrows the performance gap between LLMs and specialized tabular classifiers in fraud detection. While traditional models like XGBoost still maintain an edge in raw accuracy and lower latency, the LLM-based approach provides invaluable interpretability for human-in-the-loop systems. Future work will focus on optimizing inference latency and improving the handling of anonymized features in financial data.

Summary updated

BibTeX
@misc{tan2025understanding,
  author = {Xuwei Tan and Yao Ma and Xueru Zhang},
  title = {{Understanding Structured Financial Data with LLMs: A Case Study on Fraud Detection}},
  year = {2025},
  eprint = {2512.13040},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2512.13040},
}
Figure