TFMLab
0:00 / 0:00

One model, three products #fintech#embeddings#multi-task

19 Oct 2026Beginner0:46

See how a single transaction foundation model turns a business's transaction history into one embedding that powers fraud, cash-flow and credit decisions.

A business-banking fintech (the brief mentions Mercury) sees card swipes, ACH, wires, payroll and invoices for each customer. This lab shows a generic setup, not any company's actual system. A Transaction foundation model (TFM) reads the whole history once and produces an embedding: a compact summary of how this business behaves. Three small heads read that same vector: one flags unusual payments, one forecasts cash flow, one sizes a credit line. Because the expensive work is shared, a new product only needs a new light head. All scores and values on screen are illustrative.

Transcript

A card's two hundred and fifty-six payments, read in order, into one point.

Inside those payments hide two hundred and fifty-five free lessons. Nobody labelled a single one. Each payment points to the next one. And that next payment is the answer.

By the end, you'll know what this model is, how it teaches itself, and the one test it still fails.

Meet Maya, a made-up cardholder. Her bank keeps her payments as rows in a table. A transaction foundation model puts them back in time order, and reads them like words in a sentence. Between payments, time passes: thirteen hours here, twenty-eight there. The gaps are part of the story too.

Beside the payments sits a profile that rarely changes, like how long the account has been open. That is all it sees. No rules written by hand.

First, every payment becomes numbers. The amount, the merchant, the hour: each becomes a token, one piece of a payment the model reads.

Amounts fall into price buckets. How those buckets are cut is the next film.

Then one encoder, the part that reads a whole history, takes in her payments and her profile together. Out comes an embedding: a fingerprint of how Maya spends, written as a short list of numbers. Here, two hundred and fifty-six.

Inside is a stack of layers. One kind reads across a payment’s fields; another reads back across her history.

So how does it learn with no labels? It takes a window of her payments, here two hundred and fifty-six.

At every payment, it guesses the next one. Then it is shown the payment that came next.

It may only look back. The future stays hidden, just as it is when a real payment arrives.

Each guess is checked field by field: the merchant, the amount, the hour. Every miss nudges the encoder a little.

Only the last payment has no next one. So two hundred and fifty-six payments give two hundred and fifty-five lessons. And every new payment, on every card, is one more lesson.

Then the guessing part is dropped. What stays is the encoder, now practised at reading card histories.

Run every customer through it, and each fingerprint becomes a point, squeezed here into three dimensions.

Customers with similar habits land close together. Nobody told the model what a commuter or a family shopper is.

So distance becomes a tool. The points nearest one customer are its look-alikes, found with no rule written.

And when someone else starts using Maya’s card, her point jumps away from where she usually sits.

To use it, a bank adds a head on top: a small add-on for one job. Fraud, credit, or customers about to leave. That is the idea behind the word foundation: one encoder underneath, many small heads on top.

So why build one? Banks already have strong models. But those models read the table, not the story.

The model to beat is a decision tree: a chain of yes-or-no questions that people wrote. Three times her usual amount? At a new merchant? Fraud. XGBoost, the industry favourite, adds up many such trees. Each question needs a feature someone built by hand.

Tuned trees are hard to beat. In 2022, Grinsztajn and colleagues found them still ahead of neural networks, models like this one, on tables. That held across forty-five datasets. So a model that reads the story must pass two tests.

Test one: does it read sequences well? Recommendation: four public datasets of what people watch or buy next. The score: how often the real next item is in the top ten guesses. The rival is a 2026 preprint’s best transformer. Our TFM scores eighteen to a hundred and fifty-three percent higher. Part of that is a different training target, called the loss. With the preprint’s own loss, the gains are three to sixty-nine percent. Test two: payments. Fraud, on IBM’s public, synthetic card data, tested on a later year. The score nears one when frauds rank first, with few false alarms. NVIDIA and Intel report point nine zero and point nine four with their own models, on their own test periods. The tree to beat, our tuned XGBoost, scores point nine four two. First, the TFM on its own, fine-tuned: trained a little further on fraud labels. Point seven three six. Well below the tree. That is the test it still fails. But its fingerprints help a plain neural network edge past the tree: point nine seven four. The same network alone scores point nine seven one. So most of the gain is the network’s; the embeddings add on top.

Card networks and banks report building them: Mastercard, says a news report; Nubank, on its blog; Revolut and Visa Research, in preprints.

To recap: it reads payments in order, teaches itself by guessing the next one, and on its own, does not yet beat the tree.

But it reads only whole numbers. So how does Maya’s four-dollar-fifty coffee become one? Next: four fifty and four sixty are the same number.

In code (PyTorch)

emb = tfm(history)            # [B, d], computed once
fraud = fraud_head(emb).sigmoid()
cash  = cash_head(emb)        # next-30-day net flow
credit = credit_head(emb).softmax(-1)