Causal Representations for Generalisable Recommendation

Feature Image

Introduction

Every major technology company represents its users and products using vectors learned from co-occurrence: which songs are listened to together, which products are bought together, which articles are read one after another. These embeddings underpin recommendation systems that shape what hundreds of millions of people watch, read, and listen to every day.

But recommendation is not a correlational task. It is a causal one. A recommender does not just observe what users like; it intervenes on what they see. And because correlation is not causation, models trained on co-occurrence data are biased toward whatever the previous system surfaced. Over time, this can produce popularity echo chambers and filter bubbles.

There is a practical side to this too. Recommenders are trained on logs that their own past decisions created: a user can only stream a track they were shown. At serving time, though, the same model has to score a much broader and differently distributed set of candidates. Anyone who has worked on a production recommender knows the result: a model that wins offline often does not win online.

There is a further difficulty. The "treatments" in a recommendation system, the items whose effect on a user we want to estimate, are not simple binary, recommend/do not recommend interventions. They are complex, high-dimensional objects: audio tracks, product listings, articles, videos, to name a few. Standard causal inference was not built for this setting, and using these objects naively, as current models do, leads to provably biased estimates.

In two papers, we tackled this problem directly. The first, published in npj Artificial Intelligence, shows that standard approaches to causal effect estimation break down when treatments are high-dimensional. It also introduces a contrastive learning method that provably isolates the causally relevant parts of a structured object and throws away the rest. The second, accepted at NeurIPS 2026, turns this idea into a scalable training objective for production recommendation models. It needs no randomised data and adds no cost at serving time. We validated it in a live A/B test on Spotify's personalised playlist generator with millions of users, where it delivered significant gains in listener engagement.

The problem: when the treatment is an object

To build intuition, let us step away from music for a moment. Suppose we want to estimate the impact of a product review on that product's sales. The review's tone, positive or negative, is likely the main driver. But we do not observe "tone" directly; all we have is the full text of the review. Other aspects of that text, such as its style (word choice, writing flair), probably do not affect sales at all, yet they are mixed into the same object as the tone.

image1

Now suppose style is correlated with something that does affect sales. Perhaps reviewers who write in a certain way also tend to favour the brand. Then a model that uses the raw text can pick up style as a shortcut, and its estimate of how reviews drive sales will be wrong.

Recommendation has exactly this structure. Recommending a product (or a track) is a treatment that changes how likely a user is to engage. Items are usually described by embedding vectors learned from co-occurrence. Some parts of these vectors carry a genuine causal signal about whether a user will enjoy the item. Other parts merely track who has been shown the item before, which reflects the old recommender's decisions and users' past behaviour. The vector entangles both, and the model cannot tell them apart.

We formalise this as hierarchical causal entanglement, visualised in the below figure. 

image3

In the data generation process itself, there are both causal factors (they really drive the outcome) and non-causal factors (they do not affect the outcome but are correlated with the user, through the old policy). We never see these factors directly; we only see the item representation, which is a mixture of both.

Why “just control for the user” isn't enough

The textbook answer to confounding is backdoor adjustment: if you observe the confounders (here, the user and their context), include them in your model and estimate the outcome given both the treatment and the confounders. Recommender systems do exactly this implicitly, since every ranker sees both user and item features.

The npj AI paper shows that this is not enough when the treatment is a high-dimensional object. Backdoor adjustment using the raw item gives biased effect estimates, even when every confounder is observed.

Why? The non-causal parts of the item act as a proxy for the user. A model can lean on them and appear perfectly well-adjusted on the training data. But once we intervene by changing which items are shown, as happens whenever a new recommender is deployed, the link between those non-causal factors and the user breaks. The model's apparent understanding falls apart, and its predictions no longer hold.

The paper also shows why this matters: if the representation of the item carries information about its non-causal parts, effect estimates can be biased. So the goal is clear. We need to learn a representation of each item that keeps what causes the outcome and drops what merely correlates with it.

From theory to production: a disentanglement objective

Our initial paper learns such a representation with contrastive learning, but requires careful construction of positive and negative pairs. For a large-scale production ranker we needed something simpler, and something scalable. Ideally it would be a small change to the standard training loss that works on the logs we already have.

Our latest paper proposes exactly that. We learn an item representation that balances two forces:

  • Utility. The representation should be as informative as possible about the outcome (did the user stream, skip, keep listening?), beyond what we already know from the user.

  • Penalty. The representation should carry as little information as possible about the user.

In information-theoretic terms, this is the mutual information between the representation and the outcome given the user, minus λ times the mutual information between the representation and the user. A single knob, λ, controls the trade-off.

