> This page is for Structured Data Models.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/sdgm/llms.txt.

# Kumo Transaction

> An SDK for training your own transaction foundation model on customer event history, then reusing one embedding per customer for fraud, credit, churn, lifetime value among others.

Kumo Transaction is an SDK for training your own Transaction Foundation Model (TxFM) on customer event history. NVIDIA's kit assembles a TxFM from components, with optimized tokenization, caching and attention kernels, and produces one embedding per customer that you reuse for fraud, credit, churn and lifetime value.

> **An SDK, not a pretrained model**
>
> Kumo Transaction does not include pretrained weights. You train the model on your own data.
> Kumo Tabular, Kumo Relational, Kumo Forecast and Kumo Anomaly are pretrained models that you run on your data without training.

Customer tables pass through four stages: tokenize and cache, a configurable model, training, and embedding. A model is one choice in each of six slots: granularity, position, attention, objective, readout and task heads. Invalid combinations fail with a named error before the first training step.

## When to Use Kumo Transaction

Use Kumo Transaction when you want one reusable model of customer behavior, trained on your own data, instead of a separate model for every task.

* **Event sequence model.** Your signal lives in each customer's history of transactions, app activity and profile attributes, for tasks such as fraud, churn, credit and lifetime value. Kumo Transaction pretrains on those histories and produces one embedding per customer to reuse across tasks.
* **Event sequence plus graph model.** Your signal also lives in the links between records, such as shared devices, counterparties and merchants, for tasks such as money laundering and fraud rings. Pair Kumo Transaction with Kumo Engine's graph and relational data loading so the model sees both a customer's history and their surroundings.
  For each of these cases check whether an embedding beats your feature-engineered baseline before you commit to a production build.

## Transaction Foundation Models

This section explains what a TxFM is in general, what the evidence from the industry says, and which design choices matter. The kit in the rest of the page builds on these ideas.

### How a TxFM Works

A transaction foundation model (TxFM) is a single sequence model of customer behavior. It is pretrained without labels and reused across tasks.

1. Each customer's history is a sequence of events, with several fields per event and irregular gaps between events.
2. Pretraining is self-supervised. The model predicts hidden fields or the next event, so every customer history is training data and no labels are needed.
3. A readout produces one embedding per customer.
4. Each downstream task (e.g. fraud, credit risk, churn etc.) trains a small head on the embedding, either a linear probe or a LoRA adapter.

