NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Revisiting Zeroth-Order Optimization: Minimum-Variance Two-Point Estimators and Directionally Aligned Perturbations

Shaocong Ma, Heng Huang

Introduction

Zeroth-order optimization (ZOO) serves as a critical tool for optimizing objective functions where explicit gradient information is unavailable or prohibitively expensive to compute. This "black-box" approach is increasingly relevant in modern machine learning, particularly for adversarial robustness testing, reinforcement learning, and the fine-tuning of large-scale models where backpropagation exceeds memory constraints.

The standard paradigm in ZOO involves the use of two-point gradient estimators, which approximate the gradient by perturbing the input in a random direction and measuring the change in output. Historically, these perturbations have been drawn from isotropic distributions, such as Gaussian or uniform spherical noise. However, these estimators are often plagued by high variance, slowing convergence. This paper challenges the status quo by asking a fundamental question: Is there an optimal distribution of noise that minimizes the variance of gradient estimates?

Theoretical Foundation: Minimum-Variance Perturbations

The authors approach the problem of noise selection as a constrained functional optimization task. By analyzing the asymptotic variance of two-point estimators, they identify a specific class of distributions that minimize variance. Their findings reveal that optimal perturbations $v$ must satisfy one of two geometric conditions:

  1. Constant Magnitude: The vector maintains a fixed length (e.g., uniform sampling on a sphere).
  2. Directional Alignment: The magnitude of the inner product between the perturbation and the true gradient remains constant.

A significant theoretical contribution of this work is the demonstration that Gaussian noise—the most common choice in ZOO literature—is actually suboptimal. This is due to its high kurtosis (heavy tails), which introduces unnecessary variance compared to distributions with more concentrated mass.

Directionally Aligned Perturbations (DAPs)

Building on the insight of directional alignment, the authors introduce Directionally Aligned Perturbations (DAPs). While the true gradient is unknown, DAPs leverage the fact that even a noisy estimate can provide a useful "direction" for subsequent perturbations. The proposed algorithm follows a three-step process:

  • Pilot Estimation: A small batch of standard uniform perturbations is used to generate a rough "pilot" estimate of the gradient direction.
  • Alignment: New perturbations are generated and projected onto a hyperplane aligned with this pilot direction. This concentrates the search budget in directions likely to yield the most information.
  • Final Update: The estimates are combined to produce a high-fidelity, low-variance gradient update.

This approach introduces anisotropy into the optimization process. While traditional methods treat all directions as equally likely, DAPs adaptively prioritize directions where the gradient magnitude is expected to be large, which is particularly effective in high-dimensional spaces with sparse gradients.

Experimental Validation

The efficacy of DAPs was evaluated across three distinct domains:

1. Synthetic Benchmarks

On high-dimensional quadratic and product functions ($d=16$), DAPs were tested against Gaussian and uniform noise. In scenarios involving extreme gradient sparsity—where only a few dimensions significantly impact the output—DAPs achieved a Mean Squared Error (MSE) several orders of magnitude lower than traditional methods.

2. Large Language Model Fine-tuning

The authors applied ZOO to fine-tune the OPT-1.3b model on the SST-2 (Stanford Sentiment Treebank) dataset. This is a challenging task for ZOO due to the massive parameter space. DAPs demonstrated superior performance, converging faster and achieving a lower final training loss than standard zeroth-order techniques, showcasing the practical utility of aligned perturbations in LLM adaptation.

3. Scientific Computing: Mesh Optimization

In a 2D Poisson’s equation mesh optimization task, the goal was to adjust vertex positions to minimize numerical error. DAPs proved significantly more adept at identifying and optimizing the "corners" and edges of the mesh—regions where gradient information is most critical but typically difficult to estimate accurately.

Discussion and Limitations

The paper provides a unified theoretical framework for ZOO by introducing a convergence analysis for Stochastic Gradient Descent (SGD) using any "$\delta$-unbiased" perturbation. This framework encompasses both traditional spherical noise and the newly proposed DAPs.

However, the authors note several practical considerations:

  • Computational Overhead: The two-step estimation process and the projection operations require more memory and computation than simple random sampling.
  • Pilot Sensitivity: The success of DAPs depends on the quality of the initial pilot estimate. If the pilot is highly inaccurate, the subsequent aligned perturbations may introduce bias.
  • Gradient Density: The advantages of DAPs are most pronounced in sparse settings. In problems where gradients are dense and every dimension is equally influential, the relative benefit of directional alignment may decrease.

Conclusion

By revisiting the fundamental assumptions of zeroth-order optimization, this work demonstrates that the choice of perturbation distribution is a critical factor in estimator performance. Directionally Aligned Perturbations offer a theoretically grounded and empirically effective alternative to standard isotropic noise, particularly for high-dimensional and sparse optimization problems.

Summary updated

BibTeX
@inproceedings{ma2025revisiting,
  author = {Shaocong Ma and Heng Huang},
  title = {{Revisiting Zeroth-Order Optimization: Minimum-Variance Two-Point Estimators and Directionally Aligned Perturbations}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=ywFOSIT9ik},
}
Figure