Abstract
This paper introduces Safeguarded Stochastic Polyak Step sizes ($SPS_{safe}$), a robust adaptive optimization technique designed for non-smooth problems. Unlike traditional Stochastic Polyak Step sizes (SPS), $SPS_{safe}$ does not require interpolation assumptions or oracle knowledge of the optimal loss. By capping the denominator of the Polyak formula, the method prevents step size explosions caused by vanishing gradients. Theoretical analysis confirms an $O(1/\sqrt{T})$ convergence rate, while empirical results on deep learning tasks demonstrate superior stability and performance compared to existing heuristics.
Introduction
In the landscape of optimization for machine learning, the Stochastic Polyak Step size (SPS) has emerged as a compelling alternative to gradient-history-based optimizers like Adam. By adapting the learning rate based on the current function value (the "loss"), SPS offers a more direct form of adaptivity. However, standard SPS faces significant challenges in non-smooth settings, such as training neural networks with ReLU activations or Support Vector Machines (SVMs).
Specifically, standard SPS suffers from three primary "Achilles' heels":
- The Interpolation Trap: Convergence theory often relies on the assumption that the model can perfectly fit the data (zero loss at the optimum).
- The Oracle Requirement: Many variants require knowing the exact minimum loss ($f^*$) in advance.
- Exploding Steps: When gradients become small (vanishing gradients), the gradient norm in the denominator causes the step size to explode, leading to numerical instability.
Methodology: Safeguarded SPS
To address these issues, we propose Safeguarded SPS ($SPS_{safe}$). The core innovation is a modification to the denominator of the Polyak update rule:
$$\gamma_t = \frac{f_i(x^t) - \ell_i^*}{\max\{\|g_i^t\|^2, M\}}$$
In this formulation, $f_i(x^t) - \ell_i^*$ represents the gap between the current loss and a known lower bound (typically zero in machine learning). The "Safeguard" is the term $\max\{\|g_i^t\|^2, M\}$, which prevents the denominator from dropping below a threshold $M$. Unlike previous methods that clipped the entire step size, capping the denominator maintains genuine adaptivity while preventing numerical instability. This logic is further extended to momentum-based methods via the Iterate Moving Average (IMA) framework.
Theoretical Insights
The $SPS_{safe}$ method provides a theoretical bridge to common deep learning practices. We demonstrate that $SPS_{safe}$ is algebraically equivalent to a form of adaptive clipped subgradient method, providing a rigorous foundation for why gradient clipping is effective.
Key theoretical contributions include:
- No Oracle Needed: The method only requires a lower bound $\ell_i^*$, avoiding the need for the exact optimal value $f(x^*)$.
- Optimal Convergence: We prove that $SPS_{safe}$ achieves an $O(1/\sqrt{T})$ convergence rate for non-smooth convex functions, matching the theoretical optimum for this class.
- Robustness: By "boosting" small gradients through the safeguard $M$, the optimizer maintains a consistent signal even when gradients would otherwise collapse.
Experimental Evaluation
We validated $SPS_{safe}$ across synthetic benchmarks (SVM, Phase Retrieval) and standard computer vision tasks using ResNet and WideResNet architectures on CIFAR-10 and CIFAR-100.
Empirical results highlight the stability of the proposed method. As shown in the figure above, while "Smooth SPS" heuristics exhibit high volatility and large peaks in step size, $SPS_{safe}$ remains remarkably stable. On CIFAR-10 with ResNet-20, $SPS_{safe}$ achieved a top accuracy of 90.39%, outperforming previous Polyak variants and remaining competitive with highly tuned Adam/SGD baselines. Furthermore, the hyperparameter $M=1.0$ proved robust across various architectures and datasets.
Conclusion and Future Work
$SPS_{safe}$ offers a mathematically grounded and practically stable approach to adaptive optimization. While current convergence proofs are focused on convex functions, the strong empirical performance on non-convex neural networks suggests broader applicability. Future research will focus on extending theoretical guarantees to the non-convex regime and exploring automated methods for setting the safeguard parameter $M$ to move toward a parameter-free optimizer.
Summary updated