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

PseuZO: Pseudo-Zeroth-Order Algorithm for Training Deep Neural Networks

Pengyun Yue, Xuanlin Yang, Mingqing Xiao, Zhouchen LinNeurIPS 2025

Fine-tuning Large Language Models (LLMs) is notoriously memory-intensive. Standard first-order (FO) methods like SGD or Adam require backpropagation, forcing the storage of massive activation tensors. Zeroth-order (ZO) optimization offers an alternative by estimating gradients using only forward passes, but it suffers from a major flaw: its efficiency plummets as the number of model parameters ($d$) grows, scaling as $\Theta(d)$.

To address this, researchers have introduced PseuZO (Pseudo-Zeroth-Order), a framework that breaks this "curse of dimensionality." By cleverly combining partial analytical gradients with a sliding-window Jacobian estimator, PseuZO achieves the memory efficiency of zeroth-order methods with convergence speeds that rival traditional training.

TL;DR

PseuZO is a hybrid optimization framework that estimates the Jacobian of model outputs while using exact gradients for the final loss function. It achieves dimension-independent convergence rates and outperforms existing zeroth-order methods like MeZO by up to 9.8% in accuracy, all while using 70-80% less memory than standard backpropagation.

The Problem with Standard Zeroth-Order Methods

The current state-of-the-art for memory-efficient fine-tuning is MeZO, which estimates the gradient of the entire loss function by perturbing model weights and observing the change in the final scalar loss. However, the variance of this estimate scales with the number of parameters. For a 13-billion parameter model, that variance becomes a massive wall, leading to slow convergence.

The authors identify a missed opportunity: in most machine learning tasks, the objective is a composite function $g(h(x))$. While the model $h(x)$ (the LLM) is complex and expensive to differentiate, the task-specific loss $g$ (like cross-entropy) is mathematically simple. Existing ZO methods treat the entire pipeline as a black box, ignoring the fact that we can easily compute the exact gradient of the loss with respect to the model's output.

The PseuZO Method

PseuZO introduces a "pseudo" approach to zeroth-order optimization. Instead of estimating the gradient of the final loss, it focuses on the Jacobian matrix of the model's output.

  1. Jacobian Estimation: It uses a two-point zeroth-order estimate to approximate the Jacobian of the model output $h(x)$.
  2. Analytical Loss Gradient: It computes the exact gradient of the loss function $g$ with respect to the model output. This "upstream" gradient is combined with the estimated Jacobian to form the final gradient estimate.
  3. Variance Reduction (EMA): To stabilize training, PseuZO applies an Exponential Moving Average (EMA) to the Jacobian estimators.
  4. The Sliding Window: Storing a history of Jacobians for an LLM would destroy any memory gains. To solve this, PseuZO uses a sliding window. It stores only the random seeds and the small output tensors from the last few steps, replaying them to reconstruct the EMA on the fly during the update step.
  5. Periodic Restarts: The smoothing factor ($\lambda$) for the EMA is decreased over time and periodically restarted to boost convergence in the early stages of training.
The sliding window mechanism and periodic lambda curve used to manage memory and boost convergence.

Key Insights and Results

PseuZO was evaluated across a wide range of tasks using the OPT model family (from 1.3B to 13B parameters), covering classification, multiple choice, and generation tasks.

  • Asymmetric Differentiability: By using the analytical gradient of the final loss, PseuZO captures more information per forward pass than standard ZO methods. The paper theoretically proves that PseuZO's convergence rate depends on the effective dimension of the objective, rather than the total number of parameters.
  • Accuracy Boost: On the SST-2 task using OPT-1.3B, PseuZO achieved 91.2% accuracy, significantly higher than MeZO’s 82.4% under the same computation time.
  • Scaling Efficiency: PseuZO's memory usage is nearly identical to MeZO and far lower than FO-SGD (standard backprop). While FO-SGD runs out of memory (OOM) on larger models like OPT-6.7B and 13B, PseuZO continues to scale comfortably, achieving 70-80% memory reduction compared to FO-SGD.
Memory usage comparison across different model sizes. PseuZO maintains a low memory footprint similar to MeZO, while FO-SGD quickly hits memory limits (red stars indicate Out-Of-Memory).

Limitations and Future Work

While the memory overhead is dimension-independent, the sliding window is sensitive to batch size and sequence length. Larger batches require storing more output tensors. Additionally, each epoch of PseuZO takes roughly twice as long as MeZO due to the additional computations required for the Jacobian estimation and sliding window updates. However, this is largely offset by the much faster convergence rate.

Future work may explore using auxiliary low-dimension layers as storage targets to further reduce memory overhead without sacrificing representation power.

Summary updated

BibTeX
@inproceedings{yue2025pseuzo,
  author = {Pengyun Yue and Xuanlin Yang and Mingqing Xiao and Zhouchen Lin},
  title = {{PseuZO: Pseudo-Zeroth-Order Algorithm for Training Deep Neural Networks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=tM4cHBD7kD},
}
Figure