Abstract
Pretraining and fine-tuning are central stages in modern machine learning systems. In practice, feature learning plays an important role across both stages: deep neural networks learn a broad range of useful features during pretraining and further refine those features during fine-tuning. However, an end-to-end theoretical understanding of how choices of initialization impact the ability to reuse and refine features during fine-tuning has remained elusive. Here we develop an analytical theory of the pretraining-fine-tuning pipeline in diagonal linear networks, deriving exact expressions for the generalization error as a function of initialization parameters and task statistics. We find that different initialization choices place the network into four distinct fine-tuning regimes that are distinguished by their ability to support feature learning and reuse, and therefore by the task statistics for which they are beneficial. In particular, a smaller initialization scale in earlier layers enables the network to both reuse and refine its features, leading to superior generalization on fine-tuning tasks that rely on a subset of pretraining features. We demonstrate empirically that the same initialization parameters impact generalization in nonlinear networks trained on CIFAR-100. Overall, our results demonstrate analytically how data and network initialization interact to shape fine-tuning generalization, highlighting an important role for the relative scale of initialization across different layers in enabling continued feature learning during fine-tuning.
Introduction
Modern deep learning relies heavily on a two-stage training process: pretraining on a massive, general-purpose dataset, followed by fine-tuning on a smaller, task-specific dataset. For this to work well, the network must strike a delicate balance between reusing the features it already learned and learning or refining new ones.
Prior research in single-task learning has shown that weight initialization dictates whether a network operates in a "lazy" regime (acting like a kernel machine with fixed features) or a "rich" regime (actively learning task-specific, often sparse, features). However, it has remained unclear how these initialization choices—specifically the absolute size of the weights and their relative sizes across different layers—affect the inductive bias in the multi-stage pretraining and fine-tuning (PT+FT) setting. This paper provides an end-to-end theoretical understanding of how initialization controls feature learning and reuse during fine-tuning.
Methods: Diagonal Linear Networks
To make this complex problem mathematically tractable, the authors study diagonal linear networks. Despite their simplicity, these one-hidden-layer linear models capture the transition between lazy ($\ell_2$-like) and rich ($\ell_1$-like, sparse) learning regimes based on initialization.
The authors train these networks using gradient flow on a Mean Squared Error (MSE) loss in two stages. They focus on three key initialization levers:
- Absolute scale ($c_{PT}$): The overall magnitude of the initial weights.
- Relative scale ($\lambda_{PT}$): The difference in initial weight magnitude between the first and second layers.
- Readout scale ($\gamma_{FT}$): The scale of the final layer's weights when re-initialized for fine-tuning.
Using the replica method from statistical physics, they analytically derive the implicit bias of the network and exact expressions for the generalization error in the high-dimensional limit. The theory is tested on a teacher-student setup with Gaussian inputs, where ground-truth "teacher" networks use a spike-and-slab distribution to control task sparsity and feature overlap.
Key Insights: Four Distinct Learning Regimes
By analyzing the network's bias toward sparsity ($\ell$-order) and its reliance on pretrained features, the authors identify four distinct regimes:
- Rich, pretraining-independent: The model learns new sparse features and ignores pretraining.
- Lazy, pretraining-dependent: The model reuses pretrained features with minimal adaptation.
- Lazy, pretraining-independent: A novel "failure" mode where the network neither learns new features nor reuses old ones effectively.
- Rich, pretraining-dependent: An intermediate "sweet spot" that balances reusing old features with learning new sparse ones.
A critical finding is that the relative scale between layers ($\lambda_{PT}$) is a primary driver of fine-tuning behavior. Initializing the first layer much smaller than the second layer (negative $\lambda_{PT}$) pushes the network toward the desirable rich, pretraining-dependent regime.
Results and Validation
The analytical generalization curves derived via the replica method perfectly match empirical simulations of diagonal linear networks across various data scales and task overlaps. Furthermore, these theoretical insights translate to practical, nonlinear architectures.
In experiments on CIFAR-100 (pretrained on 98 classes, fine-tuned on 2), using a ResNet-18, the authors found that:
- Initializing with a smaller relative scale in early layers (analogous to negative $\lambda_{PT}$) significantly improved fine-tuning generalization.
- Decreasing the absolute scale of pretraining initialization ($c_{PT}$) or the fine-tuning readout initialization ($\gamma_{FT}$) also improved performance, confirming the linear theory's predictions.
Conclusion
This work demonstrates how data and network initialization interact to shape fine-tuning generalization. While the core theory is built on diagonal linear networks, its successful application to ResNets suggests that the principles of "balancedness" and relative layer scaling are fundamental to feature learning in deep networks. Future work may extend this framework to fully nonlinear models and explore tools like influence functions to further quantify feature adaptation in complex architectures.
Summary updated