ConMeZO: Adaptive Descent-Direction Sampling for Gradient-Free Finetuning of Large Language Models
Lejs Deen Behric, Liang Zhang, Bingcong Li, Kiran Koshy Thekumparampil
TL;DR
ConMeZO tackles the slow convergence of gradient-free finetuning for large language models by introducing cone-based sampling around a momentum direction, which reduces variance in zeroth-order gradient estimates while preserving memory advantages. The method merges momentum with a geometrically constrained perturbation distribution, yielding a Descent Lemma that can provide faster per-iteration progress when momentum aligns with the true gradient, while maintaining the same worst-case rate as MeZO. Theoretical guarantees show a convergence bound of $\frac{1}{T}\sum_{t=0}^{T-1} \mathbb{E}[\|\nabla f(x_t)\|^2] \le \frac{2 \ell d (f(x_0) - f^*)}{T}$, and empirical results demonstrate up to $2\times$ speedups on RoBERTa-large and OPT-1.3B/13B with modest memory overhead. Overall, ConMeZO enables faster, memory-efficient zeroth-order finetuning of billion-parameter LLMs with practical improvements in early convergence and final performance.
Abstract
Zeroth-order or derivative-free optimization (MeZO) is an attractive strategy for finetuning large language models (LLMs) because it eliminates the memory overhead of backpropagation. However, it converges slowly due to the inherent curse of dimensionality when searching for descent directions in the high-dimensional parameter space of billion-scale LLMs. We propose ConMeZO, a novel zeroth-order optimizer that accelerates convergence by adaptive directional sampling. Instead of drawing the direction uniformly at random, ConMeZO restricts the sampling to a cone centered around a momentum estimate. This concentrates the search in directions where the true gradient is more likely to lie and thus reduces the effect of high dimensions. We prove that ConMeZO achieves the same worst-case convergence rate as MeZO. Empirically, when finetuning LLMs on natural language tasks, ConMeZO is up to 2X faster than MeZO while retaining the low-memory footprint of zeroth-order methods.
