Characterizing and Understanding the Generalization Error of Transfer Learning with Gibbs Algorithm

Yuheng Bu, Gholamali Aminian, Laura Toni, Gregory W. Wornell, Miguel Rodrigues

Abstract: We provide an information-theoretic analysis of the generalization ability of Gibbs-based transfer learning algorithms by focusing on two popular empirical risk minimization (ERM) approaches for transfer learning, $\alpha$-weighted-ERM and two-stage-ERM. Our key result is an exact characterization of the generalization behavior using the conditional symmetrized Kullback-Leibler (KL) information between the output hypothesis and the target training samples given the source training samples. Our results can also be applied to provide novel distribution-free generalization error upper bounds on these two aforementioned Gibbs algorithms. Our approach is versatile, as it also characterizes the generalization errors and excess risks of these two Gibbs algorithms in the asymptotic regime, where they converge to the $\alpha$-weighted-ERM and two-stage-ERM, respectively. Based on our theoretical results, we show that the benefits of transfer learning can be viewed as a bias-variance trade-off, with the bias induced by the source distribution and the variance induced by the lack of target samples. We believe this viewpoint can guide the choice of transfer learning algorithms in practice.

Introduction

Transfer learning has become a cornerstone of modern machine learning, enabling models to leverage knowledge from data-rich source tasks to improve performance on data-scarce target tasks. Despite its empirical success in domains ranging from computer vision to natural language processing, a rigorous theoretical understanding of its generalization properties remains elusive. Traditional generalization bounds often fail to capture the nuances of distribution shifts between source and target domains, leading to loose or overly restrictive estimates. This paper addresses this gap by providing an exact information-theoretic characterization of the generalization error for two prominent transfer learning strategies.

Methods

The study focuses on two widely used empirical risk minimization (ERM) frameworks for transfer learning:

  1. $\alpha$-weighted-ERM: This strategy minimizes a convex combination of the empirical risks from both the source and target datasets. The parameter $\alpha$ controls the relative importance of the source data.
  2. Two-stage-ERM: In this paradigm, the learning process is split into two phases. First, the model learns a set of shared features or parameters from the source data. Second, these features are frozen or used as a starting point to learn task-specific parameters using the target data.
Diagram of the two-stage transfer learning framework.

To analyze these algorithms, the authors employ Gibbs Algorithms as a theoretical proxy. A Gibbs algorithm is a randomized version of ERM where the hypothesis is sampled from a distribution (the Gibbs distribution) that assigns higher probability to hypotheses with lower empirical risk. This framework is particularly powerful because, as the "inverse temperature" parameter $\gamma$ increases, the Gibbs algorithm behaves exactly like standard ERM. As shown in the diagram above, the two-stage process involves extracting shared parameters ($W_\phi$) from source data ($D_s$) and then refining target-specific parameters ($W_c^t$) using target data ($D_t$).

Theoretical Framework

The core of the analysis relies on Conditional Symmetrized Kullback-Leibler (KL) Information. This metric measures the information "leakage" between the output hypothesis and the training data. Specifically, the generalization error is shown to be exactly characterized by the information shared between the hypothesis and the target samples, conditioned on the source samples. This provides a precise mathematical link between information theory and the ability of a transferred model to generalize to unseen target data.

Key Insights: The Bias-Variance Trade-off

One of the most significant contributions of this work is the interpretation of transfer learning through the lens of a bias-variance trade-off:

  • Variance Reduction: Incorporating source data effectively increases the total amount of information available to the model, which helps stabilize the learning process and reduce variance, especially when target data is limited.
  • Bias Induction: However, because the source distribution typically differs from the target distribution, using source data introduces a "transfer bias."

The optimal transfer learning strategy is thus a balancing act: finding the point where the reduction in variance from the source data outweighs the bias introduced by the distributional discrepancy. The authors' framework allows for a quantitative assessment of this trade-off, showing that the "closeness" of two tasks is not just a property of the data distributions, but is also dependent on the specific algorithm used.

Key Results

The authors derive exact expressions for the expected generalization error. For the $\alpha$-weighted Gibbs algorithm, the error is shown to be proportional to the symmetrized KL information divided by the weighting factor and temperature. Furthermore, they provide distribution-free upper bounds, demonstrating that the error scales at a rate of $O(d/(m+n))$, where $n$ and $m$ are the number of source and target samples, respectively. These results are shown to be asymptotically consistent with classical Maximum Likelihood Estimation (MLE) theory.

Conclusion

This research provides a rigorous foundation for understanding why transfer learning works. By characterizing generalization error through information-theoretic measures, it offers a new perspective on task similarity and algorithmic choice. While the computational complexity of calculating these measures for large-scale neural networks remains a challenge, the theoretical insights—particularly the bias-variance trade-off—provide valuable guidance for practitioners designing transfer learning pipelines. Future work may extend these results to more complex optimization algorithms like standard SGD and explore new discrepancy measures suggested by this framework.

Summary updated

BibTeX
@inproceedings{bu2022characterizing,
  author = {Yuheng Bu and Gholamali Aminian and Laura Toni and Gregory W. Wornell and Miguel Rodrigues},
  title = {{Characterizing and Understanding the Generalization Error of Transfer Learning with Gibbs Algorithm}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2022},
  url = {https://openreview.net/forum?id=xal0lxZ7jWEX},
}
Figure