Problem
Nubank trains foundation models on a text-like "user narrative": transactions and other events become tokens fed to a transformer. Each event has many attributes (date, amount, description, status, denial reason, entry mode), and each source (transfers, cards, loans, credit bureau records) has its own fields. The context window is finite, so a useless token pushes out a useful one, and "more information is better" does not hold in experiments. The classic route of building tabular features for every new source takes weeks.
Example from the article: user abc-123 has four transactions (a transfer in and three card purchases), and each attribute can be added to or dropped from the tokenized transaction.
Solution in brief
Treat the narrative as a hyperparameter search. Each attribute becomes a small pre-processing module that emits tokens, and each source can have its own modules. Train a model per combination of modules and sources, then compare the combinations on a holdout set. Keep only the tokens that earn their place in the context window.
Questions this case answers
- How to decide which attributes of event data to feed a sequence model when the context window is limited and extra tokens can hurt quality
- How to add a new heterogeneous data source to a learned user representation quickly and measure its value against a fixed benchmark
- How to choose which transaction attributes to put into a user representation for a sequence model?
- How to test whether a new data source improves a model without weeks of manual feature engineering?
Tools and methods
- Pre-processing modules per attribute — turn amount, date, status, description and similar fields into tokens (special tokens or raw text tokenized with BPE).
- Per-source overrides — let each data source use its own list of modules.
- Hyperparameter search over modules and sources — train one model per combination, evaluate on a holdout set.
Google or a one-time email code. No password.