Learning Optimal Linear Regularizers

Matthew StreeterICML 2019

In machine learning, achieving high performance on training data is only half the battle; the true goal is building models that generalize well to unseen data. To prevent overfitting and encourage generalization, practitioners rely on regularization techniques like $L_1$, $L_2$, or Dropout, which penalize overly complex models.

However, finding the right "strength" for these regularizers—the hyperparameters—is notoriously difficult and computationally expensive. Standard approaches rely on "black-box" methods like grid search, random search, or Bayesian optimization. Because these methods do not inherently model the relationship between the regularizer and the loss landscape, they require dozens or hundreds of training runs to find optimal settings.

This paper introduces a novel approach that turns hyperparameter tuning into a supervised learning problem, allowing researchers to "jump" directly to optimal regularization hyperparameters using linear programming. By viewing regularizers as upper bounds on the generalization gap, the authors develop an algorithm that finds near-optimal settings in an order of magnitude fewer training runs than state-of-the-art Bayesian optimization.

The Core Insight: Regularizers as Bounds

The foundational idea of this work is that a regularizer is essentially a proxy for the generalization gap (the difference between test loss and training loss). If a regularizer perfectly predicts that gap, minimizing the "regularized training loss" is mathematically equivalent to minimizing the true, invisible test loss.

To formalize this, the authors define a metric called Suboptimality-Adjusted Slack (SAS). They argue that a good regularizer does not need to be accurate everywhere in the parameter space; it only needs to provide a tight upper bound on the generalization gap specifically at points near the optimal model.

Illustration of the generalization gap and Suboptimality-Adjusted Slack (SAS).

Based on this insight, the authors propose two primary algorithms for linear regularizers (regularizers that can be expressed as a linear combination of features, e.g., $\lambda_1 \cdot \|w\|_1 + \lambda_2 \cdot \|w\|_2^2$):

  1. LearnLinReg: This algorithm takes a small set of previously trained models (where training and validation losses are known) and uses Linear Programming (LP) to find the regularization parameters that minimize the worst-case SAS.
  2. TuneReg: This is an iterative, practical application of the concept. It starts with a few random training runs, uses LearnLinReg to predict the optimal hyperparameters, trains a new model with those settings, and repeats the process.

Under certain Bayesian assumptions (specifically involving exponential families and conjugate priors), the authors prove a "Jump" property: their algorithm can theoretically find the perfect regularizer using as few as $k+1$ training runs, where $k$ is the number of hyperparameters.

Empirical Validation and Key Results

The authors evaluated TuneReg and LearnLinReg across three distinct problems to test their theoretical claims:

  • Synthetic Coin Flips: A simplified problem used to prove the theoretical "Bayesian optimality" of the approach.
  • MNIST Softmax Regression: Classifying handwritten digits using a variant of the LeNet architecture, focusing on the final layer to ensure a convex optimization landscape.
  • ImageNet Transfer Learning: Retraining the final layer of a pre-trained Inception-v3 model to classify a public Flowers dataset.
Generalization gap and losses for the coins problem and MNIST softmax.

Across these experiments, the proposed method demonstrated significant advantages:

  • Drastic Efficiency Gains: TuneReg reached near-optimal validation loss significantly faster than competing methods. It typically required an order of magnitude fewer training runs than standard Bayesian optimization (GP-EI-MCMC) or random search.
  • Strong Predictive Power: For the synthetic coin flip problem, the algorithm perfectly recovered the optimal hyperparameters. For more complex tasks like MNIST and ImageNet, it consistently outperformed state-of-the-art alternatives, successfully bounding the generalization gap.
  • Explaining L2 Dominance: In the softmax regression experiments, the framework revealed that $L_2$ regularization provides a much lower "suboptimality-adjusted slack" than $L_1$ or label smoothing. This provides a theoretical grounding for why $L_2$ is so frequently the preferred choice for such models.

Limitations and Future Directions

While highly efficient, the current framework has a few limitations. First, it focuses strictly on linear regularizers. While the authors demonstrate how to approximate non-linear implicit regularizers (like Dropout) using this method, a native non-linear formulation could potentially be more powerful. Second, because the method relies on a validation set to proxy the test set, a biased or overly small validation set will cause the linear program to output suboptimal regularizers for real-world deployment.

Looking forward, the authors suggest exploring "online" variants of TuneReg that adjust hyperparameters dynamically during a single training run, which could reduce computational costs even further. Additionally, by providing the algorithm with a massive library of basis features, this framework could eventually be used to discover entirely novel, mathematically optimal regularizers that humans have not yet conceptualized.

Summary updated

BibTeX
@inproceedings{streeter2019learning,
  author = {Matthew Streeter},
  title = {{Learning Optimal Linear Regularizers}},
  booktitle = {International Conference on Machine Learning},
  year = {2019},
}
Figure