Abstract
Zeroth-Order (ZO) optimization is often employed as a last-resort alternative to gradient-based methods when backpropagation is computationally infeasible or impossible. This paper reveals that ZO optimization possesses a unique "implicit regularization" property: it naturally gravitates toward flat minima. By proving that the standard two-point ZO estimator implicitly minimizes the trace of the Hessian, the authors provide a theoretical foundation for why ZO methods generalize effectively in high-dimensional tasks, including the fine-tuning of Large Language Models (LLMs).
Introduction
In modern machine learning, "black-box" scenarios and severe memory bottlenecks—such as those encountered when fine-tuning 30-billion parameter LLMs—frequently preclude the use of standard gradient descent (GD). Zeroth-Order (ZO) optimization, which estimates gradients using only function values, serves as a critical workaround. However, while the convergence of ZO methods is well-documented, the specific nature of the solutions they find in complex landscapes remained unclear. This research investigates whether ZO optimization has an inherent bias toward "flat minima"—regions where the loss function changes slowly—which are known to generalize better than "sharp" minima.
Theoretical Framework: The Implicit Regularizer
The authors focus on the standard two-point gradient estimator, which approximates the gradient by perturbing the parameters $x$ with a random vector $u$ and a smoothing parameter $\lambda$: $$g_\lambda(x, u) := \frac{f(x + \lambda u) - f(x - \lambda u)}{2\lambda}u$$
Using a Taylor expansion, the authors demonstrate that the expected value of this estimator corresponds to the gradient of a smoothed surrogate function $f_\lambda(x)$: $$f_\lambda(x) \approx f(x) + \frac{\lambda^2}{2} \text{Tr}(\nabla^2 f(x))$$
This derivation reveals that ZO optimization does not merely minimize the original loss $f(x)$; it simultaneously penalizes the trace of the Hessian, a standard metric for sharpness. Consequently, the smoothing parameter $\lambda$, typically viewed as a hyperparameter to be minimized for precision, actually functions as a regularization knob: larger values of $\lambda$ exert a stronger push toward flatter regions of the loss landscape.
Experimental Validation
The theoretical findings were validated across synthetic functions, binary classification tasks (SVMs and Logistic Regression on LIBSVM datasets like a5a and w5a), and LLM fine-tuning (RoBERTa-Large on SST-2, SST-5, and TREC).
Hessian Trace Reduction
In experiments with overparameterized SVMs and Logistic Regression, ZO optimization consistently achieved a significantly lower Hessian trace compared to standard GD, even when both methods reached comparable training losses. This confirms that ZO naturally finds more robust, flat solutions simply by the way it estimates gradients, without requiring explicit penalty terms like Sharpness-Aware Minimization (SAM).
LLM Fine-Tuning and Memory Efficiency
On RoBERTa-Large tasks, ZO optimization decreased the estimated trace of the Hessian throughout training, aligning with theoretical predictions. Furthermore, the experiments confirmed substantial memory savings: fine-tuning on SST-2 required only 3,074 MiB for ZO compared to 7,986 MiB for GD, highlighting ZO's utility for resource-constrained environments where backpropagation is too expensive.
Conclusion and Limitations
This work provides the first rigorous convergence analysis showing that ZO optimization converges to approximate flat minima. While the current theory relies on convexity assumptions, the empirical success in non-convex LLM landscapes suggests a broader applicability. Future research is needed to address the high variance of ZO estimators and to extend these theoretical guarantees to fully non-convex settings.
Summary updated