Subscribe to get high-signal insights on how modern fintech is built.

ai & ml

Why Your Fraud Model Needs to Decide in 45 Milliseconds

Your fraud model took three weeks to train, and the payment network gives it 45 milliseconds to decide.

By Alex Kugell ·

You've spent three weeks training a fraud model. Terabytes of transaction history, 94% recall on the test set. Now a card gets tapped at a coffee shop, and your model has 45 milliseconds to decide whether the transaction is legitimate.

Forty-five milliseconds. Less than half the time it takes to blink.

The obvious explanation is that fraud happens fast, so the model needs to be fast. But fraud doesn't happen in 45 milliseconds. A stolen card number gets used over days or weeks. The speed constraint comes from the payment network.

Where the milliseconds go

When you tap a card, the payment terminal sends an authorization request through the card network to the issuing bank. The bank runs a fraud check, makes an approve-or-decline decision, and sends the response back. That entire round trip, from tap to terminal beep, takes well under a second.

Merchants expect the full authorization round trip in under 200 milliseconds. That's your budget. Start spending it.

Network transit takes roughly 10 to 15 milliseconds. The transaction travels from the merchant's terminal through the payment processor to the issuer's systems, limited by geography and the speed of light.

Feature retrieval takes another 5 to 10 milliseconds. Your model needs context about this specific cardholder, like how often they shop here and what their average transaction amount looks like over the last 30 days. Those values have to come from a low-latency store, pre-calculated and waiting.

After rules evaluation, response serialization, and safety margins, your model gets maybe 10 to 25 milliseconds for inference. That's the window everything has to fit inside.

Authorization Latency Budget
0ms200ms
Network (in)
12ms
Feature retrieval
8ms
Model inference
15ms
Rules + response
25ms
Network (out)
12ms
Your fraud model gets ~15ms of a ~200ms budget. XGBoost fits in 1–5ms. A transformer needs tens to hundreds.

Why nobody runs a transformer in the hot path

An XGBoost model scores a transaction in roughly 1 to 5 milliseconds on a single CPU core. No GPU required. Visa's fraud scoring system, Advanced Authorization, processes each transaction in about one millisecond. The network has been running neural networks optimized for this constraint since 1993.

A transformer-based model needs tens to hundreds of milliseconds, and it typically needs a GPU. That alone can exceed the fraud model's entire inference window.

So the budget picks your architecture before you write a line of training code. Gradient-boosted trees dominate production fraud scoring because they fit inside the clock. A recent benchmark found GBDTs outperform LLM-based scorers by roughly 8,000 to 1 on latency in the payment authorization path. Deep learning works for offline fraud analysis, but the hot path doesn't have room for it.

A restaurant with a 90-second ticket window works the same way. The menu isn't limited by what the kitchen could make. A two-hour braise might taste better, but it can't hit the plate before the ticket expires.

The feature problem is worse than the model problem

Your model's inference takes 2 milliseconds. But the features it needs have to be ready before inference starts.

During training, you compute "average transaction amount over 30 days" from a data warehouse query. It takes four seconds, perfectly accurate, but in production you need that same number in 5 milliseconds, and no warehouse query runs that fast.

So you precompute. A feature store holds pre-calculated values in a low-latency cache, usually Redis or a similar store. When a transaction arrives, you look up the features instead of computing them. Feature stores like Feast and Tecton exist specifically because this problem is universal in real-time ML.

But precomputation creates its own failure mode. You now have two implementations of the same feature: the warehouse version you trained on and the cached version you serve with. Different code paths running against different data sources, occasionally with different rounding. They drift apart, and your model's accuracy in production silently degrades because the features it sees at inference don't match what it learned from.

This training-serving skew is where most production fraud systems quietly break, even when the model itself works exactly as designed.

Forty-five milliseconds picks your architecture

Visa processes over 65,000 transactions per second at peak capacity. Each one gets a fraud decision inside that narrow window. Forty-five milliseconds picks your model, forces precomputation over on-the-fly feature engineering, and explains why your training cluster and your serving stack look nothing alike.

Sources

Frequently Asked Questions

Why do fraud detection models need to return a score in milliseconds?
Card payment networks expect the full authorization round trip in under 200 milliseconds. After network transit, feature retrieval, and rule evaluation consume their share, the fraud model typically gets 10 to 25 milliseconds to score a transaction. The latency constraint comes from the payment infrastructure, not the speed of fraud itself.
How fast can XGBoost score a fraud transaction compared to a transformer model?
XGBoost scores a single transaction in roughly 1 to 5 milliseconds on a CPU, while transformer-based models need tens to hundreds of milliseconds on a GPU. Visa's Advanced Authorization system scores transactions in about one millisecond. The gap means gradient-boosted trees dominate production fraud scoring because they fit inside the payment network's latency budget.
Why do gradient boosted trees beat deep learning for real-time fraud detection?
Production fraud scoring operates inside a 10 to 25 millisecond inference window carved from the card authorization budget. Gradient-boosted trees fit inside that window on commodity CPU hardware, while transformer models exceed it even on GPUs. A benchmark comparing GBDTs to LLM-based scorers found an 8,000 to 1 latency difference on the payment authorization path.
What causes fraud detection models to lose accuracy in production?
Training-serving skew is a common cause. Features like average transaction amount get computed from warehouse queries during training but pulled from precomputed caches during serving. Different code paths and data sources cause the values to drift apart, so the model sees slightly different inputs in production than it learned from, silently degrading its accuracy even when the model itself works as designed.
How does a feature store reduce latency in fraud detection?
A feature store precomputes values like transaction velocity and spending averages, then holds them in a low-latency cache. When a transaction arrives, the fraud model looks up precomputed features in 5 to 10 milliseconds instead of running warehouse queries that take seconds. Feature stores also keep training and serving features consistent, reducing the skew that degrades production accuracy.

Built by Trio, a fintech-native engineering partner helping teams build the next generation of financial technology and infrastructure.

Subscribe to Ledger Drift for high-signal insights into how modern fintech is built, from systems to code to teams.

Keep reading

engineeringWhat Happens When a Lending Pipeline Drops an EventLending pipelines span days, and every dropped event becomes a compliance gap that hides until the next audit.
analysisAfrican Fintech: The PlumbingAfrican fintechs process billions across five payment rails but still reconcile with spreadsheets, and the failure modes in the plumbing underneath are specific.
engineeringWhen Your Ledger Becomes an Agent's APIAuthentication tells the ledger who the agent is, but nothing in the standard API surface tells it what that agent is allowed to do.
View more ›