Finance / Digital bank
Nubank: Improving the operating cost of real-time fraud detection
- Company
- Nubank
- Country
- Brazil
- Adoption stage
- In operation
- Source published
- Date basis
- The date the source was published. It can differ from the date adoption started.
- How the source was checked
- Read the full source text
The work problem
Nubank watches transactions from millions of customers. A batch model gathers large amounts of data and produces predictions the next day. If someone steals a credit card and tries to pay, the batch model only catches it the next day, after the damage is done. In fraud detection, a delay of even a few seconds means missing a transaction that could have been stopped.
Technology and data
Nubank put real-time models on Model Server. It is a structure combining a Clojure layer that connects to internal systems and a Python layer that runs the models. The Clojure layer handles authentication, security and logging, and the Python layer does inference only. Short-term features such as transactions in the last 24 hours are computed in real time and held in a hot database, while long-term features such as transactions over the last 90 days are pre-computed in batch and served from a feature store. Not every event goes into the model. Pre-policy rules filter out low-risk events first. A new model is first run in shadow mode, where it processes real data but does not affect decisions that reach customers.
Results
Nubank said it reduced the transactions the model processes in fraud detection from 2,800 per second to 20 per second. It explained that changing from shard-by-shard deployment to a global deployment where one pod group handles all shards lowered infrastructure cost by up to 30 percent and improved stability. In shadow mode it checks in advance whether SLAs such as 700ms for PIX transactions are met.
Limits and open questions
The 30 percent is an infrastructure cost saving, not a reduction in fraud losses. The source does not disclose how detection accuracy changed.
Sources
- Practices to scale Machine Learning operations - Building Nubankbuilding.nubank.com, Accessed
Compiled from public sources. These are not results from ATF Works customers.