Skip to content

Bank Logs as Pretraining Data: 38.8M Events, No Labels

THE ARGUMENT

Next-event pretraining ranks future events at 0.79 to 0.92 without labels, yet loses to a hand-built feature table on its own; the money is 0.014 to 0.017 as a second ranker, not as a replacement.

On this page

100,224 bank customers' transaction logs sit on disk, but most teams reach for a feature table first. Why? One row per customer, sixty columns of counts, sums and days since the last swipe. Fit a boosted tree, wait for labels, score next month's list. That works, and it is how most banks do it. It also means every new question needs a new table and another labelling round. This paper asks something else: if a model first learns to guess what a customer does next, can the unlabelled answers grow on their own? Half of them can. With no labels it ranks five targets at ROC-AUC 0.79 to 0.92. Frozen, and used alone to predict products, it scores 0.787, below the 114-column table at 0.808. Its value sits in second place, not first[1].

The Feature Table Hits Three Walls

Suppose you run customer marketing at a bank. Two years of logs, a few hundred thousand customers, a daily location ping. Next month you must pick who gets which product, and the budget covers the top 5% of the list.

The default is familiar. Squash each customer into one row: transactions in 30 days, total amount, days since the last one, then the same per event type. Those are features; building them is feature engineering. Feed the table to a gradient-boosted tree, which stacks simple if-then rules into a score.

Three walls.

  • A new question needs a new table. Churn, repeat purchase, a credit-line increase: three tables, and which column to keep is a judgement call.
  • A new source means starting over. Applications, repayments and account charges carry different fields, and there is often no obvious table to build.
  • Labels cost. On the test fold, target_2 has 132 positives in 243,936 rows, or 0.05%. A quarter of a million rows buy 132 answers.

So 'no labels needed' is not mainly about money.

It takes waiting off the critical path.

What the Paper Built: One State per Event

The model is EventGPT. One objective: given everything a customer has done, predict what happens next. That is next-event pretraining. Train on unlabelled logs with one task, guessing the next event; penalise the wrong guess. The label is the log itself.

The data is public: MBD-mini, a 10% sample of MBD under CC BY 4.0. It holds 100,224 clients, of whom 98,721 have transactions, in five folds. Those clients made 38.8 million transactions and 66.3 million geolocation pings. The stream is 53.4 million events at about 8 tokens each, where a token is the smallest unit the model reads; pretraining uses 332 million of them.

Three stages.

  • Event encoder: an event is a short run of tokens (transaction, type 50, subtype 19, amount in bin 7, three hours since the last one), pooled into one vector. One state per event.
  • History decoder: six causal layers read those states. Position is not the index of an event but the time elapsed; rotary positions take the log of elapsed time, so a minute-to-hour gap and a day-to-month gap look about equally far apart.
  • Token decoder: given the state after the previous event, it writes the next event one token at a time.

One state per event is the practical move. At 8,192 tokens the history layers see about one eighth as many items, so attention cost falls from the square of token count to the square of event count.

The price is a small model: 22.9 million parameters. One L4 GPU, bfloat16, 20,000 steps, about 2 hours.

Hold on to that number. It decides which way the answer leans.

Five Targets at 0.79 to 0.92, and What That Saves

The score needs no labels. Append an unfinished event with a type but no subtype; the model returns the probability that the next event has this type and, given the type, that the subtype takes a value. Multiply them. A client who already had the kind scores zero, since the label requires a first occurrence.

This is zero-shot: no classifier, no labels, just a probability. The target is a first transaction of that kind next month. One client and one month form a client-month; the twelve months from February 2022 give twelve rows each.

The metric is ROC-AUC: the chance that a random positive outranks a random negative. 0.5 is a coin flip; 1.0 is a perfect order.

Target (first occurrence)EventGPT, no labelsLabelled client-months for the features to matchEngineered features at 300,000
48/310.909100,000–300,0000.912
23/490.918still short at 300,0000.902
26/280.82830,000–100,0000.849
48/100.787100,000–300,0000.826
50/190.90510,000–30,0000.932

Read the second and third columns: the score without labels, and how many labelled client-months 114 engineered features need to catch up.

50/19 is the common kind, and 10,000 to 30,000 rows suffice. 48/10 needs 100,000 to 300,000. 23/49 sits at 0.902 with 300,000 rows, below 0.918, and passes at 0.930 only with every positive in the pretraining folds. The paper calls these counts rough: a draw of 10,000 rows holds 2 to 34 positives.