image2

Why does this work? Causal factors are needed to predict the outcome, so the utility term keeps them. The non-causal factors that only echo the user add nothing to prediction, but they do cost penalty, so the objective strips them out. We prove that the ideal causal representation always scores higher than the naive entangled one. We also prove that removing user-correlated leakage from any representation strictly improves the objective. And for small enough λ, nothing causal is thrown away.

Mutual information is notoriously hard to compute from data, so we optimise a tractable bound:

  • a lower bound on the utility, via the familiar contrastive InfoNCE loss; and

  • an upper bound on the penalty, via a contrastive estimator called NCE-CLUB.

Together these give a valid lower bound on the full objective that we can train with standard gradient descent. In practice we implement the penalty with an adversarial critic that tries to guess the user from the item representation. A gradient reversal layer then pushes the item encoder to make that guess as hard as possible. Everything trains in one backward pass alongside the usual ranking loss.

image5

Three properties made this practical at Spotify:

  1. It uses the logs we already have. It needs no randomised exposure data and no interventional experiments.

  2. It works with any standard supervised ranker. It's an extra loss term, not a new architecture.

  3. It adds no cost at serving time. The critic is used only during training.

Does it work?

We tested the method in three settings of increasing realism.

A synthetic setting with known ground truth. When we resampled only the non-causal parts of an item, a standard model's predictions moved noticeably. Our model's predictions barely changed, and its accuracy was the same.

Semi-synthetic KuaiRand. Using real user and video features from the public KuaiRand dataset, we planted a "shortcut" feature. In training it was correlated with the user; at test time it was assigned at random. The standard DeepFM baseline, and DCCL, a strong debiasing method, both dropped sharply when the shortcut broke (AUC 0.725 → 0.691). With our objective, the same architecture held steady (0.722 → 0.721), nearly matching an oracle that knows exactly how the shortcut was assigned.

Here's what each method in the chart is:

  • Baseline: a standard DeepFM ranker with the same architecture as ours, trained the usual way, without our penalty.

  • DCCL: a recent debiasing method. It uses contrastive learning to separate a user's genuine interest in an item from their tendency to follow what's popular.

  • Oracle IPS (inverse propensity scoring): this method gets to see the true probabilities used to assign the shortcut, which you never have in practice. It reweights each training example by those probabilities. That stops the drop under shift, but the extreme weights make training noisy, so accuracy is lower everywhere (about 0.708).

  • Oracle randomisation: this retrains the model on data where the shortcut was random from the start, so it shows the best we could hope for.

  • CRL (ours): the baseline architecture plus our objective. It nearly matches that upper bound using only the logged data, and unlike IPS it keeps its in-distribution accuracy.

image6

A live A/B test at Spotify. Finally, we ran an A/B test with millions of users on a production ranker for personalised playlist generation. We compared the deployed model against a version with the same capacity trained with our objective. The two performed about the same on offline metrics. Online, the causal variant won clearly:

Metric

Change vs. production

95% CI

Track streams

+0.75%

[+0.54%, +0.96%]

Track skips

−0.61%

[−0.74%, −0.47%]

Minutes played

+0.50%

[+0.27%, +0.73%]

These gains are the same order of magnitude as those delivered by the current production ranker, itself a ground-up rebuild, over its mature predecessor.

The same pattern showed up in all three settings: the same offline performance, but better performance once the distribution shifts. That is exactly the gap between offline and online that every recommender team runs into.

Conclusion

Recommendation is a causal problem disguised as a prediction problem, and the items we recommend are complex objects, not simple switches. Across these two papers we've shown that:

  • naively using high-dimensional treatments, as standard recommenders do, leads to provably biased effect estimates, even when every confounder is observed;

  • the fix is to learn an item representation that retains causal information and discards confounder-correlated information;

  • this can be done with a simple, theoretically grounded training objective that needs no randomised data and adds no serving cost; and

  • it translates into real gains for listeners on Spotify.

More broadly, this is a step toward recommender systems that learn why people engage, not just what they've engaged with before. That's what lets a system generalise beyond its own history.

Check out the papers if you would like to learn more!

Causal Representation Learning for Generalisable Recommendation 

Yorgos Felekis, Michael O'Riordan, Oriol Corcoll, Ciarán M. Gilligan-Lee.

NeurIPS, 2026. 

Contrastive Representations of Structured Treatments 

Oriol Corcoll, Athanasios Vlontzos, Michael O'Riordan, Ciarán M. Gilligan-Lee. 

npj Artificial Intelligence, 2026.