StripeRyan DrapeauProblem & solution
Scaling Radar: Fighting fraud with agent-assisted machine learning
Summary
Stripe Radar’s Shield model detects transaction fraud using network-wide signals. To improve recall, Stripe expanded training from roughly 800 million to 11 billion transactions, requiring optimizations that cut each epoch from 24 to 4.8 hours through streaming data loading, torch.compile, lower-precision arithmetic, concurrent execution of ResNeXt branches, and memory reductions. The larger dataset initially improved performance, but delayed fraud reports caused label immaturity, forcing a rollback because the model learned late-reported fraud as legitimate. Stripe built Agentic MLE, enabling AI agents to autonomously investigate failures, implement features, train models, and evaluate results using model explanations and prior experiment data. Using these agents, Stripe identified a training configuration change combining stochastic weight averaging at epoch 0 and shortening training to eight epochs, improving Shield’s recall by over 8% and estimating tens of millions in additional fraud prevention annually.
Context
Stripe’s fraud prevention system Radar uses machine learning to block fraudulent transactions while allowing legitimate ones. The Shield model detects transaction fraud using network-wide signals such as card history and IP address links. This post details efforts to scale Shield’s training data and automate the experiment lifecycle with AI agents.
Approach / What changed
Stripe expanded Shield’s training set from 800 million to 11 billion transactions and optimized training infrastructure to reduce epoch time from 24 to 4.8 hours through streaming data loading, torch.compile, lower-precision arithmetic, concurrent execution of ResNeXt branches, and memory reductions. They built Agentic MLE, a set of tools enabling AI agents to autonomously investigate failures, implement features, train models, and evaluate results using model explanations and prior experiment data. Agents identified a training configuration change combining stochastic weight averaging at epoch 0 and shortening training to eight epochs, improving recall by over 8%.
Takeaways
Expanding training data from 800 million to 11 billion transactions required infrastructure optimizations including streaming data loading, torch.compile, lower-precision arithmetic, concurrent execution of ResNeXt branches, and memory reductions from 1.3 TB to 500 GB, cutting epoch time from 24 to 4.8 hours.
Label immaturity from delayed fraud reports caused the larger model to initially appear better but later perform worse, forcing a rollback because it learned late-reported fraud as legitimate.
Agentic MLE enabled AI agents to autonomously run experiments, leading to a training configuration change (stochastic weight averaging at epoch 0 and shorter training) that improved Shield’s recall by over 8%.
FAQ
Why did the larger model initially look better but then perform worse?
The larger model trained on more data including late-reported fraud labeled as legitimate, causing it to learn those patterns as legitimate. As more fraud reports arrived, its measured performance fell below the earlier model's, requiring a rollback.
How did Stripe reduce training epoch time from 24 to 4.8 hours?
They streamed data from S3 instead of downloading to disk, used torch.compile, lower-precision arithmetic, concurrent execution of ResNeXt branches, reduced memory from 1.3 TB to 500 GB, compressed gradients to BF16, and tuned communication bucket size.
What improvement did Agentic MLE achieve?
Agents identified a training configuration combining stochastic weight averaging at epoch 0 and shortening training to eight epochs, which improved Shield's recall by over 8%, translating to tens of millions in additional fraud prevention annually.
Source and freshness
- Source
- stripe.dev
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.