Labelling known cases is cheaper. Every positive plus 10,000 random negatives: 50 to 400 positives then match the zero-shot score, from 50 on 48/31 to 400 on 23/49.

So 0.79 is worth roughly 50 to 400 labelled positives.

Two caveats, or you will overprice it.

A plain Markov chain reaches 0.79 to 0.88 with no model at all: average transition probabilities over the last ten events, multiply by transactions in the last 30 days. Across 74 kinds with at least 50 test positives, EventGPT's median is 0.825; it beats that baseline by two standard errors on 48 kinds, loses on 7, and the median gap is 0.042.

And the zero-shot result comes from pretraining, not from the hierarchy. A flat decoder, trained and scored the same way, also reaches 0.78 to 0.92. The hierarchy saves time: 3.9 hours for the flat decoder on 655 million tokens, 1.5 for EventGPT.

You are buying ranking without labels, not a better architecture.

Product Prediction: Loses Alone, Wins in a Rank Average

Product targets are a different job. target_1 to target_4 are labels: did the client take product k this month. They are not events, so zero-shot does not reach them, and a head is needed.

Freeze the backbone, take the hidden state at the start of each month (the vector the history decoder emits after the last event), and fit a logistic regression.

ConfigurationMean ROC-AUC, five foldsAgainst 114 engineered features
EventGPT, frozen embedding0.787−0.021
plus profile fields and full-history token counts0.804−0.004
114 engineered features, CatBoost0.808—
Rank average of the two models0.824+0.016 (folds +0.014 to +0.017)

A gap of 0.021, and the paper does not hide it. On fold 0 the hidden state trails by 0.030; late fusion of four profile fields brings that to 0.016; full-history token counts take it to 0.006 and 0.009.

The real finding is the next line. Treat the two as separate rankers and average their ranks: every one of five folds gains, by 0.014 to 0.017, mean 0.016.

Subtract what any second model adds. The same ensemble without EventGPT gains 0.001 to 0.008, mean 0.004, so 0.007 to 0.016 is EventGPT's own.

There is a clear way to get it wrong: paste the embedding in as a feature column. As 384 columns it scores 0.775; as one CatBoost embedding feature, 0.700; added to the 114, their mean falls from 0.815 to 0.808.

Same vector. Useless as a column, useful as a ranker.

At the top the gain fades: recall in the top 1% is 0.150 for both over five folds, and 0.166 against 0.157 on fold 0. The lift lives in the middle of the list.

When This Method Does Not Apply

Four limits.

  • Dataset: MBD-mini only, a 10% sample, with no published numbers to check. Comparing it with the MBD paper's methods (CoLES 0.773, TabGPT 0.802, a supervised RNN 0.819) waits on full MBD.
  • Setting: MBD events are mostly transactions with one field layout, so the event encoder has little to do. Mixed applications, repayments and charges are the case it was built for, and the paper does not test it.
  • Targets: zero-shot covers only events in the stream. The five kinds were picked by hand, and two unselected kinds rank above two selected ones; the authors did not keep the script, so they cannot say what the choice used.
  • Time: the tables end in December 2022, so 99.1% of January 2023 rows are churn against 12.7% to 20.4% elsewhere. The model can read the month off the time since a client's first event; drop January and churn goes from 0.910 to 0.930. In production the as-of dates sit past the pretraining period, and what it learned about calendar time may no longer hold.

Two more show up at budget time.

The vocabulary does not travel: 12,828 tokens are one bank's event names, so another institution pretrains again. Time-gap tokens are the only ones that mean the same everywhere.

Longer windows do not help. At 4,096 and 8,192 tokens the official mean does not rise, while full-history token counts score 0.026 above counts inside the window. History length beats window length.

When does it fail?

When labels are plentiful. With hundreds of thousands of labelled client-months already, the labels saved are not the bottleneck, and 0.014 will not pay for a rebuild.

When you need causation. The model answers what usually follows a history, not what happens if you send an offer. Append a hypothetical event and the paper says plainly that the result is conditional and does not estimate the effect of causing it.

One line worth screenshotting: pretraining does not build your feature table, it gives the table a second ranker.

References

  1. EventGPT: Next-Event Pretraining on Banking Customer Histories

Sign in to Padda

A code in your inbox. No password to remember.

Connecting to sign-in…