Learning Hyperparameters via a Data-Emphasized Variational Objective

Ethan Harvey, Mikhail Petrov, Michael C Hughes

TL;DR

Tuning hyperparameters for large-scale models usually requires grueling grid searches and sacrificing precious training data for validation sets. This paper introduces the Data-Emphasized ELBo (DE ELBo), a modified variational objective that enables direct gradient-based hyperparameter learning on the full training set, slashing tuning times from days to hours without losing accuracy.

What Problem Does This Paper Address?

When we train massive models (like deep neural networks) on small datasets, we face a classic "Goldilocks" problem: how much regularization is just right? Too little, and the model overfits; too much, and it underfits.

The standard industry solution is Grid Search or Bayesian Optimization, which involve training the model dozens or hundreds of times with different settings and checking performance on a "validation set." This is incredibly slow and wasteful, especially since the validation data can't be used to actually train the model's weights.

In theory, Bayesian methods offer a "one-and-done" solution: the Evidence Lower Bound (ELBo). By maximizing the ELBo, we should be able to learn both the model weights and the hyperparameters simultaneously via gradients. However, in practice, the ELBo fails for over-parameterized models ($D$ parameters $\gg N$ data points). It tends to "collapse" to the prior, leading to severe underfitting. The authors set out to find out why this happens and how to fix it.

Methods

The authors identify that the failure of the standard ELBo stems from a mismatch between the complexity of the model and the simplicity of the approximate posterior (usually an isotropic Gaussian).

  • The Standard ELBo: Balances fitting the data (Likelihood) against staying close to the prior (KL Divergence).
  • The Innovation (DE ELBo): They introduce a scaling factor $\kappa$ to upweight the likelihood term: $$J_{DE ELBo} := \kappa \cdot \mathbb{E}_{q} [\log p(y|\theta)] - KL(q||p)$$
  • The Heuristic: They recommend setting $\kappa = D/N$. This effectively balances the "pull" of the $D$-dimensional prior against the $N$ available data points.

By using this modified objective, researchers can treat hyperparameters (like weight decay or kernel length-scales) as learnable parameters that are updated via backpropagation alongside the model's weights.

Datasets

The authors evaluated their approach across several domains:

  • Image Classification: CIFAR-10, Oxford-IIIT Pet, and 102 Category Flower.
  • Text Classification: AG News (News-4).
  • Toy Regression: A univariate dataset used to compare against "Gold Standard" Gaussian Processes.
  • Architectures: They tested the method on modern backbones including ResNet-50, ConvNeXt-Tiny, ViT-B/16, and BERT-base.

Key Insights and Ideas

  • The "Prior Collapse" Proof: The authors provide a mathematical lemma showing that as the number of parameters ($D$) goes to infinity, the standard ELBo's optimal posterior variance ignores the data entirely and just matches the prior. This explains why standard Bayesian neural nets often underfit.
  • $\kappa = D/N$ is the Magic Ratio: By scaling the data influence by the ratio of parameters to data points, the objective remains "data-aware" even in the extreme over-parameterized regime.
  • No Validation Set Needed: Because the DE ELBo acts as a proxy for the marginal likelihood, you can use 100% of your labeled data for training. This is a massive advantage in "low-data" regimes.
  • Continuous Hyperparameter Optimization: It transforms the discrete, expensive search for hyperparameters into a continuous optimization problem that can be solved with standard tools like Adam or SGD.

Key Results

  • Massive Speedups: In Bayesian transfer learning tasks, DE ELBo reduced an 88.5-hour grid search to just 2.2 hours (for ResNet-50 on CIFAR-10) while achieving comparable accuracy.
  • Superior Performance with Small Data: On CIFAR-10 with only $N=100$ samples, DE ELBo outperformed the best grid-searched models by over 5% in test accuracy.
  • GP Approximation: The method allows Random Fourier Features (RFF) to accurately approximate Gaussian Processes while learning their own length-scales—something previously difficult to do efficiently.

Limitations and Future Work

  • Continuous Only: The method requires gradients, meaning it only works for continuous hyperparameters. Discrete choices (like the number of layers or specific activation functions) still require traditional search methods.
  • Isotropic Assumption: The current work focuses on isotropic Gaussian posteriors (one variance for all parameters). The authors conjecture it would work for diagonal covariances but haven't yet explored more complex posterior shapes.
  • Variance Underestimation: In regression tasks, the model tends to underestimate uncertainty (predictive variance) when moving far away from the training data points.
  • Theoretical Depth: While the $D/N$ heuristic works empirically across many datasets, a more rigorous theoretical derivation of this specific constant remains an open challenge.

Summary updated

BibTeX
@inproceedings{harvey2026learning,
  author = {Ethan Harvey and Mikhail Petrov and Michael C Hughes},
  title = {{Learning Hyperparameters via a Data-Emphasized Variational Objective}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2026},
  url = {https://openreview.net/forum?id=O2blXNfb0b},
}
Figure