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

TeZO: Empowering the Low-Rankness on the Temporal Dimension in the Zeroth-Order Optimization for Fine-tuning LLMs

Yan Sun, Qixin Zhang, Tiansheng Huang, Liang Ding, Li Shen, Dacheng Tao · Submission to ICLR 2026 · Rejected

TL;DR

TeZO introduces a low-rank zeroth-order (ZO) optimization framework that exploits both spatial and temporal low-rankness in large language model (LLM) gradients. By modeling perturbation matrices across training steps as a 3D tensor via Canonical Polyadic Decomposition (CPD), TeZO slashes optimizer state storage from $O(d)$ to $O(r)$. This enables advanced optimizers like Adam to run with less GPU memory than vanilla ZO-SGD (requiring roughly 35% of standard ZO-Adam memory) while matching or exceeding full first-order downstream performance.

What Problem Does This Paper Address?

Fine-tuning LLMs using standard first-order (FO) gradient descent requires storing model activations for backpropagation, causing significant GPU memory bottlenecks. Zeroth-order (ZO) optimization (such as MeZO) circumvents backpropagation by estimating gradients using two forward passes with random parameter perturbations.

However, ZO approaches face two major challenges:

  1. Inefficient scaling with dimension: Perturbation overhead grows with the number of parameters $d$. While recent methods (like LOZO and SubZO) exploit the spatial low-rank nature of individual gradient matrices, they treat each iteration independently.
  2. Prohibitive optimizer states: Advanced optimizers like Adam or momentum-based SGD improve convergence stability, but tracking first- and second-order moments requires storing optimizer states of size $O(d)$. In ZO fine-tuning—where activation caching is absent—these optimizer states quickly become the dominant memory cost, erasing the memory advantages of gradient-free training.

Methods

  • Temporal-Spatial CPD Perturbations: Rather than sampling independent low-rank matrices at every iteration, TeZO views the sequence of perturbations across $T$ iterations as a 3D tensor $\mathcal{Z} \in \mathbb{R}^{m \times n \times T}$. Using Canonical Polyadic Decomposition (CPD), $\mathcal{Z}$ is decomposed into $r$ rank-1 components: $$\mathcal{Z} \approx \sum_{s=1}^r \chi_s \circ u_s \circ v_s$$ The spatial vectors $u_s \in \mathbb{R}^m$ and $v_s \in \mathbb{R}^n$ are initialized once at the start. At iteration $t$, the algorithm only samples a temporal vector $\tau \in \mathbb{R}^r$, dropping the per-step generation cost from $O(\sqrt{d}T)$ to $O(r)$.

  • $O(r)$ Memory-Efficient Optimizer States:

  • First-Order Momentum: Momentum accumulation is performed directly on the low-dimensional temporal vector $\tau$ before computing the outer product update, reducing state memory to $O(r)$.
  • Second-Order Moments (Adam): When expanding the squared gradient perturbation, it separates into a diagonal term $\sum_{s} \tau_s^2 (u_s^2 \circ v_s^2)$ and an off-diagonal cross term. The authors show that the cross-term expectation is zero and empirically negligible in high dimensions. Thus, second moments are tracked by simply accumulating the squared temporal coordinates in $O(r)$ space.
  • Layer-Wise Dynamic Rank Selection: Leveraging the parameter cascade across transformer layers, the authors bound the gradient rank via the singular values of downstream parameter matrices within each transformer block. Rather than using a rigid global rank hyperparameter, TeZO adaptively assigns rank $r_l$ per layer using a singular value cutoff threshold.

Datasets

The authors evaluated TeZO across 16 benchmark tasks spanning classification, natural language inference, and reading comprehension:

  • Datasets: SST-2, SST-5, SNLI, TREC, CB, BoolQ, WiC, MultiRC, SQuAD, DROP, and RTE.
  • Evaluated Models: RoBERTa-large, OPT (1.3B, 2.7B, 6.7B, 13B, and 30B), and LLaMA (7B, 13B, and 30B).

Key Insights and Ideas

  • LLM Gradients Share a Subspace Over Time: Gradients across different training iterations do not point in arbitrary directions; their cosine similarities remain consistently high throughout training. Exploiting this shared subspace over time provides massive compression leverage.
  • Near-Lossless Diagonalization of Second Moments: In large dimensions ($m, n \ge 768$), the cross-terms of outer products naturally average to zero. Discarding them causes almost zero degradation and turns coordinate-wise adaptive scaling into an accumulation over length-$r$ vectors.
  • Optimizer Upgrades at Zero Memory Cost: Historically, switching from ZO-SGD to ZO-Adam tripled the memory footprint of weights and states. TeZO decouples state tracking from parameter dimension $d$, enabling adaptive optimization within roughly the same memory envelope as zero-shot inference.

Key Results

  • Memory Consumption: On OPT-13B, TeZO-Adam consumes 26.01 GB, using less memory than standard MeZO-SGD (26.43 GB) and only ~34.6% of MeZO-Adam (75.27 GB). On LLaMA-7B, TeZO-Adam uses 13.71 GB compared to 39.50 GB for MeZO-Adam.
  • Wall-Clock Speedup: On OPT-13B, TeZO-Adam reduces per-step wall-clock time to 394 ms, running 1.63× faster than MeZO-Adam (642 ms).
  • Downstream Accuracy:
  • On OPT-13B, TeZO-Adam achieves 71.8% on BoolQ and 84.0% on SQuAD, outperforming MeZO-Adam (70.0% and 81.8%) and LOZO-Adam (70.0% and 82.6%).
  • On LLaMA-30B, TeZO-Adam achieves an average score improvement of +3.0% over MeZO-SGD and +1.5% over MeZO-Adam across RTE, SST-2, and WiC.
  • Generality holds across optimizers, showing consistent gains when integrated into the sign-based LION optimizer.

Limitations and Future Work

  • Diminishing Returns on Small Models: On models smaller than 3B parameters (e.g., 125M or 1.3B), tensor decomposition overhead offsets runtime gains, making TeZO primarily advantageous for $\ge$3B parameter architectures.
  • Focus on 2D Matrix Layers: The formulation targets 2D weight matrices (which make up the vast majority of LLM parameters) and does not explicitly address 1D parameter vectors (such as biases or layer normalization scales).
  • Hyperparameter Tuning for Rank: While dynamic rank selection removes the need to manually guess a fixed rank $r$, it introduces a singular value threshold parameter ($r_{th}$) and an upper bound ($r_{max}$).

Summary updated

BibTeX
@misc{sun2025tezo,
  author = {Yan Sun and Qixin Zhang and Tiansheng Huang and Liang Ding and Li Shen and Dacheng Tao},
  title = {{TeZO: Empowering the Low-Rankness on the Temporal Dimension in the Zeroth-Order Optimization for Fine-tuning LLMs}},
  year = {2025},
  eprint = {2501.19057},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2501.19057},
}
Figure