A Bayesian Model Selection Criterion for Selecting Pretraining Checkpoints

Michael Munn, Susan Wei

Introduction

Recent advances in artificial intelligence have been largely fueled by the "pretrain-then-adapt" paradigm. Foundation models such as BERT, GPT, and Vision Transformers are first pretrained on vast, diverse datasets and subsequently fine-tuned for specific downstream tasks using significantly less data. However, the mechanisms behind the success of this ubiquitous approach remain underexplored. Specifically, researchers lack a principled way to identify which characteristics of a pretraining checkpoint actually enhance downstream adaptation.

To address this, researchers have introduced a principled Bayesian criterion called downstream free energy to predict which pretraining checkpoints will adapt best to new tasks. By proving that pretraining free energy—calculated without ever seeing the target task—serves as a reliable proxy, they provide a mathematical justification for why certain training heuristics actually improve model transferability.

The Problem: Beyond Pretraining Loss

How do we know which checkpoint during pretraining is the "best" one to start from for a new task?

Usually, practitioners rely on heuristics or simply pick the checkpoint with the lowest pretraining loss. Unfortunately, "low loss" on the pretraining data does not reliably translate to "high adaptability" on a downstream task. As pretraining progresses, the training loss often plateaus or "collapses" to a similar near-zero value across different hyperparameter settings. There has been a distinct lack of a principled theoretical framework to measure a model’s "potential" for future learning before that learning even happens.

A Bayesian Solution: Downstream Free Energy

To solve this, the authors turn to Bayesian statistics to define a new metric: Downstream Free Energy.

  1. The Concept: Free energy is essentially the negative log of the marginal likelihood. In this context, it measures the "concentration" of well-performing parameters in the neighborhood of a checkpoint. If a checkpoint is surrounded by many sets of weights that work well for a task (a "flat" minimum), it has low free energy and high adaptability.
  2. The Proxy: Because practitioners do not usually have access to downstream data during pretraining, the authors introduce Pretraining Free Energy. They mathematically prove that under certain conditions of distributional shift, minimizing free energy on the pretraining data effectively minimizes it for the downstream task.
  3. The Estimation: To make this practical, they use a localized version of the Widely Applicable Bayesian Information Criterion (WBIC). They estimate this value using Stochastic Gradient Langevin Dynamics (SGLD), a sampling method that explores the local "landscape" around a checkpoint to evaluate how flat or sharp the solution is.

Key Insights: Why Heuristics Work

The framework of free energy provides a theoretical "why" for common training tricks. Large learning rates, small batch sizes, and high momentum are empirically known to improve transfer learning. The authors show that these techniques implicitly regularize the model toward regions of lower free energy.

Furthermore, free energy highlights the balance between model fit and complexity. A checkpoint with a slightly higher loss but lower complexity (measured by the local learning coefficient) is often more adaptable than a "sharper" low-loss checkpoint.

Training dynamics across iterations showing that while pretraining loss converges, WBIC (Free Energy) and downstream accuracies vary significantly based on hyperparameters.

As seen in the training dynamics, while the pretraining loss (left column) collapses to near-zero across various learning rates, batch sizes, and momentum values, the WBIC (middle-left column) continues to vary significantly. This variance in WBIC closely mirrors the variance in downstream fine-tuning accuracy, proving that free energy is a much more sensitive and accurate instrument for picking the best checkpoint than training loss.

Empirical Results

The authors validated their theory using standard computer vision benchmarks, including CIFAR-FS (a few-shot learning dataset derived from CIFAR-100) and mini-ImageNet, utilizing ResNet-18 and VGG-16 architectures.

The empirical results show a striking correlation between the proposed metric and actual performance.

Scatter plots demonstrating the strong negative correlation between Pretraining Free Energy and downstream transfer accuracy (top: full fine-tuning, bottom: 5-shot).
  • Strong Correlation: Pretraining Free Energy (WBIC) showed a much stronger correlation with downstream accuracy than existing metrics like "Geometric Complexity" or "Neural Collapse."
  • Predictive Power: In their CIFAR-FS experiments, Free Energy achieved a Pearson correlation coefficient of -0.820 for full fine-tuning accuracy and -0.890 for few-shot accuracy. A value closer to -1 indicates that lower free energy almost perfectly predicts higher accuracy.
  • Consistency: These results held true across various hyperparameter sweeps, proving robust against changes in learning rate, batch size, and momentum.

Limitations and Future Directions

While the results offer a powerful new lens for model training, the authors acknowledge several hurdles:

  • Computational Cost: Calculating the WBIC requires SGLD sampling, which is computationally expensive. While feasible for ResNet-sized models, applying this to Large Language Models (LLMs) with hundreds of billions of parameters remains a massive challenge.
  • The Bayesian Gap: The theoretical link between free energy and predictive performance is currently most rigorous when the downstream adaptation is also performed in a Bayesian manner. Extending this guarantee to standard SGD-based fine-tuning requires deeper theoretical work.
  • Scalability: Future research will likely focus on finding more tractable computational shortcuts that can influence or estimate free energy without requiring full sampling, making this principled approach accessible for the largest foundation models.

Summary updated

BibTeX
@inproceedings{munn2025bayesian,
  author = {Michael Munn and Susan Wei},
  title = {{A Bayesian Model Selection Criterion for Selecting Pretraining Checkpoints}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=fEjktWQ5Am},
}
Figure