Probabilistic Line Searches for Stochastic Optimization

Maren Mahsereci, Philipp Hennig

Introduction

Stochastic Gradient Descent (SGD) is the workhorse of modern machine learning, but it has a major Achilles' heel: the learning rate (step size). If it's too large, the model diverges; if it's too small, training takes forever.

In "deterministic" optimization (where you have exact gradients), we use line searches—subroutines that explore a search direction to find an "acceptable" step size before moving on. However, these traditional methods fail in the "stochastic" world of machine learning because gradients are noisy. A single noisy measurement can trick a standard line search into making a "hard" decision (like shrinking the search space) that is catastrophically wrong. Consequently, researchers usually resort to manual tuning or heuristic "schedules" to manage the learning rate.

This paper introduces a probabilistic line search for stochastic optimization, effectively automating the most tedious part of training neural networks: tuning the learning rate. By modeling the loss function with a Gaussian process and using a probabilistic version of the classic "Wolfe conditions," the algorithm adapts the step size on the fly, making SGD robust to its initial settings.

Methods: Bridging Deterministic Search and Bayesian Optimization

The authors bridge the gap between deterministic line searches and Bayesian optimization. Their method relies on three main components:

  1. A Lightweight Gaussian Process (GP) Surrogate: They model the univariate objective function along the search direction using a GP with a specific "once-integrated Wiener process" kernel. This choice is clever because the resulting posterior mean is a cubic spline, allowing the algorithm to find local minima analytically and near-instantaneously.
  2. Probabilistic Wolfe Conditions: Traditional line searches use the "Wolfe conditions" (Armijo and curvature conditions) as a checklist to decide if a point is good enough. Since measurements are noisy, this paper calculates the probability that these conditions are met. A point is accepted only if this probability exceeds a threshold (e.g., $c_W = 0.3$).
  3. Bayesian Exploration: To decide where to sample next during the line search, the algorithm uses Expected Improvement (EI), a standard tool from Bayesian optimization, weighted by the probability of satisfying the Wolfe conditions.
Gaussian Process surrogate and the resulting probabilities for Armijo, curvature, and Wolfe conditions.

Crucially, the method is designed to be parameter-free. It estimates noise levels directly from the data batches and uses standardized settings for the internal GP, meaning the user doesn't have to tune the "tuner."

Key Insights and Results

The paper treats each step of the optimizer as a tiny, one-dimensional global optimization problem. By choosing a kernel that results in cubic splines, the authors avoid the need for nested optimization loops within the line search. Finding the "best" candidate point becomes a simple quadratic calculation.

Furthermore, instead of fearing noise, the algorithm embraces it. By calculating the variance of the gradients within a batch, the line search knows exactly how much to "trust" its current view of the loss landscape. The algorithm also standardizes the objective function internally, ensuring that it works regardless of whether your loss values are in the millions or the thousandths.

Behavior of the probabilistic line search across various scenarios, including extrapolation, interpolation, and high-noise environments.

In experiments on MNIST and CIFAR-10 (using 2-layer neural networks), the probabilistic line search demonstrated extreme robustness. It reached near-optimal performance even when the initial learning rate was varied across five orders of magnitude ($10^{-4}$ to $10^1$). In contrast, standard SGD failed or converged extremely slowly at the fringes of that range.

The computational cost is minimal. Estimating noise adds only about 1% overhead to the loss evaluation, and the line search itself takes roughly 48ms on a laptop. On average, the line search required only ~1.4 function evaluations per step. In 80-90% of cases, it accepted the first point it checked, showing that it adapts its internal scale effectively over time.

Limitations and Future Work

While highly effective, the method has a few limitations:

  • Search Direction: This method only tunes the step size, not the direction. It is intended to be a complement to, not a replacement for, methods like Adam or BFGS that try to find better search directions.
  • Batch Size Dependency: The noise estimation requires a batch size $m > 1$. While it can work with unit-batch SGD using running averages, it is most natural in mini-batch settings.
  • Scaling to Modern Architectures: The paper demonstrates results on 2-layer networks. While the line search logic is independent of dimensionality, further work is needed to see how it interacts with the highly non-convex landscapes of very deep Transformers or ResNets.

Summary updated

BibTeX
@inproceedings{mahsereci2015probabilistic,
  author = {Maren Mahsereci and Philipp Hennig},
  title = {{Probabilistic Line Searches for Stochastic Optimization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2015},
}
Figure