inferwire
/
AI·4 min read

Zeroth-Order Fine-Tuning on vLLM Runs 8.13x Faster on OPT-13B

A paper moves the repeated scoring at the heart of zeroth-order fine-tuning from a training loop into the vLLM serving engine and finishes a 20,000-step OPT-13B run in about half an hour.

TL;DR

  • A paper runs the repeated scoring of zeroth-order fine-tuning through the vLLM serving engine and finishes an OPT-13B run 8.13 times faster than LoZO's code [^1].
  • The authors argue such forward-only training belongs on serving software, though their end-to-end evidence so far covers a single classification task [^1].

Background

Fine-tuning a language model with backpropagation needs far more memory than running it, because activations, gradients and optimizer state must be stored. The MeZO paper measured up to 12 times the memory of inference: one A100 GPU with 80GB can run a 30-billion-parameter model but train only a 2.7-billion-parameter one with Adam [^2]. Zeroth-order (ZO) methods skip the backward pass. They estimate an update from the difference in loss between forward passes [^2].

What happened

Zelin Li and Caiwen Ding start from what a ZO step actually does: sample a random direction, score a minibatch with the weights nudged one way and then the other, turn the difference into a coefficient and apply a small update [^1]. "The expensive operation is forward scoring; the update itself is small," they write [^1]. Yet implementations still run this as ordinary training, in a Python loop that hands the system isolated calls, even though the paired evaluations are closely related scoring requests. The authors call this a "workload-runtime mismatch" [^1].

Their fix keeps the optimizer and moves the scoring. Objective evaluations go through a direct-worker path in vLLM, a serving engine built around batching, scheduling, token log-probability extraction and keeping LoRA adapters resident on the GPU [^1]. Updates are applied on the worker side. With LoZO, a ZO method that uses low-rank perturbations, they accumulate in a compact factor instead of being written into the full weights at every step [^1].

The main test fine-tuned OPT-13B on SST-2 for 20,000 steps [^1], a simple sentiment classification task [^2]. The vLLM path took an estimated 0.51 hours, against 4.15 hours for the official LoZO code in the matched LoRA-only setting and 4.25 hours for full LoZO: speedups of 8.13 and 8.32 times [^1]. Final evaluation accuracy was 0.922, against 0.902 and 0.912 for the two baselines [^1]. Timing single optimization steps on OPT-1.3B to OPT-13B gave speedups of 2.3 to 7.7 times, and a MeZO-style variant on OPT-1.3B ran up to 2.55 times faster [^1].

Why it matters

Profiling supports the framing. On OPT-13B, scoring took about 94 to 99 percent of each vLLM step as batch size rose from 16 to 128, which the authors read as the bottleneck moving away from Python orchestration toward dense forward computation [^1]. From this they derive a design rule for ZO research: judge an estimator also by whether its probes can be batched, scheduled and kept in adapter form, because a simpler one that fits the serving stack may be more useful than a more sample-efficient one that doesn't [^1]. Since the changing state lives in small adapters, the base model can stay quantized as a serving artifact, and the authors sketch probes as low-priority jobs filling underused batches or idle GPU time [^1].

The evidence is narrower than the framing, and the paper says so. The end-to-end result covers one model on one short classification task, and generation-heavy or long-context workloads may expose different bottlenecks [^1]. The vLLM training time is estimated from measured per-step time, the official baseline starts from a higher evaluation loss for reasons still under investigation, and the authors call their code "largely hack-style systems work" without multi-GPU orchestration or checkpointing support [^1].

Practical example

Say Priya runs the machine learning team at a mid-sized web host. The team already serves an open model through vLLM and wants it to sort support tickets into a handful of labels, a short classification job much like SST-2. Priya picks a zeroth-order method because it needs no backward pass and so no extra memory for gradients [^2].

Run the usual way, a Python training loop samples a random direction, scores a batch of tickets twice with the weights nudged in opposite directions, compares the two losses and takes a small step, over and over [^1]. Each of those scoring calls reaches the system on its own, so the runtime never sees that the two belong together [^1]. Following the paper, the team sends the paired scoring through vLLM instead and keeps the training state in a small LoRA-shaped adapter on top of the base model [^1]. In the paper's OPT-13B test, that change cut 20,000 steps from 249.2 minutes to 30.7 minutes at slightly higher final accuracy [^1].

Priya should not count on the same gain. The end-to-end result covers only that one task, and the code is a research prototype without checkpointing or multi-GPU support [^1]. The idea of running probes in the quiet hours of the serving GPU is something the paper sketches, not something it measures [^1].

Related gear

We recommend this book because it explains backpropagation and gradient-based training from the ground up, the approach that zeroth-order methods replace with pairs of forward passes.

AdvertisementAmazon

Deep Learning

Sources

  1. [1]arXiv — LLM Zeroth-Order Fine-Tuning is an Inference Workload
  2. [2]arXiv — Fine-Tuning Language Models with Just Forward Passes