ENGINE: Endogenous Variational MultiScale Optimization for Zeroth-Order LLM Fine-Tuning

Zhuoli Ouyang, Changxi Chi, Siyuan Li, Tailin Wu

TL;DR

ENGINE (Endogenous Variational MultiScale) is a new zeroth-order optimization framework that breaks the trade-off between high-variance full-space updates and information-poor subspace updates in LLM fine-tuning. By adapting Variational MultiScale theory from computational mechanics, it injects fine-grained curvature information from the full parameter space into efficient low-rank updates, achieving up to a 2.61× speed-up in forward passes with zero additional peak memory overhead.

What Problem Does This Paper Address?

Fine-tuning Large Language Models (LLMs) typically relies on first-order (FO) optimizers like Adam, which are notoriously memory-intensive because they must store activations, gradients, and optimizer states. Zeroth-order (ZO) optimization is a memory-efficient alternative that uses only forward passes, reducing memory requirements to near-inference levels.

However, ZO methods face a "fundamental dilemma":

  1. Full-space optimization (like MeZO) captures rich information but suffers from exploding gradient variance in high-dimensional spaces, leading to slow convergence.
  2. Subspace optimization (like LoRA-based ZO) reduces variance by restricting updates to a low-dimensional space but "discards" critical high-dimensional curvature information, often resulting in degraded final performance.

The authors ask: Can we keep the efficiency of low-dimensional sampling while still using curvature information from the full space?

Methods

The authors introduce ENGINE, inspired by Variational MultiScale (VMS) theory—a technique used in computational mechanics to model complex systems by separating them into "resolved" (coarse) and "unresolved" (fine) scales.

The Core Innovations:

  • Endogenous Operator: In classical VMS, the operator (like a physics equation) is fixed. In optimization, the "operator" is the Hessian, which evolves as the model trains. ENGINE treats the LoRA parameterization as the coarse scale and the full parameter space as the fine scale, dynamically updating the interaction between them.
  • The V-Cycle: ENGINE uses a multigrid-style V-cycle that alternates between coarse and fine phases.
  • Coarse Phase: Updates are performed in the low-rank LoRA subspace to keep variance low.
  • Fine Phase: The optimizer periodically "probes" the full-dimensional space to refresh curvature information.
  • Subgrid Correction ($\tau_{sgs}$): This is the mathematical "bridge." It identifies the gap between the preconditioned direction in the fine space and the coarse space. This residual is then injected back into the coarse updates to correct for the information lost by staying in a subspace.
ENGINE overview showing the V-cycle and the gap between fine and coarse directions.

Datasets

The researchers evaluated ENGINE across 16 different (model, task) combinations:

  • Models: GPT-2-XL (1.5B), OPT-2.7B, LLaMA-3-8B, and OPT-13B.
  • Benchmarks: 16 prompt-free classification tasks from GLUE (e.g., MNLI, QNLI, SST-2, CoLA) and SuperGLUE (e.g., RTE, BoolQ, WiC, CB).

Key Insights and Ideas

  • Curvature as Covariance: The method builds on the idea that preconditioning a gradient is equivalent to sampling perturbations from a specific Gaussian distribution. By aligning the sampling covariance with the model's curvature, they reduce estimator variance.
  • Closing the Loop: The "aha moment" is realizing that the mismatch between subspace and full-space preconditioning is a systematic bias. By calculating a closed-form "subgrid correction," they can eliminate this bias without the statistical cost of full-space sampling at every step.
  • Efficiency through Reuse: During the coarse phase, ENGINE reuses the same forward passes to update both the model parameters and the curvature estimates, making the correction step essentially "free" in terms of query cost.

Key Results

ENGINE consistently outperforms state-of-the-art ZO baselines like LOREN and MeZO across all tested models and tasks.

  • Accuracy: ENGINE achieved the highest test accuracy in all 16 model-task cells (see Figure 2).
  • Speedup: It reached the best accuracy of previous methods significantly faster, achieving a 2.61× speed-up in forward passes and a 2.58× wall-clock speed-up on LLaMA-3-8B (CB).
  • Memory: Crucially, these gains come with zero additional peak memory overhead, as the coarse phase is even more memory-efficient than the fine phase, which itself matches the previous state-of-the-art.
Figure 2: Test accuracy on all 16 (model, task) combinations. Top row: GPT-2-XL (GLUE, FP32) and OPT-2.7B (GLUE, FP32). Bottom row: LLaMA-3-8B (SuperGLUE, BF16) and OPT-13B (SuperGLUE, BF16). ENGINE is shown in blue hatched. Full numerical values are in Appendix E.1.

Limitations and Future Work

  • Hyperparameter Tuning: Currently, the refresh interval ($S$) and the lengths of the coarse/fine phases are fixed in advance. The authors suggest that adaptively changing these based on "curvature drift" could further improve efficiency.
  • Task Coverage: The study focused on classification tasks. Extending these benefits to generative tasks (like open-ended text generation) remains an open area for evaluation.
  • Black-Box Constraints: ENGINE requires access to model parameters to perturb weights. This means it cannot be used with "prediction-only" APIs where the model weights are completely hidden.

Summary updated

Abstract

Zeroth-order (ZO) optimization enables memory-efficient large language model (LLM) fine-tuning, and recent methods incorporate curvature-aware strategies. However, in the high-dimensional parameter space of LLMs, these methods inherently suffer from exploding gradient variance and prohibitive costs. Conversely, confining updates to a low-dimensional subspace reduces variance but discards critical high-dimensional information, degrading performance. This creates a fundamental dilemma: full-space optimization is informative but has high variance, while subspace optimization has low variance but loses information. To break this trade-off, we propose ENGINE (Endogenous Variational MultiScale). Inspired by computational mechanics, we adapt static Variational MultiScale (VMS) theory to dynamic optimization, treating low- and high-dimensional spaces as resolved coarse and unresolved fine scales. Through a multigrid-style V-cycle, ENGINE alternates between spaces, dynamically probing fine-grained information in the high-dimensional space and injecting it to correct the efficient low-dimensional sampling process. Under appropriate assumptions, statistical analysis characterizes variance reduction and correction of curvature-induced bias, and convergence analysis establishes a stationarity bound for the corrected coarse updates. Evaluations on standard LLM benchmarks show that ENGINE achieves higher accuracy and faster convergence than existing ZO methods, achieving up to a $2.61\times$ speed-up in forward passes with zero additional peak memory overhead. Code is available at https://github.com/AI4Science-WestlakeU/ENGINE.
BibTeX
@inproceedings{ouyang2026engine,
  author = {Zhuoli Ouyang and Changxi Chi and Siyuan Li and Tailin Wu},
  title = {{ENGINE: Endogenous Variational MultiScale Optimization for Zeroth-Order LLM Fine-Tuning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=d0rAtRO4pl},
}
Figure