Zeroth-Order Fine-Tuning of LLMs in Learnable Low-Rank Subspaces
Authors: Chuang Tong, Ling Chen
Organizations: State Key Laboratory of Blockchain and Data Security, Zhejiang University · College of Computer Science and Technology, Zhejiang University
Zeroth-order (ZO) optimization enables memory-efficient fine-tuning of large language models (LLMs). However, ZO optimization suffers from high variance in high-dimensional parameter spaces. While recent methods restrict perturbations to random low-rank subspaces, these subspaces often misalign with task-specific descent directions. We propose AdaSub-ZO, a novel forward-only fine-tuning framework in learnable low-rank subspaces. Instead of relying on fixed random matrices, AdaSub-ZO iteratively learns layer-wise projection matrices directly from finite-difference feedback to track task-aware descent directions. Furthermore, AdaSub-ZO incorporates a subspace momentum acceleration mechanism to smooth noisy gradient estimates across evolving subspace bases. Extensive experiments on natural language understanding tasks demonstrate that AdaSub-ZO outperforms existing ZO baselines, substantially reducing gradient estimation variance and accelerating convergence.
Figures & tables
Method
SST-2
RTE
CB
BoolQ
WSC
WIC
COPA
AVG.
SGD
92.1
64.0
76.2
67.4
63.7
62.5
77.8
6.50%
MeZO (NeurIPS 2023)
89.4
59.2
69.3
64.1
60.0
59.5
72.0
0.00%
ZO-AdaMU (AAAI 2024)
89.4
59.4
67.9
63.2
60.0
59.8
72.7
-0.23%
S-MeZO (NeurIPS 2026)
89.5
59.3
69.5
64.2
60.1
59.6
72.0
0.15%
LOZO (ICLR 2025)
90.9
56.4
66.8
63.0
63.5
60.2
72.2
-0.16%
SubZero (ICCV 2025)
90.3
56.6
68.5
64.6
64.0
60.8
73.0
0.93%
Table 1: Performance comparison of fine-tuning methods on OPT-1.3B. SGD is included as a first-order performance reference. Bold denotes the best result among zeroth-order methods, and underline denotes the second-best result among zeroth-order methods.
Figure 1: Relative variance of ZO gradient estimates.
Figure 2: Training loss curves on CB.
Figure 3: Effect of low-rank dimension r on SST-2.
Figure 4: Effect of subspace momentum coefficient βm on SST-2.
Method
SST-2
RTE
CB
BoolQ
WSC
WIC
COPA
AVG.
AdaSub-ZO w/o Learnable Module
91.7
61.2
71.1
64.5
59.2
56.6
76.7
0.00%
AdaSub-ZO
92.0
61.6
71.4
64.8
59.6
57.0
77.0
+0.52%
Table 2: Ablation study of learnable module on OPT-1.3B. AVG denotes the average relative improvement over AdaSub-ZO w/o Learnable Module.
Method
SST-2
RTE
CB
BoolQ
WSC
WIC
COPA
AVG.
AdaSub-ZO w/o Subspace Momentum
91.1
61.4
70.0
64.9
63.0
57.0
74.0
0.00%
AdaSub-ZO
92.0
61.6
71.4
64.8
59.6
57.0
77.0
+0.26%
Table 3: Ablation study of subspace momentum on OPT-1.3B. AVG denotes the average relative improvement over AdaSub-ZO w/o Subspace Momentum.
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
Hyperparameter
Search Space
Model Learning Rate ηθ
{1e-7,1e-6,1e-5}
Model Perturbation Scale ϵ
{1e-4,1e-3,1e-2}
Low-Rank Dimension r
{24,36,48}
Projection Learning Cycle K
{50,100,200,500}
Projection Learning Steps M
{1,5,10,20}
Projection Learning Rate ηϕ
{1e-3,1e-2,1e-1}
Appendix
Table 4: Hyperparameter search space for AdaSub-ZO.
Zeroth-order (ZO) optimization with SGD in random subspaces enables memory-efficient fine-tuning of large language models without backpropagation. However, high gradient estimation noise fundamentally undermines adaptive optimizers like Adam. We propose SubZero+, which achieves practical adaptive ZO optimization through a carefully designed dual low-dimensionality strategy: (i) multi-query forward-difference gradient estimation in periodically refreshed random subspaces to mitigate noise amplification in moment buffers, and (ii) Adam updates with periodic restarts performed directly in low-dimensional space rather than full-parameter space. In experiments, this dual design retains memory overhead comparable to momentum-free ZO methods while achieving stronger optimization performance than the evaluated ZO baselines. Theoretically, in the exact-directional limit, K-query averaging preserves conditional unbiasedness, while the coefficient estimator's covariance and mean-squared error, as well as query-induced second-moment inflation, scale exactly as 1/K. Extensive experiments across SuperGLUE with models from 1.3B to 32B parameters under both full fine-tuning and LoRA schemes demonstrate consistent improvements over competing ZO methods. SubZero+ significantly narrows the performance gap with first-order optimization while preserving ZO's inference-time memory efficiency.
Ziming Yu, Shuyao Xiao, Xingyu Zhao +6
Beijing Normal University · Singapore Management University · Xiaomi Inc. +2
Zeroth-order (ZO) optimization enables fine-tuning large language models when backpropagation is unavailable or memory-prohibitive, but existing methods often perturb full model weights or randomly constructed low-dimensional subspaces, yielding high-variance estimates and limited performance. We propose ZO-Act, an activation-informed ZO fine-tuning method that restricts perturbations to a fixed low-rank subspace derived from input activations. For each linear layer, ZO-Act computes a small activation basis once at initialization and optimizes only lightweight coefficient matrices using forward-only loss evaluations. This reduces the effective perturbation dimension, exposes explicit trainable variables compatible with momentum-based optimizers such as Adam, and naturally supports quantized LLM fine-tuning by keeping low-bit weights frozen. We analyze ZO-Act as zeroth-order optimization over a restricted coefficient space and show that perturbing the low-dimensional coefficients reduces both the variance-dependent convergence term and the finite-difference error of the ZO estimator, at the cost of a controlled subspace approximation bias that is mitigated by the low-rank structure of LLM activations and gradients. Experiments on Llama-3-8B, OPT-13B, and INT4 Llama-3-8B show consistent gains over strong ZO fine-tuning baselines across language understanding, question answering, and commonsense reasoning.
Xun Dong, Yibo Xu, Naigang Wang +3
University at Albany, SUNY · IBM T. J. Watson Research Center
Fine-tuning large language models (LLMs) with backpropagation achieves high performance but incurs substantial memory overhead, limiting scalability on resource-constrained hardware. Zeroth-order (ZO) optimization provides a memory-efficient alternative by relying solely on forward passes, yet it typically suffers from slow or unstable convergence due to high-variance gradient estimates. Sparse ZO updates partially address this issue by perturbing only a subset of parameters, but their effectiveness hinges on selecting informative parameters, which is challenging in ZO optimization because each query yields only scalar feedback. We propose Adaptive Curvature-Guided Sparse Zeroth-Order Optimization (CurvZO), which tracks curvature signals online from scalar ZO feedback and leverages these signals to construct a parameter-wise sampling distribution for selecting coordinates at each update, reducing the variance of the sparse ZO gradient estimator. Moreover, CurvZO dynamically adapts the perturbation budget to the evolving curvature signal distribution, yielding sparse ZO updates that remain both focused and sufficiently exploratory. Extensive experiments on OPT and Llama across diverse NLP tasks show that CurvZO consistently improves fine-tuning performance and reduces training time over ZO baselines. It improves accuracy by up to 4.4 points and achieves up to a 2× speedup, while preserving memory efficiency.
Shuo Wang, Ziyu Chen, Ming Tang
Department of Computer Science and Engineering, Southern University of Science and Technology, Shenzhen, China. · Department of Mathematics, Southern University of Science and Technology, Shenzhen, China.