Attuned to Change: Causal Fine-Tuning under Latent-Confounded Shifts

Jialin Yu, Yuxiang Zhou, Yulan He, Nevin L. Zhang, Ricardo Silva, Torr, Philip, Silva, Ricardo · DOI

Abstract

Adapting to latent-confounded shifts remains a core challenge in modern AI. These shifts are propagated via latent variables that induce spurious, non-transportable correlations between inputs and labels. One practical failure mode arises when fine-tuning pre-trained foundation models on confounded data (e.g., where certain text tokens or image backgrounds spuriously correlate with the label), leaving models vulnerable at deployment. We frame causal fine-tuning as an identification problem and pose an explicit causal model that decomposes inputs into low-level spurious features and high-level causal representations. Under this family of models, we formalize the assumptions required for identification. Using pre-trained language models as a case study, we show how identifying and adjusting these components during causal fine-tuning enables automatic adaptation to latent-confounded shifts at test time. Experiments on semi-synthetic benchmarks derived from real-world problems demonstrate that our method outperforms black-box domain generalization baselines, illustrating the benefits of explicitly modeling causal structure.

TL;DR

This paper introduces Causal Fine-Tuning (CFT), a framework designed to stop AI models from "cheating" by relying on spurious correlations—like associating a specific word or background with a label just because they happened to appear together in the training data. By treating fine-tuning as a causal identification problem, the authors show how to decompose model representations into stable causal signals and environment-specific noise, allowing models to remain accurate even when the rules of the environment change at test time.

The Challenge: Latent-Confounded Shifts

When we fine-tune foundation models (like BERT or CLIP) on a specific dataset, they often pick up on latent-confounded shifts. Imagine training a sentiment classifier where most positive reviews come from Amazon and most negative ones come from Yelp. The model might learn that the word "Amazon" causes a positive sentiment. If you deploy this model in a world where Yelp reviews are suddenly the positive ones, the model fails spectacularly.

Latent-confounded shifts in sentiment analysis. Training on biased data (e.g., Amazon reviews are positive, Yelp are negative) leads to spurious correlations that fail at test time.

The core challenge is that these confounding factors (like the data source) are often hidden (latent). Standard "black-box" models can't distinguish between a feature that truly causes a label (the actual sentiment of the text) and a feature that is merely a passenger (the platform name). While existing "domain generalization" methods try to find invariant features, they often require multiple training environments or explicit domain labels, which aren't always available in the real world.

Methodology: Causal Fine-Tuning (CFT)

The authors propose Causal Fine-Tuning (CFT), which uses the principles of causal inference to "block" spurious paths. Their approach rests on a few key components:

  1. Functional Decomposition: They assume the input $X$ can be broken into three parts: a frozen pre-trained representation ($R_0$), a fine-tuned representation ($R_1$), and low-level "local" features ($\Phi$) like embeddings.
  2. Identifying the Causal Variable ($C$): By comparing the representations from the original frozen model ($R_0$) and the fine-tuned model ($R_1$), the algorithm identifies a latent causal variable $C$ that represents the "true" signal invariant across shifts.
  3. The Front-Door Adjustment: Instead of predicting the label $Y$ directly from the input $X$ (which is $p(y|x)$), they calculate the interventional distribution $p(y | do(x))$.
The Causal Fine-Tuning (CFT) architecture. It decomposes representations into causal signals (C) and local features (Φ) to perform causal adjustment.

Implementation: They implement this by training a small MLP (Multi-Layer Perceptron) that takes the identified causal variable $C$ and the local features $\Phi$ to produce a robust prediction. Crucially, they use a "maximum-entropy" approach during inference to average out the influence of spurious features.

Benchmarking on Semi-Synthetic Data

Because real-world spurious correlations are hard to measure precisely, the authors used semi-synthetic benchmarks derived from the Amazon and Yelp review datasets.

  • Experiment 1 (Stop Words): They injected suffixes (like "xxxx" or "yyyy") into common stop words ("and", "the") and correlated these suffixes with sentiment labels during training.
  • Experiment 2 (Data Source): They mimicked the platform-bias scenario, where strings like "amazon.xxx" were appended to sentences to act as latent confounders.

These datasets are unique because they allow researchers to precisely control the "OOD (Out-of-Distribution) ratio"—for example, testing a model on a dataset where the spurious correlation is 90% reversed compared to training.

Key Insights and Results

  • The Pre-trained Model as an Anchor: A brilliant insight here is treating the frozen foundation model as an implicit "environment." By comparing it to the fine-tuned version, we can tease out what the model learned specifically from the biased training data versus what it already knew about the world.
  • Conditioning is a Trap: The paper explains why standard models fail using causal graphs. When a model conditions on the entire input signal, it creates an "active collider path" that lets information from the environment (the confounder) leak into the prediction.
  • Low-Level Invariance: The method relies on the assumption that low-level features (like the basic meaning of words in early layers) are more stable across domains than high-level representations. This allows these low-level features to act as a "front-door" for causal adjustment.

The CFT method consistently outperformed standard Supervised Fine-Tuning (SFT) and other robust baselines (like SWA and WISE). In Experiment 1, when the spurious correlation was 90% in training but only 10% in testing (a total reversal), SFT's performance plummeted to ~49% F1, while CFT maintained a much higher ~58% F1. Across various levels of "spuriousness," CFT showed a much flatter performance curve, meaning it is significantly less sensitive to how much "poison" is in the training data.

Limitations and Future Directions

  • The Invariance Assumption: The method assumes that low-level features ($\Phi$) are invariant between training and test time. If the low-level features themselves shift (e.g., moving from English to a completely different language), the causal adjustment might break.
  • Complexity of Confounders: While semi-synthetic data is great for proof-of-concept, real-world confounding is often more "tangled" than a simple suffix appended to a word.
  • Future Directions: The authors suggest extending this to multi-modal scenarios (e.g., where a latent variable might affect both an image and its caption) and exploring more complex hierarchical causal structures.

Summary updated

BibTeX
@inproceedings{yu2026attuned,
  author = {Jialin Yu and Yuxiang Zhou and Yulan He and Nevin L. Zhang and Ricardo Silva and Torr, Philip and Silva, Ricardo},
  title = {{Attuned to Change: Causal Fine-Tuning under Latent-Confounded Shifts}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=NDPvfDxsz4},
}
Figure