Pular para o conteúdo
← Back to Skalablog

Published article

Wells Fargo Foundation Model for Fraud Detection

Software EngineeringClaude Code

A Wells Fargo foundation model is a transformer pre-trained from scratch on billions of customer transactions, then fine-tuned for fraud detection. In a talk published in October 2026, Freddy Lecue reported it caught more fraud with fewer false positives than the bank's XGBoost production model and ran well inside the 250 ms decline window.

What the Wells Fargo foundation model actually is

A Wells Fargo foundation model is a decoder-only transformer pre-trained from scratch on customer transaction data, not on text, then fine-tuned for tasks such as fraud detection. Freddy Lecue, who presented the work at the AI Engineer conference in a video published in October 2026, described a 1B-parameter base model trained on billions of transactions from Wells Fargo accounts.

The bank did not start from an open-weight language model. Lecue said the team used an existing architecture but initialized the weights from zero and ran pre-training itself on its own GPU cluster, a process he described as taking a couple of weeks in the first round. The distinction matters: the bank borrows the transformer recipe, not a trained model.

The pitch rests on reuse. One backbone learns representations of how customers transact, and separate teams fine-tune it for credit line decisions, anti-money laundering, marketing and fraud. Lecue said the same foundation is now used across different organizations inside the bank.

Context matters here. Lecue did not publish the model, weights, architecture config or a paper, and the fraud numbers he showed are the bank's own. Treat the results as vendor-reported until an independent evaluation exists.

Why a transaction model instead of plain XGBoost

XGBoost, the gradient-boosted tree library that has long been a default for tabular credit and fraud models, still held the production slot at Wells Fargo. Lecue described it as the model the bank had in production and said the transformer beat it on fraud detection.

His explanation is about what trees lose. A tree model scores a transaction from engineered features, and the relationship between that transaction and the customer's earlier activity survives only if someone hand-codes it. A transformer attends over the sequence directly, so the fraud decision sees historical context at inference time.

That is a mechanistic argument, not a measured one. The talk gave no ablation isolating attention from the tokenization changes, so the share of the gain that comes from sequence attention alone is unknown from what was shown.

The trade-off is cost. Building the vocabulary, the tokenizer and the pre-training run is substantial engineering. XGBoost needs far less, which is why a bank would only switch if the fraud and false-positive gains paid for the work.

Turning tabular transactions into tokens

The tokenizer is where Lecue placed most of the difficulty. Transactions arrive as tabular rows with amounts, timestamps, merchant identifiers, channel codes and postal codes, and every column has to be mapped to a token id and then an embedding.

The team reduced thousands of engineered features down to roughly 100 raw information units, then let the transformer learn relationships among them. The five organizing dimensions Lecue named were who is paying and who is being paid, what was transacted, which channel was used, when it happened and where it happened.

The hard cases are high-cardinality fields. A zip code could become one token per code, which balloons the vocabulary, or it could be regrouped by distribution into a smaller set. Transaction amount and the time delta between consecutive transactions needed their own encoding.

Lecue said vocabulary size was a training constraint, since an oversized vocabulary makes the run harder to manage. The design principle is to shrink the field into a set of tokens large enough to keep signal and small enough to train.

Architecture and training setup

The pre-training objective was next-transaction prediction, the tabular analogue of next-token prediction. The model uses a decoder-only transformer, and Lecue said the team sized the run using the compute-to-parameters relationship popularized by the Chinchilla scaling work.

Scaling did not follow the textbook ratio. The team initially planned around 20 tokens per parameter, then found in experimentation that they needed far more tokens per parameter than that. Lecue mentioned a 10x factor without spelling out the final ratio, so the exact tokens-per-parameter number is not public.

The engineering stack was conventional: mixed precision, distributed data parallel training, micro-batching for convergence, rotary position embeddings, FlashAttention and activation checkpointing. Lecue said the team followed practices from groups that have trained much larger models.

Size was deliberate. The 1B-parameter model was, in Lecue's words, the smallest configuration that gave the highest boost. He said a next version at 11B parameters is in progress, which means the published results describe the 1B model, not the larger one.

Fraud results, latency and the cost of false declines

Fine-tuned for binary fraud classification, the model flagged more fraudulent transactions and produced fewer false positives than the production XGBoost baseline, according to Lecue. He did not put numbers on either metric, so the size of the improvement is not public.

