NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Modular Duality in Deep Learning

Jeremy Bernstein, Laker Newhouse

Introduction

Standard gradient descent updates neural network weights by directly subtracting the gradient (scaled by a learning rate). However, from the perspective of optimization theory, this operation fails a basic mathematical "type check." Gradients are technically "dual vectors" (linear functionals), while weights are "primal vectors." Subtracting one from the other directly assumes the loss landscape is perfectly uniform in all directions—an assumption that is almost never true for complex neural networks.

This paper introduces modular dualization, a theoretical framework that treats gradients properly as dual vectors and maps them back to the primal weight space before an update. By recursively building these maps for different layer types, the authors unify two major optimization trends—training speed (e.g., Shampoo) and architectural scalability (e.g., maximal update parameterization, or $\mu$P)—into a single, highly efficient toolkit.

The Primal-Dual Mismatch

Existing solutions to the primal-dual mismatch are often fragmented. Methods like Shampoo focus on "preconditioning" the gradient to speed up training by accounting for the curvature of the loss landscape. Conversely, methods like $\mu$P focus on scaling rules to ensure training remains stable as model width increases.

The authors seek a unified, first-principles framework that achieves both speed and scalability simultaneously, proving that $\mu$P and Shampoo are actually partial approximations of the same underlying duality map for linear layers.

Modular Dualization

The core contribution of the paper is a three-step recursive procedure to correctly map gradients to weight updates:

  1. Assign Operator Norms: Each layer type (Linear, Embed, Conv2D) is assigned a specific mathematical norm based on its input-output semantics. For instance, a Linear layer is viewed through the lens of an RMS-to-RMS operator norm.
  2. Construct Duality Maps: For each layer, a specific map is derived that transforms its gradient into a weight update, minimizing a local quadratic model of the loss.
  3. Recursive Induction: These layer-wise maps are combined using a "modular norm" to create a single, cohesive duality map for the entire neural network architecture.
Duality maps for common neural network modules.

To make this theoretically rigorous approach practical, the authors developed GPU-friendly algorithms. For Linear and Conv2D layers, the duality map requires projecting onto the space of semi-orthogonal matrices (closely related to Singular Value Decomposition, or SVD). Because explicit SVD is computationally prohibitive during training, they utilize a "rectangular Newton-Schulz iteration"—a fast, iterative matrix method that runs highly efficiently on modern hardware.

Key Insights and Experimental Results

The authors tested their duality-based optimizers primarily on CIFAR-10 using MLP architectures, yielding several compelling insights:

  • Stable Learning Rate Transfer: A major pain point in deep learning is that the optimal learning rate often shifts as a model gets wider. Unlike standard Adam, the duality-based approach maintains a remarkably stable optimal learning rate across varying network widths (tested from $2^5$ to $2^{12}$ parameters wide).
  • Superior Convergence: In controlled experiments, the duality-based method reached significantly lower final training losses than both standard Adam and Adam with $\mu$P within the same number of epochs.
Duality-based optimization (right) shows stable learning rate transfer across widths compared to standard Adam (left).
  • Feature Learning at Scale: There is a common theoretical belief that in very wide networks, weights stay extremely close to their initial values (lazy training). The authors challenge this by "watermarking" initial weights with a visible pattern (the letter "a"). They demonstrated that duality-based training successfully "erased" this watermark, proving that substantial, meaningful feature learning occurs even in the infinite-width limit.

Real-World Impact and Future Work

The theoretical principles outlined in this paper are not just academic; they form the foundation of the Muon optimizer. Muon recently set speed records for training NanoGPT and has been successfully scaled to train a 1.5 billion parameter transformer.

While the theory is robust, the authors note that choosing the "correct" operator norm for a layer still relies somewhat on interpreting the layer's semantic function. Future work may involve formalizing a stricter "type system" for deep learning, where activation spaces are explicitly typed by their intended norms. Additionally, exploring the stability of Newton-Schulz iterations in lower-precision environments (like FP8) remains an exciting frontier for scaling these optimizers further.

Summary updated

BibTeX
@inproceedings{bernstein2025modular,
  author = {Jeremy Bernstein and Laker Newhouse},
  title = {{Modular Duality in Deep Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=hErdffTsLu},
}
Figure