When is Transfer Learning Possible?

My Phan, Kianté Brantley, Stephanie Milani, Soroush Mehri, Gokul Swamy, Geoffrey J. GordonICML 2024

Transfer learning—the art of taking knowledge from one task and applying it to another—is the "secret sauce" behind many modern AI successes. Yet, practitioners often rely on trial-and-error heuristics, such as freezing the first few layers of a neural network, without a rigorous understanding of why or when these methods work.

In a recent ICML 2024 paper, researchers propose a unified causal framework to answer a fundamental question: When is transfer learning actually possible? By modeling the world as a Structural Causal Model (SCM), they challenge long-held beliefs and provide a mathematical toolbox for deciding exactly what knowledge to transfer.

The Problem with Current Transfer Learning Intuitions

Despite its ubiquity, transfer learning lacks a unified theoretical foundation. Most researchers rely on the Sparse Mechanism Shift (SMS) hypothesis, which assumes that when moving from one environment to another, only a few "modules" of the causal generative process change.

However, "similarity" between tasks is often poorly defined. The authors identify a major gap: we lack a formal way to calculate how constraints on local causal mechanisms (e.g., the physics of a camera sensor) translate into constraints on global predictions (e.g., classifying an image). Without this mathematical link, models risk "negative transfer," where forcing a network to reuse old knowledge actually degrades performance on a new task.

A Unified Causal Framework

To solve this, the paper models the "world" as a base Structural Causal Model (SCM). The framework is built on several key concepts:

  1. Atomic Parameters: Each environment is generated by picking specific values for the SCM's parameters from restricted sets.
  2. Computation Trees: The authors derive a procedure to "propagate" these restrictions through the causal graph. They define operations like product, sum-out, and conditioning to build a "computation tree." This tree demonstrates how high-level, observable distributions are constructed from low-level causal parameters.
Computation Tree
  1. The World Update Problem: Transfer is framed as a continuous "world update." As a learner observes more environments, it narrows down the possible values of the world's underlying constraints.
  2. Meta-Algorithm: They propose a continuous learning loop that identifies these constraints over time. This allows the learner to start a new task with a drastically reduced "hypothesis class" (a smaller search space for parameters), significantly speeding up learning.
Transfer Learning Meta-Algorithm

Key Insights: Challenging Conventional Wisdom

By analyzing this causal propagation procedure, the authors uncover several counterintuitive insights:

  • Sparsity is Not the Holy Grail: The authors mathematically prove that "sparse changes" are neither necessary nor sufficient for transfer. An environment can have slight changes in every parameter, but if they follow a shared global constraint, transfer remains highly effective. Conversely, a single sparse change in a critical bottleneck can render transfer impossible.
  • The "Layer Freezing" Trap: Freezing an entire neural network layer is a blunt instrument. The framework demonstrates that if only a portion of a layer represents an invariant causal mechanism, freezing the whole layer forces the model to retain irrelevant information, leading to poor performance.
  • Causal Propagation: The core breakthrough is the ability to mathematically "push" constraints from one part of a causal graph to another. Knowing that a local mechanism is constant allows you to derive exactly how that constrains the possible global distributions you will encounter.

Experimental Validation

The authors evaluate their framework across supervised learning, synthetic models, and reinforcement learning (RL):

  • Complex Colored MNIST: In a challenging variation where the correlation between color and label changes drastically between environments, standard "invariant predictor" methods fail. By using their framework to identify that only the linear coefficient of the first layer was invariant, the authors achieved superior transfer accuracy. Furthermore, they reduced the number of parameters the learner needed to estimate from ~47,000 down to just 60—a massive reduction in sample complexity.
  • The Chain Problem: Using a synthetic linear model, they theoretically demonstrated that non-sparse changes can still allow for successful transfer, validating their core claim against the SMS hypothesis.
  • Reinforcement Learning Subspaces: In a Markov Decision Process setup, they showed that if environmental dynamics remain constant while rewards change, the Q-function is constrained to a low-dimensional subspace. Learning the basis of this subspace allows an RL agent to solve new tasks with significantly less data.

Limitations and Future Work

While theoretically robust, the framework has limitations. It assumes "realizability"—that the true causal model actually lives within the learner's hypothesis class, which is rarely perfectly true in the real world. Additionally, the current theory assumes that each set of parameters results in a unique probability distribution, a property that may not hold for highly overparameterized neural networks.

Future research directions include extending the RL applications to more complex scenarios (e.g., where rewards depend on state transitions) and scaling the constraint-learning meta-algorithm to handle massive, high-dimensional foundation models.

Summary updated

BibTeX
@inproceedings{phan2024when,
  author = {My Phan and Kianté Brantley and Stephanie Milani and Soroush Mehri and Gokul Swamy and Geoffrey J. Gordon},
  title = {{When is Transfer Learning Possible?}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=9yADTDHgGu},
}
Figure