TL;DR
Training large language models (LLMs) to reason using reinforcement learning usually requires massive GPU memory for backpropagation. Zeroth-order (ZO) optimization bypasses backpropagation by estimating gradients using only forward passes, yet applying it directly to on-policy reinforcement learning causes gradient noise to explode. This paper uncovers the exact mathematical culprit—evaluating perturbed models on mismatched data—and introduces ZO-BOLT, an offline alternative that cancels out this noise to achieve strong reasoning gains at near-inference memory costs.
What Problem Does This Paper Address?
Post-training LLMs with Reinforcement Learning with Verifiable Rewards (RLVR)—like checking if a math answer is right—is behind recent leaps in AI reasoning. However, standard first-order training relies on backpropagation, hoarding GPU memory to store activations, gradients, and optimizer states.
Zeroth-order (ZO) optimization offers a compelling escape hatch. Instead of computing exact derivatives, ZO nudges model parameters slightly by a tiny perturbation scale $\mu$, runs two forward passes, and estimates the gradient from the difference in loss. Because it only uses forward passes, memory usage drops to roughly inference levels.
While ZO works well for supervised fine-tuning (SFT), its reliability in RLVR was unexplored. When you nudge a policy's parameters in on-policy RL, the model's probability distribution changes—meaning the two forward passes must sample fresh, independent trajectories. What happens to gradient estimates when your two measuring sticks are tested on completely different data?
Methods
First, the authors build a variance-theoretic framework that decomposes noisy ZO gradient estimation error into a standard noise-free term and an oracle-noise term. They contrast two distinct regimes:
- Mismatched-Data Regime (On-policy RL): Each perturbed model generates its own rollouts, making stochastic fluctuations independent across the two evaluations.
- Matched-Data Regime (BOLT): They leverage an existing formulation called Boltzmann Targeted SFT (BOLT), which recasts KL-regularized RLVR into an offline, importance-weighted supervised objective over a fixed dataset collected beforehand. Because the dataset is static, both ZO forward passes can share the exact same minibatch.
Building on this theoretical separation, the authors introduce ZO-BOLT. It optimizes BOLT’s fixed weighted-SFT objective under the matched-data regime, pairing symmetric finite differences ($\theta + \mu u$ and $\theta - \mu u$) on identical minibatches with two established ZO enhancers: ZoAR (query history reuse) and R-AdaZO (an adaptive ZO optimizer).
Datasets
The authors evaluate their methods on two standard mathematical reasoning benchmarks—no new datasets are introduced:
- GSM8K: Grade-school math word problems.
- MATH: Challenging competition-level mathematics problems.
Experiments span three open-weight models using LoRA: Qwen2.5-1.5B, Qwen2.5-7B, and DeepSeek-R1-Distill-Qwen-1.5B.
Key Insights and Ideas
- ZO amplifies mismatch, not just noise: When two evaluations use independent data (like in on-policy RL), their random errors add up rather than cancel out. Dividing by the tiny perturbation step $\mu$ triggers a catastrophic $1/\mu^2$ variance amplification alongside a linear scaling in parameter dimension $d$. Shrinking $\mu$ to get a more accurate gradient paradoxically causes the noise floor to blow up!
- Shared randomness is magic: By evaluating both perturbed models on the exact same minibatch in BOLT, leading-order stochastic noise cancels out cleanly in the subtraction. The $1/\mu^2$ term vanishes completely.
- Why not just reuse RL trajectories? If you force on-policy RL to reuse trajectories across perturbations (like PPO or GRPO do on frozen rollouts), you quietly change the true objective into a surrogate. Fixing that bias requires trajectory-level importance weights, whose variance can grow exponentially with sequence length—deadly for long chain-of-thought reasoning.
Key Results
- Empirical proof of the $1/\mu^2$ wall: Sweeping $\mu$ down to $10^{-4}$ on Qwen2.5-1.5B confirms theory with striking precision. On-policy RL and artificially mismatched BOLT see dimension-normalized variance skyrocket to $\sim 2.5 \times 10^6$, whereas matched BOLT stays flat at $2.12 \times 10^{-2}$—roughly $10^8\times$ lower.
- Data matching makes or breaks training: In end-to-end GSM8K training (Qwen2.5-1.5B), matched ZO-BOLT lifts accuracy from 52.24% to 63.78% (+11.54%), while mismatched ZO-BOLT degrades below the untrained baseline to 49.35%. Even ZO-GRPO jumps from 53.08% (mismatched) to 59.00% when minibatches are matched.
- Strong reasoning at a fraction of the memory: Across all six model-benchmark pairs, ZO-BOLT beats the pretrained baseline. On GSM8K, it recovers 98.2% (Qwen2.5-1.5B) and 92.2% (Qwen2.5-7B) of full first-order BOLT's gains. Meanwhile, it slashes peak GPU memory by 59.5% at 1.5B (4,201 MB vs. 10,363 MB) and 43.7% at 7B (16,014 MB vs. 28,436 MB), adding barely ~1 GB over pure inference.
Limitations and Future Work
- Harder tasks widen the gap: While ZO-BOLT nearly matches first-order training on GSM8K, its recovery rate drops on the harder MATH benchmark—recovering 69.2% on Qwen2.5-7B and just 21.0% (+0.50% absolute gain) on DeepSeek-R1-Distill-Qwen-1.5B.
- Scale and scope: Experiments are currently restricted to math reasoning and LoRA fine-tuning on models up to 7B parameters. Future work aims to explore larger model scales, broader domains, and stronger ZO optimizers to close the remaining gap with backpropagation on complex tasks.
Summary updated