Probing transfer learning with a model of synthetic correlated datasets

Federica Gerace, Luca Saglietti, Stefano Sarao Mannelli, Andrew M. Saxe, Lenka Zdeborová · DOI

Abstract

Transfer learning can significantly improve the sample efficiency of neural networks, by exploiting the relatedness between a data-scarce target task and a data-abundant source task. Despite years of successful applications, transfer learning practice often relies on ad-hoc solutions, while theoretical understanding of these procedures is still limited. In the present work, we re-think a solvable model of synthetic data as a framework for modeling correlation between data-sets. This setup allows for an analytic characterization of the generalization performance obtained when transferring the learned feature map from the source to the target task. Focusing on the problem of training two-layer networks in a binary classification setting, we show that our model can capture a range of salient features of transfer learning with real data. Moreover, by exploiting parametric control over the correlation between the two data-sets, we systematically investigate under which conditions the transfer of features is beneficial for generalization.

Introduction

Transfer learning (TL) has become a cornerstone of modern artificial intelligence, enabling the application of models pre-trained on massive datasets to specialized, data-scarce tasks. Despite its empirical success, the theoretical foundations of TL remain underdeveloped. Practitioners often rely on heuristic notions of "task relatedness" without a rigorous framework to predict performance. Key questions remain: How much correlation is required for successful transfer? Does task complexity affect the directionality of transfer? When does "negative transfer"—where pre-training actually degrades performance—occur? This work addresses these questions by introducing an analytic framework to characterize generalization in high-dimensional transfer learning.

The Correlated Hidden Manifold Model

To study transfer learning analytically, we propose the Correlated Hidden Manifold Model (CHMM). In this framework, data is generated from a low-dimensional latent space (hidden manifold) and projected into a high-dimensional feature space. This setup allows for precise parametric control over the relationship between a "source" task and a "target" task.

Schematic of the Correlated Hidden Manifold Model (CHMM) and the transfer learning setup.

The CHMM enables the modeling of three primary types of task relationships:

  1. Feature Perturbation/Substitution: Modifying the underlying data traits (e.g., changing the style of a digit).
  2. Teacher Perturbation: Altering the labeling rules (e.g., changing the classification criteria for the same input features).
  3. Feature Addition/Deletion: Adjusting the intrinsic dimensionality or complexity of the task.

By applying the replica method from statistical physics, we derive closed-form equations to predict the test error of two-layer neural networks. This analytical approach bypasses the need for exhaustive numerical simulations and provides a clear map of the generalization landscape.

Experimental Setup and Datasets

The theoretical predictions of the CHMM were validated using both synthetic simulations and experiments on real-world datasets:

  • Synthetic CHMM: Controlled environments where input dimensions ($D$), latent features ($L$), and hidden units ($H$) are systematically varied.
  • EMNIST-letters: Used to simulate feature substitution by swapping letter groupings.
  • MNIST & Augmented MNIST: Employed to test feature perturbation through techniques like edge enhancement.
  • notMNIST: Used to investigate "orthogonal" tasks where labeling rules are decoupled from primary features.

Results and Analysis

Our analysis reveals several critical insights into the dynamics of transfer learning:

The Asymmetry of Complexity

A significant finding is the inherent asymmetry in transfer efficiency. Transferring features from a complex (feature-rich) task to a simpler (feature-poor) task is markedly more effective than the reverse. A model trained on a complex source task develops a "richer" feature dictionary that more easily spans the requirements of a simpler target task.

Negative Transfer and Phase Transitions

We identify regimes where transferring features is detrimental. If the source and target tasks lack sufficient correlation, a model with transferred features may be outperformed by one with randomly initialized features. We produced "phase diagrams" (heatmaps) that delineate the boundaries between successful transfer and negative transfer based on task correlation ($q$) and target dataset size ($M$).

Fine-Tuning Dynamics

The benefits of fine-tuning transferred features are highly dependent on the target sample size. In low-data regimes, keeping transferred features frozen often yields better generalization, as fine-tuning can lead to rapid overfitting.

Robustness and Double Descent

Transfer learning is shown to shift the "double descent" peak—the point where error spikes as parameters match data points. By providing a better starting point for features, TL makes models more robust in data-scarce regimes.

Conclusion and Future Work

This work provides a rigorous theoretical framework for understanding transfer learning through the CHMM. While currently limited to two-layer networks and binary classification, the model successfully captures salient features observed in real-world data. Future research will focus on extending this framework to deeper architectures like ResNets and Transformers, and developing methods to map real-world dataset correlations directly onto the CHMM parameters to predict transferability a priori.

Summary updated

BibTeX
@article{gerace2022probing,
  author = {Federica Gerace and Luca Saglietti and Stefano Sarao Mannelli and Andrew M. Saxe and Lenka Zdeborová},
  title = {{Probing transfer learning with a model of synthetic correlated datasets}},
  journal = {Mach. Learn. Sci. Technol.},
  year = {2022},
  doi = {10.1088/2632-2153/ac4f3f},
}
Figure