TL;DR
When AI models like LLMs or robotic policies are deployed, they generate actions sequentially, rolling out along their own previous predictions. This paper shows that standard optimizers (like Adam or Muon) focus too heavily on minimizing one-step validation loss, which can lead to poor feature learning and catastrophic compounding errors at test time. To fix this, the authors introduce Double Preconditioning (DoPr), a drop-in optimizer framework that combines activation-wise and gradient-wise preconditioning to ensure uniform feature learning and robust downstream performance.
What Problem Does This Paper Address?
In many modern deep learning applications—such as autoregressive language modeling, robot policy learning, and flow-based generative modeling—a network is trained via a one-step prediction loss but deployed over a long horizon. This setup creates a phenomenon the authors call Test-Time Feedback (TTF).
During deployment, any small error the model makes alters the next input state, causing the test-time data distribution to drift away from the training distribution. Standard optimizers are excellent at driving down validation loss, but they suffer from a blind spot: when layer activations are non-isotropic (i.e., heavily skewed in certain directions), standard gradient descent fails to learn features uniformly. It under-learns subtle feature directions that might be irrelevant for one-step prediction but are absolutely vital for correcting compounding errors during sequential rollouts. As a result, a model with a fantastic validation loss can perform terribly in the real world.
Methods
The authors propose Double Preconditioning (DoPr) as a lightweight, plug-in modification to existing optimizers. Instead of shaping updates purely using gradient statistics, DoPr operates in two distinct stages per layer:
- Activation-wise Preconditioning (AP): DoPr computes the empirical uncentered covariance matrix of the layer's incoming activations ($\hat{\Sigma}_z$) and multiplies it by the raw gradient. This step effectively "whitens" the feature space, forcing the model to learn features uniformly across all directions, regardless of input anisotropy.
- Gradient-wise Preconditioning (GP): The AP-adjusted gradient is then passed into a standard optimizer like AdamW or Muon. This stage provides the training stability, momentum, and accelerated convergence that modern deep learning relies on.
Crucially, the authors prove an Invariance Principle: applying AP renders the optimizer's trajectory mathematically invariant to any affine transformations of the internal activations, ensuring robust and coordinate-independent feature learning.
Datasets
The authors evaluated DoPr across a diverse suite of tasks prone to TTF distribution shifts:
- State-Based Imitation Learning: MuJoCo environments via Gymnasium (
Humanoid-v5,Half-Cheetah-v5). - Image-Based Robot Policy Learning: Challenging manipulation tasks from the Robomimic benchmark (
Tool-HangandTransportat the Proficient-Human level). - Language Model Fine-Tuning: Supervised Fine-Tuning (SFT) using
Llama-3.2-3BandLlama-3.1-8Bmodels on theOpenMathInstruct-2dataset, evaluated on mathematical reasoning benchmarks (GSM8K,GSM8K-CoT, andMATH-500). - Generative Modeling: Flow-matching using the SiT-S architecture trained on
ImageNet(256x256).
Key Insights and Ideas
- Validation Loss is a Poor Proxy for TTF: The most striking insight is that downstream gains from DoPr do not consistently correlate with better validation loss. A model trained with DoPr might have an identical or slightly worse validation loss than an AdamW baseline, yet achieve drastically higher task success rates.
- Decoupling Direction from Adaptivity: Traditional optimizers conflate optimization speed with feature geometry. DoPr elegantly decouples them: AP dictates where (in which feature directions) the model should learn, while GP dictates how fast it should get there.
- Seamless Hyperparameter Scaling: Because the GP stage normalizes the update step, DoPr seamlessly inherits existing hyperparameter scaling heuristics (like Maximal Update Parameterization, or $\mu$P). You can tune DoPr on a small model and zero-shot transfer those hyperparameters to a large-scale run.
Key Results
DoPr consistently outperformed standard baselines across all tested modalities:
- LLM Fine-Tuning (8B Model): On the 1M-sample math SFT split, DoPr-AdamW improved average final accuracy over standard AdamW by +3.9% on GSM8K, +10.8% on GSM8K-CoT, and +0.9% on MATH-500. It also significantly broadened the stable learning-rate window.
- Robotic Manipulation: In image-based Robomimic tasks, wrapping baseline optimizers (AdamW and Muon) with DoPr led to higher task success rates over training, despite yielding equal or worse training losses.
- Generative Flow Matching: On ImageNet, DoPr accelerated Fréchet Inception Distance (FID) convergence and achieved a better final perceptual quality score compared to pure AdamW and Muon.
Limitations and Future Work
Despite its strong performance, DoPr introduces a few trade-offs:
- Computational Overhead: Computing and inverting the activation covariance matrix adds a per-step overhead of roughly 1.25x wall-clock time (equivalent to an extra forward pass).
- Memory Footprint: Storing the matrix-valued preconditioner statistics requires an additional $\sim d_{in}^2/2$ parameters of optimizer state per layer.
- Dropout Incompatibility: Large dropout rates can destabilize the activation covariance buffers, meaning DoPr currently requires training with low or no dropout.
- Infrastructure Scaling: The current implementation supports Distributed Data Parallelism (DDP) but lacks native integration with model-sharding frameworks like FSDP, which the authors flag as an important direction for future engineering work.
Summary updated