GRZO: Group-Relative Zeroth-Order Optimization for Large Language Model Fine-Tuning

Liyan Tan, Yequan Zhao, Yifan Yang, Ruijie Zhang, Xinling Yu, Zheng ZhangarXiv 2026

TL;DR

Zeroth-order optimization offers a memory-efficient, forward-only alternative for fine-tuning large language models (LLMs), but high gradient variance often cripples its performance. GRZO solves this by extracting a unique, pseudo-independent perturbation direction for every example in a mini-batch without increasing the forward-pass budget or memory footprint. This simple twist drastically reduces variance, leading to faster convergence and significant accuracy gains over standard zeroth-order methods like MeZO.

What Problem Does This Paper Address?

Fine-tuning LLMs using standard backpropagation is notoriously memory-intensive because it requires storing activations, gradients, and optimizer states. Zeroth-order (ZO) optimization methods (such as MeZO) eliminate this overhead by estimating gradients using only forward passes, keeping training memory consumption close to inference levels.

However, standard MeZO applies a single random perturbation direction across the entire mini-batch. As model dimensions grow into billions of parameters, this single-direction approach suffers from massive variance, resulting in slow, unstable, or stalled convergence. Previous attempts to reduce this variance either restrict the update space (sacrificing model expressivity) or require extra forward passes and persistent memory, eroding the core efficiency benefits of ZO optimization.

Methods

GRZO (Group-Relative Zeroth-Order Optimization) introduces a clever way to utilize the mini-batch dimension for variance reduction. Instead of sharing one perturbation direction across all $B$ examples in a batch, GRZO constructs $B$ pseudo-independent perturbation directions—one per example—within a single two-forward-pass step.

The method relies on two key components:

  1. Per-Example Perturbations via Structured Injection: To avoid the massive memory overhead of materializing $B$ separate weight matrices, GRZO leverages Flipout-style sign factorization. It generates a single shared base perturbation matrix and modulates it with per-example sign vectors. This allows the model to compute example-specific perturbations on the fly using fast, transient operations during the forward pass.
  2. Group-Relative Aggregation: GRZO aggregates the resulting per-example loss differences using group-relative normalization (inspired by the GRPO algorithm used in reinforcement learning). By dividing the loss differences by the within-batch standard deviation, GRZO achieves scale invariance, decoupling parameter updates from loss-magnitude drift.

Crucially, GRZO acts as a drop-in core replacement that seamlessly composes with other parameter-efficient ZO techniques like sparsity (Sparse-MeZO), low-rank constraints (LOZO), and quantization (QuZO).

Pipeline comparison between MeZO and GRZO

Datasets

The authors evaluated GRZO across a diverse suite of standard NLP benchmarks:

  • GLUE & SuperGLUE: Classification tasks including SST-2, RTE, CB, BoolQ, WiC, MultiRC, and COPA.
  • Question Answering: SQuAD and DROP.

No new benchmarks were introduced; the focus was entirely on improving optimization performance on these established datasets.

Key Insights and Ideas

  • The Mini-Batch as a Free Lunch: Standard ZO methods treat the mini-batch purely as a way to average out data noise. GRZO realizes that the mini-batch can simultaneously be used to average out directional noise, reducing gradient variance by a factor of $1/B$ without requiring extra forward passes.
  • Memory-Free Multi-Directionality: By using sign factorization and applying perturbations transiently via forward pre-hooks, GRZO achieves $B$ effective gradient directions while remaining firmly at the inference memory floor.
  • Scale Invariance via Group Normalization: Normalizing updates by the batch's standard deviation makes the optimizer robust against sudden shifts in loss scale. This proves incredibly beneficial when combined with quantization, where low-bit forward passes typically inflate loss differences and destabilize standard ZO updates.

Key Results

  • Accuracy Boost: On Llama3-8B, GRZO improved average accuracy by up to +3.0 over MeZO. On the RTE task, GRZO achieved 81.6% accuracy compared to MeZO's 74.4%.
  • Inference-Level Memory: GRZO peaks at just 17.82 GB on Llama3-8B—a tiny +0.08 GB (+0.5%) overhead over the absolute forward-only inference floor—matching MeZO's footprint while delivering vastly superior performance.
  • Faster Convergence: GRZO exhibits significantly faster convergence in both training steps and wall-clock time compared to MeZO and FZOO. Although it introduces a modest 23% per-step time premium due to the per-example perturbation overhead, this is heavily offset by the massive reduction in required optimization steps.
  • Excellent Composability: As a drop-in core replacement, GRZO boosted the performance of sparse, low-rank, and quantized ZO variants by an average of +4.9.
Figure 1: GRZO at a glance on RTE (Llama3-8B). Left: highest accuracy (81.6%) at inference-level peak memory (17.82 GB, +0.5% over the forward-only floor) for a 23% per-step time premium over MeZO. Right: fastest convergence in both training steps and wall-clock time.

Limitations and Future Work

  • Two-Pass Requirement: GRZO relies on a two-sided gradient estimate ($\ell^+$ and $\ell^-$), requiring two forward passes per step. Developing a reliable, low-bias one-sided variant to cut forward costs in half remains open future work.
  • Batch Size Sensitivity: The group-relative normalization requires a stable within-batch standard deviation. The authors note that performance degrades or diverges at very small batch sizes ($B < 16$), meaning it requires a minimum batch size threshold to function reliably.
  • Scale Limitations: While tested successfully on models up to 13B parameters (RoBERTa-large, Llama3-8B, OPT-13B), evaluating GRZO on ultra-large models (70B+) and exploring its viability for full pre-training are left for future research.

Summary updated

BibTeX
@misc{tan2026grzo,
  author = {Liyan Tan and Yequan Zhao and Yifan Yang and Ruijie Zhang and Xinling Yu and Zheng Zhang},
  title = {{GRZO: Group-Relative Zeroth-Order Optimization for Large Language Model Fine-Tuning}},
  year = {2026},
  eprint = {2606.02857},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.02857},
}
Figure