Latency had a hard ceiling. Card authorization decisions must complete in under 250 milliseconds, and Lecue said the transformer ran roughly 10 times faster than that budget. That claim covers the inference path he described, not the training run or an end-to-end payment network.

False positives carry direct cost. Lecue explained that declining a legitimate transaction triggers a customer call and loses the transaction, so a model that cuts false alarms while catching more fraud saves money on both sides. He called the total effect millions of dollars in savings without giving the figure two components.

Compare the two approaches on the dimensions the talk actually covered:

DimensionProduction XGBoost1B transaction transformer
InputEngineered tabular features~100 raw features as token sequences
Sequence contextHand-coded, limitedAttention over past transactions
Detection rateBaselineHigher, per Lecue
False positive rateBaselineLower, per Lecue
Inference latencyBaselineAbout 10x inside the 250 ms budget
Scope of evidenceBank production systemOne bank's internal evaluation

What the talk leaves unproven

The results are a single institution's internal comparison, presented without a published evaluation set, baseline configuration or confidence intervals. That makes three questions unanswerable from the talk alone.

First, the magnitude. Lecue said detection improved and false positives fell, but gave no rates, no dollar figures per component and no sample sizes. The Direction is credible for a bank describing its own production replacement; the size is not measurable from the recording.

Second, the attribution. The transformer differs from the XGBoost baseline in tokenization, feature set, sequence context and training data pipeline all at once. None of those variables was isolated.

Third, generalization. One bank's transaction distribution and fraud patterns are not another's. A 1B-parameter model pre-trained on Wells Fargo volume says little about whether a mid-sized institution could justify the pre-training cost.

Where Gustavo Dev Doido and Crazystack Typescript fit

Readers arriving from Brazilian developer channels may recognize the names in this section. Gustavo Dev Doido runs the Crazystack Typescript community and the Bootcamp do Dev Doido, both of which teach TypeScript and full-stack engineering to developers building their first production systems.

The connection to this article is methodological. A transaction foundation model replaces hand-crafted feature engineering with learned structure, which is the same shift developers face when they move from hand-written Claude Code to typed abstractions. The discipline of defining a clean schema, what a field means and which values share a token, is exactly the work Crazystack Typescript teaches at the application layer.

You can find the community's TypeScript material at crazystack.com.br. The patterns are application-level, not banking-specific, but the schema-first habit transfers.

Frequently asked questions

  • What is the Wells Fargo foundation model? It is a decoder-only transformer pre-trained from scratch on billions of customer transactions and then fine-tuned for tasks such as fraud detection. Freddy Lecue presented it at the AI Engineer conference in a video published in October 2026.
  • Did Wells Fargo use an open-weight model? No. Lecue said the team used an existing architecture but initialized weights from zero and pre-trained on its own GPU cluster, taking a couple of weeks in the first run.
  • How did it compare to XGBoost on fraud? Lecue reported a higher detection rate and a lower false positive rate than the production XGBoost model, without publishing the exact rates or the evaluation setup.
  • Was the model fast enough for real-time card approvals? Lecue said decline decisions must finish in under 250 milliseconds and that the model ran about 10 times faster than that limit.
  • How many parameters does it have? The published results describe a 1B-parameter model. Lecue said a next version at 11B parameters is in progress.
  • What was the hardest part of the build? Tokenization. Lecue said mapping amounts, timestamps, merchant data and zip codes into a workable vocabulary was the main engineering challenge, not the transformer architecture.
  • Did the team follow Chinchilla scaling exactly? No. They planned around 20 tokens per parameter, then found they needed more tokens per parameter than that, with Lecue citing a 10x factor.
  • What other tasks is the model used for? Lecue said credit line increase, anti-money laundering and marketing are under investigation, and that fraud is the task that has been taken through fine-tuning.
  • Can another bank copy the result? The talk gives no public evaluation set or baseline configuration, so the gains are specific to Wells Fargo's data and cannot be assumed to transfer to another institution.

Turning a conference talk into a written article

A technical talk like this one carries the useful detail in its sequence: the reason the bank moved off XGBoost, the tokenization decisions, the scaling experiments that did not match the textbook ratio, the results with their missing numbers. Written down in that order, the talk becomes something a reader can search, quote and check.

If your own videos hold that kind of material, interviews, architecture walkthroughs, conference sessions, you can turn them into a written article with Skalablog. Paste a YouTube URL, let the tool transcribe the video, and generate a structured draft you can edit before publishing.

Learn more at Skala Blog.

Source video