Explaining Financial Models by Deleting Transactions

Denis Reis12 Nov 2025

Problem

Nubank's transformer-based foundation models read a customer's sequence of transactions and output a prediction. Security, debugging and responsible deployment all depend on knowing how each transaction, and each of its properties, moves that prediction. SHAP fits the need but is computationally prohibitive for deep networks. Gradient-based substitutes need gradient access and model-specific setup, and they give the first and last transactions high importance regardless of content. Keeping such tools in sync with fast-changing architectures became too costly.

Example from the article: on synthetic data that mimics real behavior, gradient-based importance concentrates at both ends of the transaction sequence.

Solution in brief

Leave One Transaction Out (LOTO) removes one transaction from the input sequence, runs the model again and takes the difference between the new and the original prediction. This difference is the transaction's LOTO value: signed, computed in context, and independent of model architecture. For global trends, remove one random transaction per customer. For a local deep dive, remove every transaction of one customer in turn.

Questions this case answers
  • How to measure the contribution of each element of a variable-length input sequence to a model's output when the model architecture changes often and gradient access is not guaranteed
  • How to separate the importance of an input element's content from the importance of its position in the sequence
  • How to find out which individual transactions drive a sequence model's prediction for a customer
  • How to explain a model whose architecture keeps changing without maintaining a separate explainability tool for each architecture

Tools and methods

  • Leave One Transaction Out (LOTO) — per-transaction importance from the change in prediction after deleting that transaction
  • SHAP, Integrated Gradients, Layer-Wise Relevance Propagation, LIME — alternatives the authors considered and rejected
  • Decision tree on LOTO results — optional meta-model that turns global LOTO values into readable rules
Continue reading — it's free

Google or a one-time email code. No password.