Logo
All posts

How Stripe detects payment fraud in 100 milliseconds - AI Engineering Case Study #1

In this blog we will see how Stripe's fraud model makes accurate decisions with low latency and at scale.

Gaurav Sen/12 min read

Stripe processes 100s of millions of transactions everyday. During their biggest event (Black Friday and Cyber Monday), the rate can go up to 2000 transactions per second![2]

Each payment must be checked for fraud before confirmation. A check at this scale brings unique problems:

  1. Fraud is rare, on the order of 1 in every 1,000 payments.[1]
  2. Blocking a good payment loses the business a sale.
  3. The decision has to be made in less than 100 milliseconds, while the buyer waits.

In this blog we will see how Stripe's fraud model makes accurate decisions with low latency and at scale.

1. How Radar reads a payment

What does a fraud check look at? A payment carries details: where it came from, when it was made, the amount and the currency. Stripe's fraud check, Radar, reads more than 1,000 such characteristics before it decides.

At this scale, detecting fraud is essential.

How does one model read 1,000 characteristics in under 100 milliseconds? Since mid-2022, Radar's model has been a single deep neural network, built from branches.

The basic idea is to look at the different features of a transaction, process them in parallel, and aggregate it to a final output.

A card holds one transaction, t1: location Mumbai, time 02-01-2025, amount 300, currency usd. The card splits into its four fields, each beside its own branch, a small network of circles. A column on the right sums the four branch outputs into one.
A card holds one transaction, t1: location Mumbai, time 02-01-2025, amount 300, currency usd. The card splits into its four fields, each beside its own branch, a small network of circles. A column on the right sums the four branch outputs into one.

The design is inspired by ResNeXt, a network for classifying images from 2016.[3] It splits a computation into branches, and each branch is a small network.

The outputs of the branches are summed into one final output. The drawing sends one field down each branch, to show the idea. Stripe hasn't said which features each branch reads.

I explained this design in a one-minute reel.

2. Two ways to be wrong

What does Radar do with that output? It gives each payment a score, the likelihood that it's fraud.

A payment with a low score goes through. A risky one is blocked, or sent to an extra security check.

So the check can fail in two ways. It can let a fraudulent payment through, or it can block a good one. A good payment that gets blocked is called a false positive.

With this, Stripe is able to block fraudulent transactions while keeping the error rate down to 0.1%.

That 0.1% counts false positives. Out of the billions of good payments made on Stripe, Radar blocks 0.1% by mistake.

Could a bigger network be more accurate? A deeper one learns more patterns, like payment velocity or unusual volume on a card.

But a network that is too deep memorises random noise in the features, and gets new payments wrong. That is overfitting. Stripe found that adding branches improved accuracy more than adding depth or width.

3. Why Stripe dropped XGBoost

What did the branches replace? Until mid-2022, Radar ran two models together. One was XGBoost, a set of decision trees, and the other was a deep neural network.

XGBoost memorised patterns, and the neural network generalised from them. The pair worked well, but it was slow to retrain. Stripe says an XGBoost model "is not very parallelizable".

Could Stripe just remove XGBoost? Not for free. The model would have caught 1.5% less of the fraud, a drop in what is called recall.

Stripe called that "an unacceptably large regression".

So the branches were built to add back the memorising that XGBoost had done.

With XGBoost gone, the time to train the model fell by over 85%, to less than two hours. Experiments that ran late into the night now finished several times in a working day.

Faster training made more data affordable. Each increase in training data improved Radar a lot, which hadn't been the case with XGBoost.

4. Training on 11 billion payments

How much history can the model learn from? In October 2026, Stripe wrote about Shield, the Radar model that scores transaction fraud.[4] Its training set held about 800 million transactions.

That was a fraction of the history. For each week, Stripe kept every known fraudulent payment and a random sample of the rest. This sampling, called downsampling, keeps training fast.

Stripe removed the downsampling and trained on every eligible payment from nine months: 11 billion transactions. By the third pass over the data, the new model beat the old one on the first evaluation.

But one pass, an epoch, took about 24 hours.

