Using Statistics to Automate Stochastic Optimization

Hunter Lang, Lin Xiao, Pengchuan Zhang

Tuning learning rate schedules is notoriously one of the most tedious and time-consuming parts of training deep neural networks. While adaptive optimizers exist, they often fall short of the peak performance achieved by manual tuning. This paper introduces SASA (Statistical Adaptive Stochastic Approximation), an algorithm that uses rigorous statistical hypothesis testing to detect when training progress has stalled, automatically "cutting" the learning rate to match the performance of expert hand-tuned schedules without the manual effort.

The Problem: Manual Tuning vs. Adaptive Optimizers

In deep learning, the "Gold Standard" for optimization is often Stochastic Gradient Descent with Momentum (SGM) paired with a "constant-and-cut" learning rate schedule. This involves keeping the learning rate constant until the validation error plateaus, then dropping it by a significant factor (e.g., 10x) and repeating the process.

Test accuracy demonstrating the superiority of hand-tuned step drops (SGM-hand) over Adam and continuous decay methods.

While highly effective—often yielding sudden, massive jumps in test accuracy—this process is entirely manual and computationally expensive. Researchers are forced to guess the optimal epochs to drop the rate. Popular adaptive optimizers like Adam or RMSProp attempt to solve this by changing the learning rate at every step. However, they frequently fail to reach the same peak generalization performance as a well-tuned SGM schedule. The authors aim to bridge this gap: achieving the high performance of "constant-and-cut" SGM with the "set-it-and-forget-it" convenience of adaptive methods.

Methods: Statistical Adaptive Stochastic Approximation (SASA)

The authors propose SASA to automate the decision of when to drop the learning rate. Rather than relying on arbitrary epoch milestones, SASA monitors the optimization process and triggers a drop based on statistical evidence.

Algorithm 1: General SASA method

Its core components include:

  • Stationarity Detection: The algorithm monitors a specific mathematical condition. When an optimizer with a constant learning rate stops making meaningful progress, it reaches a "stationary distribution." Here, the gradients and weights fluctuate around a local minimum in a predictable, equilibrium state.
  • Markov Chain t-test: Standard statistical tests assume data points are independent. However, optimization steps are highly correlated (your current weights depend heavily on your previous weights). SASA uses a specialized "Markov chain Central Limit Theorem" to perform a t-test that properly accounts for these correlations.
  • Batch Mean Variance Estimator: To make the test robust, SASA uses a "batch means" approach to estimate the variance of the optimization trajectory. It divides recent samples into batches to calculate how much the "progress signal" is actually vibrating versus just drifting.
  • The Procedure: The model trains normally. At the end of every epoch, it runs the statistical test. If the test "fires" (indicating the system has reached stationarity), the learning rate is multiplied by a drop factor $\zeta$ (e.g., 0.1), the statistics are reset, and training continues.

Key Insights and Results

The authors evaluated SASA on several standard benchmarks, including training an 18-layer ResNet on CIFAR-10 and ImageNet, as well as training an RNN for language modeling on WikiText-2.

1. Stationarity as a Superior Signal Instead of just looking at whether the loss curve looks "flat," SASA looks for a specific equilibrium between the weights, gradients, and momentum. This provides a much more principled and mathematically sound way to define "stalled progress."

2. Matching Human Experts and Outperforming Adam On CIFAR-10 and ImageNet, SASA automatically found learning rate schedules that matched the final accuracy of meticulously hand-tuned SGM schedules. Furthermore, in vision tasks, SASA achieved better generalization (higher test accuracy) than Adam, even when Adam was given a tuned "warmup" phase.

3. Self-Correcting Robustness A fascinating insight is that SASA is relatively insensitive to the exact "drop factor" ($\zeta$). If you choose a conservative drop factor (e.g., only cutting the rate by half instead of a tenth), the system will simply reach stationarity again sooner, and the statistical test will fire again. The algorithm also worked across different architectures (CNNs and RNNs) using the same default statistical parameters, proving it doesn't just trade one tuning problem for another.

Limitations and Future Work

While SASA is a powerful step toward fully automated training, it has a few limitations:

  • Initial Learning Rate: SASA automates the schedule, but it still requires a reasonable initial learning rate ($\alpha_0$) to get off the ground.
  • Weight Decay Dependency: The mathematical theory behind the stationarity test assumes the use of weight decay (L2 regularization). Without it, the optimization dynamics might not converge to a stationary distribution, potentially confusing the test.
  • Complex Dynamics: The current test assumes the optimizer reaches a steady state. It doesn't explicitly account for more complex behaviors like "limit cycles" or extreme overfitting, which remain open areas for future research.
  • Multiple Testing: Running a statistical test every epoch increases the chance of a "false positive" (dropping the rate too early). While addressed with a "burn-in" phase, more sophisticated corrections for sequential testing could yield further improvements.

Summary updated

BibTeX
@inproceedings{lang2019using,
  author = {Hunter Lang and Lin Xiao and Pengchuan Zhang},
  title = {{Using Statistics to Automate Stochastic Optimization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2019},
  url = {https://openreview.net/forum?id=SCGWPQI8Tgq},
}
Figure