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

PaZO: Preconditioned Accelerated Zeroth-Order Optimization for Fine-Tuning LLMs

Hanzhen Zhao, Shihong Ding, Cong Fang, Zhouchen LinNeurIPS 2025

Introduction

Fine-tuning massive Large Language Models (LLMs) typically requires an enormous memory overhead, primarily due to the demands of backpropagation. To address this, researchers have explored memory-efficient "zeroth-order" (ZO) optimizers that rely exclusively on forward passes. However, these methods often suffer from slow convergence.

This paper introduces PaZO (Preconditioned Accelerated Zeroth-Order optimization), an algorithm that accelerates ZO training by incorporating second-order (Hessian) information. PaZO mathematically proves the optimal way to precondition these updates and practically achieves state-of-the-art performance among memory-efficient optimizers.

The Memory Bottleneck in LLM Fine-Tuning

Standard neural network training relies on backpropagation (first-order optimization), which requires caching massive amounts of intermediate activations and historical gradients. For billion-parameter LLMs, this quickly exceeds the memory capacity of standard consumer GPUs.

To circumvent this, zeroth-order (ZO) optimization methods—such as the recently popular MeZO algorithm—estimate gradients using only forward passes. They achieve this by slightly perturbing the model's weights and observing whether the loss increases or decreases. This drastically slashes memory usage.

However, ZO methods converge very slowly compared to standard first-order training, which often uses adaptive optimizers like Adam to "precondition" updates using curvature information. The authors of this paper investigate whether preconditioning can be effectively applied to zeroth-order optimization without destroying the memory benefits.

Methods: Theoretical and Practical PaZO

The authors tackle the problem from both theoretical and practical angles:

  1. Theoretical Framework (PSPSA): They generalize ZO gradient estimation into a framework called Preconditioned Simultaneous Perturbation Stochastic Approximation (PSPSA). This framework allows them to mathematically analyze the effects of scaling random weight perturbations by some power of the Hessian matrix (the matrix of second derivatives representing the "curvature" of the loss landscape).
  2. The PaZO Algorithm (Practical): Because computing a full Hessian is computationally impossible for LLMs, the authors designed a practical version of PaZO. It estimates only the diagonal of the Hessian using three forward passes per step.
Algorithm snippet showing preconditioned perturbation

To maintain training stability and prevent numerical explosion (NaNs), PaZO uses moving averages to smooth the Hessian estimate and periodically resets it.

Key Insights

  • Preconditioning is Mandatory for ZO: In standard first-order SGD (for least squares problems), preconditioning doesn't improve the theoretical optimal convergence rate. However, the authors prove a surprising result: in zeroth-order optimization, standard ZO-SGD cannot hit the theoretical speed limit. Preconditioning is mathematically required to achieve optimal convergence.
  • The Magic Number is 1/2: The math explicitly shows that to achieve the fastest possible convergence rate, the preconditioner's order must be exactly $\alpha = 1/2$. This means scaling the perturbations by the inverse square root of the Hessian ($H^{-1/2}$).
  • Forward-Pass-Only Hessian Estimation Works: The diagonal of the Hessian matrix can be accurately estimated using just a few forward passes by comparing losses from slightly perturbed weights. This keeps the memory footprint strictly proportional to the number of parameters $O(d)$, rather than the square of the parameters $O(d^2)$.

Experimental Results

The authors evaluated PaZO on standard NLP benchmarks using RoBERTa-large (350M) and OPT-1.3B, testing across full fine-tuning, LoRA, and prefix-tuning setups.

  • Superior Accuracy: PaZO consistently outperforms existing zeroth-order baselines like MeZO and HiZOO across various tasks and tuning setups.
  • Massive Memory Savings: PaZO reduces memory usage by up to 6x compared to standard first-order fine-tuning, and 3x compared to first-order prefix-tuning. Its memory footprint remains comparable to other ZO methods (only slightly higher than MeZO due to storing the diagonal Hessian).
  • Faster Time-to-Convergence: Because PaZO requires three forward passes per step to estimate the Hessian, individual steps are 1.5x slower than MeZO. However, the preconditioning makes these steps significantly higher quality, requiring far fewer steps to reach the same accuracy. For example, on the RTE task, PaZO reached 60% accuracy with a 10% reduction in total wall-clock time compared to MeZO.

Limitations

While highly effective, PaZO has a few practical limitations:

  • Slower Per-Step Time: The additional forward passes required to estimate the diagonal Hessian make individual steps slower than vanilla ZO methods.
  • Hyperparameter Sensitivity: The practical algorithm is highly sensitive to its smoothing hyperparameters ($\beta_1, \beta_2$) and the frequency at which the Hessian estimate is reset ($T_0$). Poor tuning can lead to accumulated errors from the zeroth-order oracle, resulting in numerical instability or degraded performance. Future work will likely need to focus on auto-tuning mechanisms for these parameters.

Summary updated

BibTeX
@inproceedings{zhao2025pazo,
  author = {Hanzhen Zhao and Shihong Ding and Cong Fang and Zhouchen Lin},
  title = {{PaZO: Preconditioned Accelerated Zeroth-Order Optimization for Fine-Tuning LLMs}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=b2IU6QOOfo},
}
Figure