Hours per training epoch on the same 11 billion payments, after four stages. The starting point: 24 hours. Streaming from S3 into memory: 12 hours. Compiling and running the branches in parallel: 7 hours. Moving data better: 4.8 hours.
Hours per training epoch on the same 11 billion payments, after four stages. The starting point: 24 hours. Streaming from S3 into memory: 12 hours. Compiling and running the branches in parallel: 7 hours. Moving data better: 4.8 hours.

Stripe cut it in three steps. Streaming the data from S3 straight into memory halved it to 12 hours. Compiling the training step, using lower precision and running the ResNeXt branches at the same time brought it to 7.

Then Stripe cut peak memory from 1.3 TB to 500 GB, and compressed what the GPUs send each other. An epoch took 4.8 hours.

The model grew to about 30 million parameters, three times its old size. Its serving latency didn't go up, in load tests or in production.

5. Labels that arrive weeks later

Did the bigger model catch more fraud? At first it looked better. As more fraud reports arrived, it fell below the old model, and Stripe rolled it back.

A stolen card can be used for weeks before its owner notices and reports it. Only then does Stripe learn that a payment it scored weeks earlier was fraud.

The share of fraud reports received, by days since the payment: 41% by day 14, 66% by day 30 and 86% by day 60.
The share of fraud reports received, by days since the payment: 41% by day 14, 66% by day 30 and 86% by day 60.

By day 14, only 41% of the fraud reports have arrived. So the newest weeks of training data held fraud that was still marked legitimate.

Downsampling had kept most of those payments out. Removing it let in about 20 times more fraud marked as legitimate. The model learned that fraud reported late looked safe.

6. Agents that run the experiments

How did Stripe find that late reports were the cause? It took repeated experiments, and each one goes round the same loop.

The ML experiment loop: explore data, prototype features, compute training data, train and evaluate, deploy the model, and back to exploring the data.
The ML experiment loop: explore data, prototype features, compute training data, train and evaluate, deploy the model, and back to exploring the data.

Every turn of the loop costs engineering time: preparing data, watching training jobs and debugging failed runs. So Stripe built Agentic MLE, short for machine learning engineer. It is a set of tools and instructions that lets AI agents carry an experiment from an idea to a result.

The agents work inside Stripe's own ML infrastructure. Engineers review the hypotheses and the results, and decide what to deploy.

Stripe put it on a fraud attack that Shield was scoring as low risk. An agent used model explanations to find which features pushed those scores down.

Those explanations gave ideas to test, and humans helped prioritise 38 of them. The agents implemented them and trained the models. They debugged the failed runs and evaluated the results.

Several agents proposed a change to how Shield averaged its weights. Shield averaged snapshots of its parameters from the second half of each training run. The best result averaged from the first epoch, and stopped the run at eight epochs.

That raised recall by over 8%. Stripe estimates it at tens of millions of dollars a year in fraud stopped for its merchants.

Summary

  1. Radar reads more than 1,000 characteristics of a payment and decides in less than 100 milliseconds.
  2. It blocks 0.1% of good payments by mistake.
  3. Since mid-2022, its model is one deep neural network of branches, inspired by ResNeXt. The outputs of the branches are summed.
  4. Removing XGBoost cut the time to train by over 85%, to less than two hours.
  5. Trained on 11 billion payments, an epoch took 24 hours. Stripe cut it to 4.8 hours.
  6. Fraud reports arrive late: 41% by day 14, 86% by day 60. The newest training data carries fraud marked legitimate.
  7. Agentic MLE lets AI agents run Stripe's ML experiments. One change they tested raised recall by over 8%.

Sources

  1. How we built it: Stripe Radar, Ryan Drapeau, Stripe, 29 March 2023.
  2. Businesses processed more than $31 billion on Stripe from Black Friday through Cyber Monday, Stripe newsroom, 3 December 2024.
  3. Aggregated Residual Transformations for Deep Neural Networks, Saining Xie and others, 2016.
  4. Scaling Radar: Fighting fraud with agent-assisted machine learning, Ryan Drapeau and Sai Samant, Stripe, 19 October 2026.
  5. This is how Stripe Detects Payment Fraud in 100 milliseconds, Gaurav Sen, YouTube, 2 January 2025.
WhatsApp