Skip to main content

Real architecture · Staff

nuFormer: transaction foundation model for credit and fraud

Swaps "one model per problem" for "one backbone and several heads" in a regulated sector, with transformer latency at stake.

18 min read · Source: Nubank · Content reviewed on October 23, 2026

Short answer

Swaps "one model per problem" for "one backbone and several heads" in a regulated sector, with transformer latency at stake. A bank accumulates large volumes of data (transactions, in-app events, customer interactions), but extracting value from them remains hard. Because they are sequential and loosely structured, these data have historically led teams to tabular models built on hand-crafted features.

01 · CONTEXT

Plenty of data, value hard to extract

A bank accumulates large volumes of data (transactions, in-app events, customer interactions), but extracting value from them remains hard. Because they are sequential and loosely structured, these data have historically led teams to tabular models built on hand-crafted features. This is the classic starting point of ML systems design at Nubank.

According to one of Nubank's researchers, using traditional models means building an entire engineering pipeline to extract value from the data, and this requires people with deep domain knowledge working the data by hand. This dependence makes the process less scalable and more expensive as volume and complexity grow.

02 · FROM A MODEL PER PROBLEM TO A BACKBONE

A shared foundation for many applications

nuFormer is a foundation model developed by Nubank's AI Core team to learn representations of financial data at scale. The goal is not to solve a single problem, but to build a reusable foundation for different applications across the bank.

  1. The raw data goes through a pipeline of hand-crafted feature engineering.

    Architecture diagram: nuFormer: one model per problem
    DBTransaction history
    CPManual feature engineeringhand-crafted features
    CPCredit model
    CPFraud model
  2. Without a foundation model, each problem requires a model trained from scratch.

    Architecture diagram: nuFormer: one model per problem
    DBTransaction history
    CPManual feature engineering
    CPCredit modelone model
    CPFraud modelanother model
  3. This work depends on domain experts who manipulate the data by hand, which becomes more expensive and less scalable as volume and complexity grow.

    Architecture diagram: nuFormer: one model per problem
    DBTransaction history
    CPManual feature engineeringcost and scale
    CPCredit model
    CPFraud model

The alternative is what the blog describes: instead of training a model from scratch for each problem, nuFormer learns a representation of financial behavior that can be reused across many contexts, giving applications a shared starting point.

  1. Transactions are converted into sequences of tokens.

    Architecture diagram: nuFormer: a reusable backbone
    DBTransaction history
    CPTransaction tokenizationtokens
    CPSelf-supervised training
    CPnuFormer backbone
    CPFine-tuning: credit and loans
    CPFine-tuning: fraud
    CPFine-tuning: recommendation
    CPFine-tuning: income and cross-selling
  2. A transformer, with self-supervised learning, builds representations directly from the raw data.

    Architecture diagram: nuFormer: a reusable backbone
    DBTransaction history
    CPTransaction tokenization
    CPSelf-supervised trainingself-supervision
    CPnuFormer backbone
    CPFine-tuning: credit and loans
    CPFine-tuning: fraud
    CPFine-tuning: recommendation
    CPFine-tuning: income and cross-selling
  3. The result is a representation of financial behavior that can be reused across many contexts.

    Architecture diagram: nuFormer: a reusable backbone
    DBTransaction history
    CPTransaction tokenization
    CPSelf-supervised training
    CPnuFormer backboneshared foundation
    CPFine-tuning: credit and loans
    CPFine-tuning: fraud
    CPFine-tuning: recommendation
    CPFine-tuning: income and cross-selling
  4. On top of this foundation, the model allows fine-tuning for tasks such as credit, fraud detection, and product recommendation.

    Architecture diagram: nuFormer: a reusable backbone
    DBTransaction history
    CPTransaction tokenization
    CPSelf-supervised training
    CPnuFormer backbone
    CPFine-tuning: credit and loansnew
    CPFine-tuning: fraudnew
    CPFine-tuning: recommendationnew
    CPFine-tuning: income and cross-selling
  5. Among the uses already in place, the blog cites credit, loans, income prediction, and cross-selling.

    Architecture diagram: nuFormer: a reusable backbone
    DBTransaction history
    CPTransaction tokenization
    CPSelf-supervised training
    CPnuFormer backbone
    CPFine-tuning: credit and loans
    CPFine-tuning: fraud
    CPFine-tuning: recommendation
    CPFine-tuning: income and cross-selling
