TL;DR
Fine-tuning massive language models usually requires a mountain of memory to store gradients. Zeroth-order (ZO) optimization skips the gradients by "poking" the model with random noise to see how the loss changes, but "random" is often inefficient. PAMS makes these pokes smarter by using data from the forward pass to figure out which directions actually matter, delivering faster, more stable fine-tuning without the memory headache of backpropagation.
What Problem Does This Paper Address?
If you’ve ever tried to fine-tune a 13-billion parameter model on a consumer GPU, you’ve likely hit the "Out of Memory" wall. Standard training (first-order optimization) requires backpropagation, which means storing a massive amount of intermediate data (activations) just to calculate gradients.
Zeroth-order (ZO) optimization is the clever workaround. It treats the model like a black box: you perturb the weights slightly, measure the change in loss, and estimate which way to move. It’s incredibly memory-efficient because it only needs forward passes.
The catch? Most ZO methods are "isotropic"—they throw darts in every direction with equal intensity. But neural network parameter spaces are highly anisotropic; they are full of narrow valleys and flat plains. Wasting your "perturbation budget" on directions the model doesn't care about makes the optimization slow and noisy. The authors wanted to find a way to make these perturbations "data-aware" without re-introducing the very gradients they were trying to avoid.
Methods
The authors introduce PAMS (Preconditioned Activation-Metric Subspace). Instead of blind jumping, PAMS looks at the activations during the forward pass to build a map of the terrain.
- Activation-Informed Geometry: During a normal forward pass, the model produces activations. PAMS calculates the second-moment statistics of these activations. This tells the optimizer which "feature directions" are currently dominant in the data.
- Efficient Subspace Tracking: You can't store a full covariance matrix for a giant LLM layer—it would be billions of entries. PAMS uses a streaming, low-rank approximation. It tracks only the top $r$ most important directions (the subspace) using an online PCA-like approach on the Stiefel manifold.
- Spectrum-Aware Reweighting: Once it knows the important directions, it "softly" reweights the noise. It actually gives smaller perturbations to directions with large activation variance. This acts as a form of right-side preconditioning, effectively smoothing out the steep parts of the loss landscape so the optimizer doesn't oscillate wildly.
- Trace Normalization: To keep things fair across different layers, PAMS normalizes the noise so that the total "amount" of perturbation remains constant, even as it shifts the shape of that noise.
Datasets
The researchers put PAMS to the test using the GLUE and SuperGLUE benchmarks—the standard gauntlets for natural language understanding. They evaluated the method across three scales of models:
- RoBERTa-large (355M parameters)
- OPT-2.7B
- OPT-13B
Key Insights and Ideas
- The "Free" Map: The most elegant insight is that the forward pass already contains the structural information needed to navigate the parameter space. We don't need a backward pass to know which features are active and important.
- Soft vs. Hard Constraints: Unlike previous methods that only optimized in a low-rank subspace (ignoring everything else), PAMS still explores the whole space. It just spends its "energy" more wisely by reweighting the noise based on the activation spectrum.
- Theoretical Bridge: The authors proved that shaping the noise this way is mathematically equivalent to preconditioning the gradient of a "Gaussian-smoothed" version of the objective function. This puts a solid theoretical foundation under what might otherwise seem like a heuristic.
Key Results
PAMS consistently outperformed existing ZO baselines like MeZO, HiZOO, and LOZO:
- Accuracy Gains: On the OPT-13B model, PAMS achieved a mean accuracy of 72.54%, a 2.46 percentage point improvement over the standard MeZO baseline.
- Query Efficiency: In tests on the OPT-2.7B model, PAMS reached the same final loss as MeZO using less than 40% of the function evaluations. It finds the "right" direction much faster.
- Memory Footprint: PAMS remains highly efficient. On RoBERTa-large, it used only 2.16 GB of GPU memory, compared to 1.72 GB for the basic MeZO and 3.30 GB for the Hessian-based HiZOO. It offers "second-order-like" benefits at a "zeroth-order" price tag.
Limitations and Future Work
- The ZO Tax: While PAMS is faster than other ZO methods, zeroth-order optimization is still fundamentally slower (in terms of iterations) than standard gradient descent. It’s a trade-off: you save memory but pay in compute time.
- Hyperparameter Sensitivity: The method introduces a few new knobs to turn, such as the rank $r$ of the subspace and the preconditioning exponent $\alpha$. While the paper shows PAMS is relatively robust, finding the "perfect" settings for a new architecture might require some effort.
- Batch Dependence: The theoretical convergence assumes the noise is chosen independently of the current data batch. In practice, PAMS uses the current batch to update its geometry. While this works great empirically, it creates a small "residual" in the formal convergence proofs that the authors suggest exploring further.
If you're interested in the nitty-gritty math of Riemannian manifolds and Kronecker-factored approximations, check out Section IV of the full paper!
Summary updated