Zeroth-order (ZO) optimization is the art of minimizing a function when you cannot see its inner workings. In "black-box" scenarios—such as tuning a Large Language Model (LLM) via a restricted API or crafting adversarial attacks against a proprietary vision system—we lack the analytical gradients required for standard backpropagation. Instead, we must estimate the gradient by perturbing the input and observing how the output changes.
However, these estimates are notoriously noisy. Because they rely on finite differences along random directions, the resulting "gradient" often jitters wildly, leading to slow convergence or total optimization failure. The research direction explored here focuses on momentum-based stabilization: using the history of these noisy estimates to filter out jitter and recover a reliable path toward the optimum.
Momentum as a Low-Pass Filter
In standard first-order optimization, momentum is often viewed as a way to accelerate through flat regions. In the zeroth-order world, its role is more fundamental: it acts as a low-pass filter for noise.
As Shu et al. explain, the first-moment estimate (a moving average of past gradients) smooths out the high-variance signals inherent in finite-difference approximations. By averaging these stochastic signals over time, the optimizer can extract a consistent directional signal from what would otherwise be numerical chaos. Du et al. note that this stabilization is critical for preventing the oscillations that typically plague gradient-free methods, especially when the true gradient is unknown.
This smoothing is not just a heuristic; it is a theoretical necessity for stability. Gorbunov et al. provided some of the first rigorous convergence guarantees for "heavy ball" momentum in derivative-free frameworks, showing that momentum allows these methods to handle the noise introduced by random direction sampling.
Adapting to High-Dimensional Landscapes
When optimizing complex models like LLMs, the "noise" isn't uniform across all parameters. Some dimensions may be highly sensitive, while others are nearly flat. Adaptive momentum methods, such as Adam, address this by maintaining a second-moment estimate to scale the learning rate for each parameter.
Liu et al. introduced ZO-AdaMM, which brings this per-dimension adaptivity to the black-box setting. By maintaining moving averages of both the estimated gradients and their squares, the algorithm can adjust its step sizes to navigate complex Mahalanobis distance-based projections. Similarly, Shi et al. demonstrate that integrating adaptive step sizes is particularly effective for "heavily constrained" problems, where the optimizer must balance the objective function against a massive number of non-convex constraints.
A recent refinement by Shu et al. suggests that in ZO settings, we should use the smoothed first moment to update the second moment. This simple change further decouples the learning rate adjustment from the raw, noisy gradient estimates, leading to significant speedups in tasks like adversarial attacking.
Robustness via Clipping and Correction
Even with momentum, a single "bad" perturbation can produce an extreme gradient estimate that derails the optimization. This is especially true in quantized settings or when using very small perturbation sizes.
To counter this, the authors of QZO (Quantized Zeroth-order Optimization) propose directional derivative clipping. By constraining the magnitude of the estimated update, they prevent numerical overflows and training collapse when fine-tuning quantized LLMs.
Other approaches incorporate "look-ahead" mechanisms. Oh et al. describe a gradient correction mechanism that functions like a look-ahead momentum, stabilizing the training of visual prompts by smoothing the trajectory before the update is applied. Chen et al. further argue that combining clipping with momentum is essential for "Zeroth-Order Tuning" (ZOT) of LLM prompts, as it mitigates the variance inherent in finite-difference estimates while ensuring consistent directional updates.
Efficiency in the Large Model Era
The primary motivation for these stabilized ZO methods is efficiency. Traditional fine-tuning requires storing full gradients, which consumes massive amounts of GPU memory.
- Memory Savings: Petrov et al. demonstrate that by using memory-optimized ZO algorithms like JAGUAR, researchers can achieve competitive performance on LLM tasks with a fraction of the memory cost.
- Query Efficiency: In adversarial settings, Du et al. show that momentum-stabilized search directions allow for "input-free" attacks that require orders of magnitude fewer queries to the target model.
- Black-Box Adaptation: Wei et al. show that momentum-based ZO can even rival white-box fine-tuning for vision-language models like CLIP, enabling adaptation through restricted interfaces that provide no internal gradient information.
By treating momentum not just as an accelerator but as a variance-reduction tool, this research direction makes it possible to optimize the world's largest and most opaque models using only their outputs.
Key Foundational Work
ZO-AdaMM: Zeroth-Order Adaptive Momentum Method for Black-Box Optimization (2019) — contributed 2 concept elements to this direction.
Towards Query Efficient Black-box Attacks: An Input-free Perspective (2018) — contributed 1 concept elements to this direction.