Provable Multi-Task Representation Learning by Two-Layer ReLU Neural Networks

Liam Collins, Hamed Hassani, Mahdi Soltanolkotabi, Aryan Mokhtari, Sanjay Shakkottai

Introduction

In modern machine learning, the standard recipe for achieving state-of-the-art performance involves pretraining a large model on a massive variety of tasks offline, and then fine-tuning or "probing" it for specific downstream applications. While this paradigm works incredibly well in practice—powering models like CLIP, BERT, and GPT—our theoretical understanding of why it works has lagged behind.

This paper provides the first theoretical proof that multi-task pretraining on nonlinear (ReLU) neural networks successfully learns a shared, low-dimensional feature representation. The authors reveal that updating task-specific heads induces a pseudo-contrastive loss that aligns data points sharing the same labels, allowing the network to ignore high-dimensional noise and generalize to new tasks with a complexity independent of the input's original dimension.

Existing theoretical frameworks for representation learning generally fall into two camps:

  1. Linear Models: We have a solid understanding of how linear models learn shared subspaces across multiple tasks.
  2. Single-Task Nonlinear Models: There are established proofs for how shallow ReLU networks learn features for one specific task.

The "missing link" has been a provable guarantee for nonlinear networks trained on multiple tasks. Specifically, researchers have struggled to explain why increasing the number of pretraining tasks improves the quality of learned features, and how a network manages to isolate a small set of relevant features (dimension $r$) buried inside a massive amount of irrelevant noise (dimension $d$, where $d \gg r$).

Methodology: Alternating Gradient Descent

To bridge this gap, the authors analyze a two-layer ReLU neural network trained using a two-stage gradient-based algorithm. The data model assumes that labels depend only on a projection of the input onto an $r$-dimensional subspace within the larger $d$-dimensional space.

  1. Representation Learning Phase: The model is trained on $T$ different binary classification tasks using Alternating Gradient Descent. First, it performs one step of Stochastic Gradient Descent (SGD) to update the task-specific "heads" (the last layer). Then, it updates the shared "representation" (the first layer) using the gradients from those newly updated heads.
  2. Downstream Evaluation Phase: To test the quality of the learned representation, the first layer is frozen, and a new head is trained (via linear probing) on a novel task that shares the same underlying feature subspace.

The study relies on synthetic datasets designed to provide rigorous mathematical proofs while reflecting hard real-world problems, such as Sparse Parity Tasks and high-dimensional Gaussian inputs where only a small, unknown subspace contains useful information.

Key Insights and Results

The Pseudo-Contrastive Effect

The paper's most novel insight is the discovery of a "pseudo-contrastive effect." By updating the task-specific heads before the representation layer, the resulting loss function for the first layer begins to behave like a contrastive loss. It naturally encourages the network to map points that typically share the same label across many tasks to the same region in the representation space.

Information Aggregation and Dimension Independence

A single task might only reveal a few dimensions of the important $r$-dimensional subspace. However, by training on many diverse tasks, the network stitches together these pieces of information to recover the entire ground-truth subspace. The authors prove that once this representation is learned, the number of samples needed to solve a new downstream task depends on the feature dimension $r$, but not on the noisy ambient dimension $d$.

Theoretical Guarantees and Empirical Validation

  • Subspace Recovery: The algorithm recovers the ground-truth subspace with an error that vanishes as the number of tasks $T$ and samples per task $n$ increase.
  • Generalization Guarantee: A downstream task can be solved with sample and neuron complexity independent of $d$.
  • The Necessity of Multi-Tasking: Negative results prove that training on just a single task cannot guarantee learning the full feature set. In single-task scenarios, complexity scales polynomially with the high dimension $d$, making learning significantly harder.

These theoretical claims are strongly supported by empirical simulations. As shown below, increasing the number of pretraining tasks ($T$) dramatically reduces the representation learning error over training iterations.

Representation learning error over iterations for varying numbers of tasks ($T$).

Limitations and Future Work

While groundbreaking, the study has several limitations that pave the way for future research:

  • Architectural Depth: The proof is currently limited to two-layer networks. Extending these guarantees to deep architectures remains a major open challenge.
  • One-Step Analysis: The theoretical analysis focuses on a single alternating gradient step. Real-world training involves thousands of iterations, which warrants further dynamic analysis.
  • Exponential Complexity in $r$: Although complexity is independent of the large dimension $d$, it remains exponential in the feature dimension $r$ due to the nature of parity tasks. Future work could investigate if this can be reduced for different task distributions.
  • Data Distribution Assumptions: The results assume a specific subspace structure. It remains unclear how well these proofs translate to the more complex, non-linear manifolds typically found in natural data.

Summary updated

BibTeX
@inproceedings{collins2024provable,
  author = {Liam Collins and Hamed Hassani and Mahdi Soltanolkotabi and Aryan Mokhtari and Sanjay Shakkottai},
  title = {{Provable Multi-Task Representation Learning by Two-Layer ReLU Neural Networks}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=M8UbECx485},
}
Figure