General Stability Analysis for Zeroth-Order Optimization Algorithms

Xinyue Liu, Hualin Zhang, Bin Gu, Hong Chen

TL;DR

Researchers have developed the first general theoretical framework to analyze the stability and generalization of Zeroth-Order (ZO) optimization algorithms—methods that optimize "black-box" systems without knowing their gradients. The study reveals that using coordinate-wise gradient estimates allows these black-box methods to achieve the same generalization performance as standard gradient-based algorithms, effectively closing a major theoretical gap.

What Problem Does This Paper Address?

In many modern AI scenarios, we lack access to the internal "gears" of a model. For example, when tuning prompts for Large Language Models or launching a "black-box" adversarial attack on a neural network, we can observe the output (the function value) but cannot calculate the exact gradient (the direction of steepest descent). This is where Zeroth-Order (ZO) optimization comes in: it approximates gradients by probing the function at different points.

While we know these algorithms can converge to a solution, we haven't had a clear picture of how well they generalize—that is, how well the resulting model performs on new, unseen data. Previous theoretical work was narrow, focusing only on specific versions of Stochastic Gradient Descent (SGD). There was no unified theory covering different algorithms (like Gradient Descent or SVRG) or different ways of estimating the gradient (like 1-point vs. coordinate-wise probes).

Methods

The authors propose a Generic Generalization Analysis Framework. Their approach relies on algorithmic stability: if you change just one sample in your training set, how much does the final model change? If the change is small, the model is "stable" and likely to generalize well.

The paper breaks down the analysis into two parts:

  1. Growth Recursion: A mathematical way to track how the "gap" between two models (trained on slightly different data) grows or shrinks at each iteration.
  2. Gradient Estimators: They analyze three main ways ZO algorithms "guess" the gradient:
  3. 1-Point: Probing the function at one random spot (high noise).
  4. 2-Point: Probing at two spots (lower noise).
  5. Coordinate-wise: Probing along every dimension of the problem (deterministic and highly accurate, but computationally expensive).

They apply this framework to three heavy-hitter algorithms: ZO-SGD, ZO-GD, and ZO-SVRG (Stochastic Variance Reduced Gradient).

Datasets

To validate their theory, the authors conducted experiments using the LIBSVM Australian Dataset, a standard benchmark for binary classification. They tested two types of models: Nonconvex Logistic Regression (with a specific nonconvex regularizer) and a Two-Layer Neural Network with ReLU activation.

Key Insights and Ideas

  • The Coordinate-Wise Advantage: The biggest takeaway is that coordinate-wise estimation is the gold standard for stability. Unlike random direction estimates (1-point or 2-point), coordinate-wise probes don't introduce an "expansion factor" that blows up the stability analysis. This means they can use larger learning rates without sacrificing generalization.
  • First-Order Parity: The theory shows that if you use coordinate-wise estimates, ZO algorithms can achieve generalization bounds of the same order as First-Order (FO) algorithms (those that have full access to gradients).
  • SVRG Breakthrough: This paper provides the first-ever generalization analysis for ZO-SVRG, a popular algorithm known for its efficiency in first-order optimization.
  • The Price of Randomness: Random gradient estimates (Gaussian or Sphere) introduce additional error terms that force a trade-off: you either accept a looser generalization bound or you must significantly reduce your learning rate.

Key Results

Theoretical Bounds: The paper provides a comprehensive summary of generalization bounds for various combinations of algorithms and estimators.

Summary of generalization bounds for various algorithms and estimators.

As shown in the table, under non-convex (NC) conditions, ZO-SGD with coordinate-wise estimates achieves a bound of $\mathcal{O}(T^{\frac{\beta C}{\beta C + 1}}/n)$, matching the best-known bounds for standard SGD.

Empirical Confirmation: Experiments showed that generalization error consistently grows with the number of iterations. As predicted, ZO-SGD generally showed the best (smallest) generalization error among the three, and coordinate-wise estimators consistently outperformed 2-point random estimators in stability.

Limitations and Future Work

  • The Dimensionality Curse: While coordinate-wise estimates are theoretically superior for stability, they require $d$ function evaluations per step (where $d$ is the number of parameters). For a model with millions of parameters, this is computationally prohibitive.
  • Smoothing Parameter $\mu$: The analysis shows that the "smoothing parameter" (how far apart you probe the function) must be carefully tuned. If it's too small, numerical precision becomes an issue; if it's too large, the gradient approximation becomes inaccurate.
  • Future Directions: The authors suggest that exploring more efficient ways to approximate coordinate-wise gradients—perhaps through "sparsity" or "subspace" methods—could bridge the gap between theoretical stability and practical speed in high-dimensional spaces.

Summary updated

BibTeX
@inproceedings{liu2024general,
  author = {Xinyue Liu and Hualin Zhang and Bin Gu and Hong Chen},
  title = {{General Stability Analysis for Zeroth-Order Optimization Algorithms}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=AfhNyr73Ma},
}
Figure