TL;DR
When backpropagation uses too much memory—such as during large language model fine-tuning—we can optimize models using only forward passes, a technique called Zeroth-Order (ZO) optimization. However, modern machine learning gradients are notoriously "heavy-tailed," producing massive noise spikes that break standard ZO algorithms. This paper introduces RSC-ZO, a simple, theoretically grounded fix that clips individual directional measurements before averaging them, restoring stability and boosting LLM fine-tuning accuracy by up to 9 percentage points.
What Problem Does This Paper Address?
Imagine trying to walk down a foggy mountain without being able to feel the slope beneath your feet. Instead, you can only check your altitude at random spots around you. That is Zeroth-Order (ZO) optimization: estimating gradients using only function evaluations (forward passes). Recently, ZO methods like MeZO have become popular for memory-efficient LLM fine-tuning because they skip storing massive activation graphs for backpropagation.
Classical ZO theory assumes the noise in your altitude readings is well-behaved (bounded variance). Reality disagrees. Empirical studies in BERT pretraining, computer vision, and reinforcement learning show that stochastic gradient noise is often heavy-tailed—meaning extreme outliers happen frequently enough that the variance can be mathematically infinite.
In standard gradient descent (first-order), we tame heavy tails with gradient clipping. Why not just port that over to ZO? Because in ZO, you never actually see the gradient. You only observe noisy scalar differences along random directions. Prior heavy-tailed ZO research was mostly restricted to simpler convex problems. How to get high-probability convergence guarantees on smooth, nonconvex landscapes (like neural networks) under heavy-tailed noise remained an open puzzle.
Methods
The authors propose the Robust Scalar-Clipped Zeroth-Order method (RSC-ZO), built around a subtle shift in when we apply clipping.
In standard two-point ZO, you pick $M$ random directions on a unit sphere. For each direction $u_\ell$, you evaluate the loss at $x + \mu u_\ell$ and $x - \mu u_\ell$ (sharing the same random data sample $\xi_\ell$ for both) to compute a scalar finite-difference slope $Y_\ell$. Normally, you multiply each scalar slope by its direction vector, average them into a pseudo-gradient, and step.
- What's new (Scalar Clipping Before Aggregation): Instead of averaging the directional estimates and clipping the final vector, RSC-ZO clips each individual scalar slope $Y_\ell$ to a threshold $\tau$ before multiplying by the direction $u_\ell$ and averaging.
- Weaker Noise Assumptions: The authors prove convergence under a "weak-$L_p$ tail condition" ($p \in (1, 2]$) on the unobserved sample gradients. This is strictly weaker than the standard bounded $p$-th moment assumption—even at $p=2$, it permits infinite variance.
- Momentum Variant: Because high-probability bounds usually demand large batch sizes ($M$), the authors also introduce a momentum variant. After an initial larger "warm-start" batch at step zero, momentum averages estimates over time, allowing the running batch size to drop all the way to $M = 1$ without sacrificing overall query efficiency.
Datasets
No new benchmarks are introduced. The authors evaluate their approach in two settings:
- Prompt-based LLM Fine-Tuning (512 training examples per task on RoBERTa-large):
- SNLI and MNLI (natural language inference).
- TREC (topic classification).
- Controlled Synthetic Benchmark: A $d$-dimensional quadratic objective corrupted by sparse, heavy-tailed Pareto noise (finite mean, infinite variance) to isolate estimator behavior.
Key Insights and Ideas
- Why vector clipping fails in ZO: If one random probe hits a massive noise spike, multiplying that huge scalar by its random direction completely hijacks the sum of the batch. Clipping the final aggregated vector shrinks its length, but preserves its corrupted direction. Scalar clipping before aggregation quarantines the outlier to a single probe, keeping the overall direction aligned with the true gradient.
- Bridging invisible gradients to visible values: A major theoretical hurdle here is that the heavy-tail assumption lives on the unobserved true sample gradients, while the algorithm only sees function values. Using shared randomness per pair of evaluations, the authors mathematically transfer tail bounds from invisible vectors to scalar finite differences.
- Momentum trades stepsize for batch size: Adding momentum $\beta$ shrinks the required batch size per step by $(1-\beta)$, though stability forces you to shrink your learning rate by the same factor. You take more steps, but each step is proportionally cheaper—letting you run lean single-direction updates ($M=1$).
Key Results
- Optimal Theoretical Complexity: RSC-ZO achieves a high-probability query complexity of $\widetilde{O}\left(d^{\frac{p}{2(p-1)}} \varepsilon^{-\frac{3p-2}{p-1}}\right)$ to find an $\varepsilon$-stationary point. This matches the optimal $\varepsilon$-dependence of first-order heavy-tailed methods. At $p=2$, it recovers the classic $\widetilde{O}(d\varepsilon^{-4})$ ZO rate, but with high probability and allowing infinite variance.
- LLM Fine-Tuning Gains: On RoBERTa-large (350M parameters), RSC-ZO substantially outperforms unclipped MeZO across the board, even with just a single direction ($M=1$):
- SNLI: 83.0% vs. 74.2% (MeZO)
- MNLI: 76.9% ($M=4$) / 75.5% ($M=1$) vs. 67.9% (MeZO)
- TREC: 93.5% ($M=4$) / 92.4% ($M=1$) vs. 83.2% (MeZO)
- Plug-and-Play Improvement: Applying scalar clipping to LOZO (a low-rank ZO method) similarly boosts accuracy across all tasks, hitting 94.6% on TREC (up from 89.8%).
Limitations and Future Work
- Shared Randomness & Smoothness: The theoretical guarantees require smooth sample functions and shared randomness—meaning you must evaluate $x + \mu u$ and $x - \mu u$ on the exact same data minibatch/seed. It does not cover nonsmooth objectives or black-box systems where noise is independent on every query.
- Tuning the Clipping Threshold: In theory, setting $\tau$ requires knowing problem-specific constants (like smoothness $L$). In practice, it has to be tuned via grid search. Designing adaptive clipping rules with matching guarantees is a key next step.
- The Curse of Dimensionality: Even at $p=2$, query complexity scales linearly with parameter count $d$. Combining scalar clipping with low-dimensional subspace methods (as previewed in their LOZO experiment) is a promising path for scaling to much larger models.
Summary updated