Problem
Nubank's foundation models turn a customer's transaction history into embeddings for downstream models. Each transaction carried its absolute date as <MONTH>, <DAY> and <WEEKDAY> tokens. Such a model cannot tell how long ago something happened. A customer who has been quiet for a year keeps the same embedding. Classic features use windows (1, 3, 6 months) counted back from a score date. Absolute dates also invite overfitting to date combinations, which hurts on later periods when training data spans under a year or the target is seasonal.
Example from the article: a customer is inactive for a year and then resumes activity; with absolute dates, the embedding at any point during the inactivity is identical.
Solution in brief
Replace the date tokens with one token holding the transaction's age relative to the score date. Buckets are fine for recent days, coarser later, capped at two years. The embedding then changes as time passes, and each transaction uses two fewer tokens.
Questions this case answers
- How to represent event timestamps in a sequence model so that embeddings reflect elapsed time and generalize to later periods
- How to shorten the token representation of each event in a context-limited sequence model without losing accuracy
- How to encode transaction timestamps so a sequence model sees recency and long inactivity?
- How to stop a transaction foundation model from overfitting to calendar dates and seasonality?
Tools and methods
- Time-delta special tokens — quantize the age of a transaction (score date minus transaction date) into buckets, one token per bucket
- Next-token-prediction pre-training — trains each foundation model variant on the same data
- Supervised fine-tuning — adapts each variant to one downstream business problem
- Out-of-time test set — measures ROC-AUC on a later period than training
Google or a one-time email code. No password.