![Transaction foundation model overview. Each customer's events, with fields such as time, amount, merchant, category and channel, form one sequence. The model pretrains without labels by hiding fields or the next event and predicting them. It reads out one embedding per customer, and each task such as fraud, credit risk, churn and lifetime value trains only a small head.](/sdgm/_fern-files/_img/4d39c6ee5898c4e15e2714b60e982d291b77f02563fffbebb70b00d7ba4179e6.webp)

Hand-built features are summaries chosen in advance. Two cardholders can share the same payment count, total and largest amount, while one of them made four card-not-present payments in three minutes at 2am.

![Two cardholders with the same payment count, total and largest amount. Cardholder A made one payment in store. Cardholder B made four card not present payments between 02:14 and 02:17. Features such as payments in five minutes, card not present share and hour of day separate them, and a transaction foundation model learns that summary from raw events.](/sdgm/_fern-files/_img/c4e129fe4e98aebbbdb55d15ead526c9fb8afbc03c266a6ea752899aa6ad0280.webp)

*Illustrative. A common deployment feeds the TxFM embedding into the existing GBDT, next to the engineered features.*

Each feature is a hypothesis written after a pattern was seen. A TxFM instead learns a summary from raw events, which can capture patterns that no one has written a feature for yet, and the same embedding serves every task.

### See It Work

This video follows one synthetic customer from a table of transactions to a single vector, which a linear probe, nearest neighbor search and a surprise score then read.

### Evidence and Cost

* **PRAGMA is the main published result.** [PRAGMA](https://arxiv.org/abs/2604.08649), from Revolut Research and NVIDIA (April 2026), pretrains models of 10M, 100M and 1B parameters on 24 billion events from 26 million users. The 1B model with lightweight fine-tuning shows relative gains over task-specific reference models of about 130% in PR-AUC on credit scoring, 79% on communication engagement and 65% in fraud recall. The paper reports relative changes only, because absolute metrics are commercially sensitive, and the downstream benchmarks are internal to Revolut.
* **Training your own costs more than adopting a tabular model.** A tabular foundation model is a download that takes minutes. A TxFM needs data and compute over quarters: the 1B-parameter PRAGMA model took about two weeks on 32 H100 GPUs, and your own event history is the main asset. This is why Kumo Transaction is an SDK for training your own model and not a pretrained download.
* **Public disclosures are increasing.** In NVIDIA's own census of public sources, the number of institutions with a disclosed TxFM rose from 10 to 31 between January 2025 and October 2026, with 15 disclosing in 2026. Open tabular foundation model releases rose from 5 to 15 over the same period. The census counts disclosures, not the start of a build, and says nothing about how well the models work.

### Design Choices That Matter

Tokens, time and architecture have the largest effect on what a TxFM can learn and what it costs to run.

* **Tokens.** Serializing events as text uses about three times as many tokens as one token per field (measured by comparing the GPT-2 byte-pair encoding with the kit's financial field encoder), and it splits numbers into digit fragments that lose magnitude. Key, value and time tokens avoid both problems. The tokenizer also bounds what the model can learn, because nothing downstream recovers information it discards, so how you bin amounts and treat rare merchants affects results.
* **Time.** Calendar fields carry rhythm, such as rent on the 1st and salary on Fridays. Gaps between events carry recency and velocity: three payments in four minutes differ from three payments in four weeks.
* **Architecture.** Encoding each event once and then attending over events (a two-tier design) fits about 13 times more events into the same context window than one position per field token.

![Two designs in the same 4,096 position context window. A flat design uses one position per field token and fits about 315 events. A two tier design encodes each event into one vector, then attends over events, and fits about 4,000 events.](/sdgm/_fern-files/_img/68399bd6a538e363377798a264b436abd039e0632f4b33f32e137c860369c614.webp)

## What the Kit Provides

* Every recipe tests one question: does adding the embedding to raw features beat XGBoost on raw features alone? Reported metrics are ROC-AUC, PR-AUC, precision\@k, recall\@k and calibration error.
* Evaluation guards against leakage with temporal splits, a tokenizer fit on training data only, histories and labels cut at each prediction time, and evaluation customers that never appear in training.
* A token cache tokenizes your data once and pretraining reads it from disk, so training can cover your whole book.
* Runs scale from a CPU smoke test on generated data to one GPU to larger size presets.
* Embeddings are frozen by default. Optional LoRA fine-tuning is reported alongside the frozen results, never in place of them.
* Each run writes its configuration, data checks, splits, metrics and a model card.

In the kit's own measurements, the tokenize-and-cache build is 4.5x faster than its first version with byte-identical output, and it holds memory flat at 0.45 GB over a book 8x larger. The event-attention kernel is up to 16.3x faster than FlashAttention varlen (8.4x without length bucketing), measured on H100 NVL.

### Recorded Results

These are internal results on one synthetic book (10,000 users, one GPU, three seeds). They are not a production, fraud or credit claim. All changes are relative (percent improvement in PR-AUC over raw-feature XGBoost, not percentage points). The frozen embedding changed PR-AUC by +20% on 6-month churn, +7% on 12-month default and +1% on LTV. With LoRA fine-tuning, the change reached +38% on churn and +34% on per-transaction fraud. The frozen embedding was inconclusive on spliced fraud, and hand-built history aggregates still outperform the embedding on every task.

## Adding Graph Signal

A sequence model sees one customer at a time. Patterns such as fraud rings span customers through shared counterparties, merchants or devices. Graph context connects a customer's history to those relationships.

The planned workflow combines a graph encoder with a transaction sequence encoder. The graph encoder summarizes a customer's neighborhood, and the sequence encoder combines that summary with the customer's event history. The reference recipe samples graph context in memory and uses Kumo Engine to run the graph neural network.

1. **Automatic graph context.** The recipe builds graph context from transactions and transfers, samples each customer's neighborhood at the prediction cutoff, and aligns it with that customer's event history. Relationships such as shared devices or merchants require a data adapter that includes them.
2. **Train the graph encoder.** Train a graph neural network (GNN) to detect whether any fraud occurs in the retained history, using labels available by the prediction cutoff. Alternatively, pretrain without task labels using `FutureSubgraph`. For pretraining, the encoder reads the historical graph at time `t` and predicts neighborhood counts and amount aggregates over a later window. Future data supplies training targets only. Use complete target windows, account for data availability delays and fit target normalization on training windows only. Select the encoder using a separate validation set.
3. **Combine graph context with event history.** Freeze the selected graph encoder. Project its customer embedding into a profile slot before profile encoding. The reference recipe uses this slot for graph context and leaves customer profile attributes unused. Pass that representation and the encoded events into a sequence encoder that reads the history using causal attention. Train the sequence encoder, the graph embedding projection and a binary prediction head while keeping the graph encoder fixed.
4. **Evaluate the value of graph context.** Compare the combined model with a graph-only model and a sequence-only model. Use the same labels, data splits and scored customers for each comparison. Evaluate embeddings both alone and alongside your existing features, and measure prediction quality, latency and memory use.

The workflow enforces prediction-time boundaries using the timestamps supplied with your data. It rejects graph nodes and relationships available after the cutoff, checks that graph context and event histories use matching customers and cutoffs, and validates label availability. Future pretraining targets stay separate from encoder inputs, and learned preprocessing is fitted on training data.

The planned recipe uses [Kumo Engine](https://docs.nvidia.com/sdgm/kumo-engine/get-started-with-kumo-engine/overview)'s PyTorch API for data loading, including subgraphs and sequences, and its KumoGNN architecture to encode graph context.

## Kumo Engine as the Data Loader for TxFM Training

Pretraining a TxFM is largely a data-loading problem. Building one object per event takes about 7.7 GB of memory per 1,000 users. [Kumo Engine](https://docs.nvidia.com/sdgm/kumo-engine/get-started-with-kumo-engine/overview) is NVIDIA's open source library for generating training context from structured data, and it handles this step.

* **Data connectors.** Kumo Engine reads local Parquet, Snowflake and Databricks, so you need no separate export step before training. [Connect your data](https://docs.nvidia.com/sdgm/kumo-engine/user-code-guide/connect-your-data-linux)
* **Throughput.** A Rust engine moves data from NVMe storage to the GPU. The [benchmarks](https://docs.nvidia.com/sdgm/kumo-engine/resources/benchmarks) give measured throughput and conditions. They are general ML workloads, not TxFM measurements.
* **Scale.** A compressed on-disk graph layout (2.4 bytes per key) supports datasets about 10x larger than RAM-resident systems can hold, so pretraining can use the whole book. [Infrastructure scaling](https://docs.nvidia.com/sdgm/kumo-engine/resources/infrastructure-scaling)
* **Time-correct sampling.** Anchor-time sampling with built-in leakage detection ends each history at the prediction time. [Leakage FAQ](https://docs.nvidia.com/sdgm/kumo-engine/faq/kumo-engine/time-data-leakage/what-mechanisms-does-kumo-provide-to-detect-data-leakage)
* **One loader for sequences and graphs.** A single dataloader can emit graphs, sequences and aggregations with the same sampler settings for training and scoring. A sequence TxFM and a relational model can share one data layer with less train and serve skew, and it gives a route to cross-record signals, such as money laundering patterns, that a history-only model cannot see. [Large-scale graph learning](https://docs.nvidia.com/sdgm/how-distributed-training-works)

Kumo Engine is open source: `pip install kumo-engine`. It runs on Linux, macOS and Windows (WSL2), with production on Linux using NVMe storage and an NVIDIA GPU. [Get started](https://docs.nvidia.com/sdgm/kumo-engine/get-started-with-kumo-engine/overview)

## Get Started

Kumo Transaction is a reference architecture for education and solution design. It is not a production fraud decisioning or model serving system. Contact your NVIDIA team for access to the kit, documentation and sample notebooks.

### Run a Smoke Test

The kit needs Python 3.12 or later and [uv](https://docs.astral.sh/uv/). From the kit's root directory, install the dependencies and run a smoke test. The smoke test uses generated data on a CPU and takes about a minute, so you can confirm your environment before you bring any data.

```bash
uv sync --extra dev
uv run tfm smoke --recipe blueprint_v1
```

The kit ships three reference recipes, and every recipe asks the same baseline question described above:

* `blueprint_v1` is NVIDIA's TxFM Blueprint on public TabFormer card data, with flat field tokens and a causal decoder.
* `pragma_like` is a PRAGMA-style stack with bidirectional profile, event and history encoders.
* `blueprint_v2` uses PRAGMA's encoders under a causal history decoder. It runs on the same rows and tasks as `pragma_like`, so you can compare the two directly.

To work through the recipes step by step, install the notebook extras and open a notebook series:

```bash
uv sync --extra notebooks
uv run jupyter notebook notebooks/blueprint_v1/   # the v1 Blueprint, step by step
uv run jupyter notebook notebooks/pragmatiq/      # PRAGMA-like and Blueprint v2
```

Full-size runs need a local dataset and, at reference size, a GPU. Each recipe's README lists its commands and how to get its dataset.

### Compose a Model

A model is one choice in each slot. The kit refuses pairings that would leak future information or cannot learn. This example composes a causal decoder of depth 2 over flat field tokens, with a binary fraud head:

```python
from tfm import TrxFM, Flat, Decoder, NoPE, EagerAttention, LastTokenPool, NextEvent, Binary

model = TrxFM(
    granularity=Flat(Decoder(depth=2, mask="causal")),
    position=NoPE(),
    attention=EagerAttention(),
    objective=NextEvent(),
    readout=LastTokenPool(),
    heads={"fraud": Binary()},
)
```

A recipe's YAML file is a serialization of this API. The hierarchical stacks are experimental and import from `tfm.experimental`.

### Next Steps

A first result on your own data follows these steps:

1. Point the kit at your event, profile and label tables, or write a small adapter for your own schema.
2. Tokenize the data once and cache it so pretraining can read the whole book from disk.
3. Pretrain at the size your hardware allows, from one GPU up to multi-GPU.
4. Evaluate against your baseline with and without the embedding, and review the generated model card.
5. Optionally fine-tune with LoRA for the tasks that matter most.