Learning a Zeroth-Order Optimizer for Fine-Tuning LLMs
About
Zeroth-order optimizers have recently emerged as an attractive approach for fine-tuning large language models (LLMs), as they avoid backpropagation and can substantially reduce memory overhead relative to standard first-order training. However, existing zeroth-order methods rely on hand-crafted, static sampling strategies that are not adaptable to model-specific structures. To address this, we propose ZO-Finetuner, a learning-based zeroth-order optimizer for LLMs that automatically learns efficient perturbation strategies through a compact and memory-efficient design. Motivated by the fact that a small set of base LLMs is repeatedly fine-tuned across tasks, ZO-Finetuner supports one-time per-model training and reuse across downstream tasks with minimal overhead. Therefore, learning the optimizer once for a given LLM and reusing it across diverse downstream tasks is both feasible and highly desirable. Accordingly, ZO-Finetuner is designed to scale learning to learn (L2L) to the foundation-model era by supporting one-time per-model training with minimal overhead. Experiments on 4 LLMs and 7 datasets show that ZO-Finetuner outperforms prior zeroth-order baselines in 82.1\% of task-model combinations, thereby demonstrating strong performance and scalability for efficient LLM fine-tuning. The code can be found in https://github.com/ASTRAL-Group/ZO_Fine_tuner.
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Common Sense Reasoning | COPA | Accuracy92 | 256 | |
| Question Answering | BoolQ | Accuracy66 | 201 | |
| Reading Comprehension | DROP | DROP Accuracy32 | 129 | |
| Natural Language Inference | CB | Accuracy73 | 129 | |
| Coreference Resolution | WSC | Accuracy57 | 116 | |
| Sentiment Analysis | SST-2 | Top-1 Accuracy (SST-2)94 | 29 | |
| Question Answering | SQuAD | Loss0.22 | 20 | |
| Reading Comprehension | DROP | Loss0.4 | 20 | |
| Sentiment Analysis | SST-2 | Loss0.14 | 20 | |
| Coreference Resolution | WSC | Loss0.02 | 20 |