TREASURE: A Transformer-Based Foundation Model for High-Volume Transaction Understanding

Chin-Chia Michael Yeh, Uday Singh Saini, Xin Dai, Xiran Fan, Shubham Jain, Yujie Fan, Jiarui Sun, Junpeng Wang, Menghai Pan, Yingtong Dou, Yuzhong Chen, Vineeth Rakesh, Liang Wang, Yan Zheng, Mahashweta Das

In the world of global finance, the sheer volume of data is staggering. Visa, for instance, processes over 300 billion transactions annually. While this data is a goldmine for detecting fraud and personalizing user experiences, modeling it is a nightmare: it’s sequential, tabular, and features "high-cardinality" variables—like merchants—where there are hundreds of millions of possible values.

In this paper, researchers from Visa Research introduce TREASURE (TRansformer Engine As Scalable Universal transaction Representation Encoder), a foundation model designed to move beyond single-purpose "siloed" models to a unified system that understands the "language" of transactions.

TL;DR

TREASURE is a transformer-based foundation model that learns to represent complex credit card transaction sequences. By using a novel input architecture and an efficient training paradigm for high-cardinality data, it improves abnormal behavior detection by 111% and recommendation systems by 104% compared to existing production models.

What Problem Does This Paper Address?

Most machine learning in finance is task-specific: one model detects fraud, another recommends a merchant, and a third predicts credit risk. This is inefficient. Furthermore, transaction data presents unique challenges:

  1. Mixed Attributes: Some data is "static" (your bank, your card type), while some is "dynamic" (the amount, the time, the specific merchant).
  2. The "Merchant" Problem: Standard models struggle with "high-cardinality" categories. If you want to predict the next merchant a user will visit, you are choosing from over 150 million possibilities. Standard "cross-entropy" loss functions would require massive amounts of GPU memory to calculate.
  3. Temporal Dependencies: Transactions aren't just rows in a table; they are a sequence. Understanding the order of purchases is vital for recognizing behavior.

Methods

TREASURE utilizes a decoder-only Transformer architecture (similar to the "GPT" family) but customized for tabular financial data.

Key Innovations:

  • Static vs. Dynamic Input Modules: Instead of flattening all data into one vector, TREASURE uses dedicated sub-modules. Static attributes are processed once and positioned at the start of the sequence, allowing dynamic transaction vectors to "attend" to them throughout the sequence.
  • Shared Negative Sampling: To handle the 150M+ merchants, the authors use InfoNCE loss. Instead of picking new "negative" examples (merchants the user didn't visit) for every single transaction, they share a pool of negative samples across the entire batch. This drastically reduces memory usage, allowing the model to train on high-cardinality data that would otherwise crash a GPU.
  • Dual-Head Output: The model performs two tasks simultaneously: it predicts the attributes of the next transaction (behavioral modeling) and the network signals of the current transaction (e.g., was it approved or declined?).
  • Dynamic Loss Scaling: Since some tasks are more important than others, the model uses a scaling mechanism that prioritizes the "abnormal behavior" flag. If auxiliary tasks (like predicting the exact transaction amount) start to dominate the gradient, their influence is automatically scaled down.

Datasets

The study uses a massive, industry-grade dataset from Visa:

  • Scale: Approximately 6 billion transactions from 30 million cardholders.
  • Timeframe: 26 months of data (Sept 2020 – Nov 2022).
  • Features: 5 static attributes and 16 dynamic attributes per transaction.
  • Evaluation: The model was benchmarked against actual production systems currently deployed in the field.

Key Insights and Ideas

  • Foundation Models Work for Tables: The "aha moment" here is that the foundation model paradigm—pre-training on a massive scale to learn general representations—works just as well for financial sequences as it does for natural language.
  • Transformers > RNNs: While many financial models still use LSTMs or GRUs, the authors show that the Transformer's attention mechanism is significantly better at capturing the long-term dependencies in a cardholder's shopping history.
  • The Power of Embeddings: TREASURE isn't just a classifier; it's an "embedding provider." By taking the internal representations learned by TREASURE and plugging them into a simple recommendation model, they achieved a 104% boost in performance without needing to retrain the whole system.
  • Scaling Laws: The researchers found a clear "scaling law" for transaction data: performance improves steadily as you add more data, but increasing the model size (parameters) hits diminishing returns if the dataset size remains fixed.

Key Results

  • Fraud/Abnormal Detection: TREASURE achieved a 111% Relative Improvement (RI) over the production systems currently used by Visa.
  • Recommendation Accuracy: In merchant recommendation tasks, TREASURE embeddings led to a 104% average improvement in Hit Rate (HR@K) and NDCG.
  • Memory Efficiency: The shared negative sampling strategy kept memory usage under 6GB, whereas the standard independent sampling method failed (Out of Memory) once it hit just 64 negative samples.

Limitations and Future Work

  • Data Privacy: Because the data is highly sensitive, the specific names of the attributes and the exact "in-house" metrics used for fraud cannot be fully disclosed, making it difficult for outside researchers to replicate the exact results on the same data.
  • Diminishing Returns: The authors noted that simply making the model "wider" or "deeper" doesn't help much unless the dataset size also grows, suggesting they are approaching a limit for the current 6-billion-transaction dataset.
  • Future Directions: The team plans to explore graph-based modeling (to see how different cards interact with the same merchants) and integrating TREASURE with Large Language Models (LLMs) to allow for natural language queries about transaction behavior.

Summary updated

BibTeX
@inproceedings{yeh2026treasure,
  author = {Chin-Chia Michael Yeh and Uday Singh Saini and Xin Dai and Xiran Fan and Shubham Jain and Yujie Fan and Jiarui Sun and Junpeng Wang and Menghai Pan and Yingtong Dou and Yuzhong Chen and Vineeth Rakesh and Liang Wang and Yan Zheng and Mahashweta Das},
  title = {{TREASURE: A Transformer-Based Foundation Model for High-Volume Transaction Understanding}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2026},
  doi = {10.1145/3770854.3783942},
}
Figure