AspectoTabular model per problemnuFormer backbone
Model inputHand-crafted featuresTransaction sequences in token form
Starting point of each applicationA model trained from scratch for each problemA representation reusable across contexts
Who supports the workPeople with deep domain knowledge working the data by handData pipelines, evaluation, and training infrastructure at scale

03 · TRANSACTIONS AS LANGUAGE

Treating the history as a sequence

The paradigm shift is in how the data is viewed. Instead of treating transactions as isolated records, the idea is to interpret them as sequences with structure, context, and meaning, and converting these sequences into tokens makes it possible to capture deeper behavioral patterns.

The work combines Transformer architectures with self-supervised learning to build representations directly from the raw data. nuFormer mixes structured and textual transaction attributes and allows fine-tuning for tasks such as credit scoring, fraud detection, and product recommendation.

The work started with transactions, and the team's current vision is multimodal: also integrating behavioral signals, in-app interactions, and other sources of information.

04 · FROM TRAINING TO PRODUCTION

A systems problem, not just an ML one

According to the blog, the biggest challenge is not the model itself, but the engineering needed to make it work. This includes pipelines, GPUs, and distributed training, but also the production stage, where regulatory governance comes into play.

  1. Training requires well-structured pipelines, GPU management, and distributed training.

    Architecture diagram: nuFormer: from training to production
    CPDistributed GPU trainingGPUs and pipelines
    CPGovernance validation
    CPInference service
    CLBank products
    NWContinuous monitoring
  2. In the financial sector, the model goes through several rounds of validation before going to production, to meet regulation and internal standards.

    Architecture diagram: nuFormer: from training to production
    CPDistributed GPU training
    CPGovernance validationseveral rounds
    CPInference service
    CLBank products
    NWContinuous monitoring
  3. At inference time, Transformer-based models tend to have higher latency, a sensitive factor in financial applications.

    Architecture diagram: nuFormer: from training to production
    CPDistributed GPU training
    CPGovernance validation
    CPInference servicesensitive latency
    CLBank products
    NWContinuous monitoring
  4. With specialized infrastructure and teams, it is possible to reach performance levels comparable to those of traditional models.

    Architecture diagram: nuFormer: from training to production
    CPDistributed GPU training
    CPGovernance validation
    CPInference servicecomparable performance
    CLBank products
    NWContinuous monitoring
  5. Ensuring that the model learns correctly remains among the biggest challenges, and requires continuous monitoring and metrics aligned with business impact.

    Architecture diagram: nuFormer: from training to production
    CPDistributed GPU training
    CPGovernance validation
    CPInference service
    CLBank products
    NWContinuous monitoringmonitoramento

05 · RESULTS AND LIMITS OF THE SOURCE

What Nubank says it achieved

The blog states that bringing these models to existing systems delivered significant gains in key metrics within a few months, surpassing improvements accumulated over years with traditional approaches. The model is already applied to credit, loans, income prediction, and cross-selling.

In Nubank's earnings release, the latest generation of nuFormer quadrupled context length, training speed, and inference speed, and reduced the cost of running models in production. The model is in production in three portfolios: credit cards in Brazil and Mexico and unsecured credit in Brazil, with small and medium businesses and cards in Colombia in testing.

The release describes nuFormer as supporting credit underwriting decisions, customer service, and growth across the company, backed by more than a decade of transaction history from more than a hundred million customers.

Frequently asked questions

What is nuFormer: transaction foundation model for credit and fraud?

Swaps "one model per problem" for "one backbone and several heads" in a regulated sector, with transformer latency at stake.

What does the nuFormer: transaction foundation model for credit and fraud design cover?

It is organized in these sections: Plenty of data, value hard to extract, A shared foundation for many applications, Treating the history as a sequence, A systems problem, not just an ML one, and What Nubank says it achieved.

How long is nuFormer: transaction foundation model for credit and fraud and what level is it?

It takes about 18 minutes to read and is rated Staff level.

Now design it yourself

Run this case as an interview in the System Design school: you make the decisions, the tutor challenges them and you see how your design scores.