# Variance-reduced Zeroth-Order Methods for Fine-Tuning Language Models

Source: [Variance-reduced Zeroth-Order Methods for Fine-Tuning Language Models](<https://www.sota2.com/research/paper/68fa5ba91e209131ce9ca5fa>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2025-10-28T13:56:08.737Z

Authors: Tanmay Gautam, Youngsuk Park, Hao Zhou, Parameswaran Raman, Wooseok Ha

Published: 2024-04-11T18:35:49.000Z

## Abstract

Fine-tuning language models (LMs) has demonstrated success in a wide array of downstream tasks. However, as LMs are scaled up, the memory requirements for backpropagation become prohibitively high. Zeroth-order (ZO) optimization methods can leverage memory-efficient forward passes to estimate gradients. More recently, MeZO, an adaptation of ZO-SGD, has been shown to consistently outperform zero-shot and in-context learning when combined with suitable task prompts. In this work, we couple ZO methods with variance reduction techniques to enhance stability and convergence for inference-based LM fine-tuning. We introduce Memory-Efficient Zeroth-Order Stochastic Variance-Reduced Gradient (MeZO-SVRG) and demonstrate its efficacy across multiple LM fine-tuning tasks, eliminating the reliance on task-specific prompts. Evaluated across a range of both masked and autoregressive LMs on benchmark GLUE tasks, MeZO-SVRG outperforms MeZO with up to 20% increase in test accuracies in both full- and partial-parameter fine-tuning settings. MeZO-SVRG benefits from reduced computation time as it often surpasses MeZO's peak test accuracy with a $2\\times$ reduction in GPU-hours. MeZO-SVRG significantly reduces the required memory footprint compared to first-order SGD, i.e. by $2\\times$ for autoregressive models. Our experiments highlight that MeZO-SVRG's memory savings progressively improve compared to SGD with larger batch sizes.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

- [Operational Metrics for LLM Fine-tuning on SST-2 (test)](<https://www.sota2.com/research/sota/operational-metrics-for-llm-fine-tuning-on-sst-2-test.md>): LLM fine-tuning; SST-2 (test); Number of Queries: 4248.

- [Natural Language Understanding on GLUE (MNLI, QNLI, SST-2, CoLA Subset)](<https://www.sota2.com/research/sota/natural-language-understanding-on-glue-mnli-qnli-sst-2-cola-subset.md>): Natural Language Understanding; GLUE; MNLI Score: 42.

- [LLM fine-tuning on CB (test)](<https://www.sota2.com/research/sota/llm-fine-tuning-on-cb-test.md>): LLM fine-tuning; CB (test); Number of Queries: 3216.

- [Natural Language Understanding on SuperGLUE (RTE, BoolQ, WiC, CB subset)](<https://www.sota2.com/research/sota/natural-language-understanding-on-superglue-rte-boolq-wic-cb-subset.md>): Natural Language Understanding; SuperGLUE; RTE Accuracy: 59.1.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2404.08080>)

[PDF](<https://arxiv.org/pdf/2404.08080.pdf>)
