Skip to content
PodSubs
ShowsPeopleGuestsJobsNewsEvents
More
BlogPodCred
Menu
ShowsPeopleGuestsJobsNewsEventsBlogPodCredNetworksSign in
Join nowSign in
  • Shows
  • People
  • Jobs
  • News
  • More
    • Guests
    • Events
    • Blog
    • PodCred
    • Networks
    Join nowSign in

Mechanical Dreams

Mechanical Dreams artwork

Pushing LLM Pretraining Scales

Jul 29, 202622 minAudio
ShareXLinkedInFacebookWhatsAppEmail

In this episode: • Introduction to Higher-Order Optimizers: Linda introduces the NVIDIA paper on SOAP and Muon, and Professor Norris expresses his initial skepticism about dethroning AdamW. • The Batch Size Wall and MoEs: The hosts discuss why AdamW struggles at massive batch sizes, particularly for the dense layers in Mixture of Experts models. • Muon and Spectral Descent: Linda explains how Muon orthogonalizes momentum using Newton-Schulz iterations to maintain stability at scale. • Fixing SOAP's Slingshot Instability: The conversation shifts to SOAP, diagnosing the stale preconditioner problem and how real-time eigenbasis updates and KL-Shampoo fix it. • Systems Engineering and Final Verdict: Professor Norris and Linda discuss the layer-wise distributed optimizer built for Megatron-LM and conclude which optimizer wins.

Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.

Transcript

From the show.

## Introduction to Higher-Order Optimizers

Linda: Welcome back to Mechanical Dreams, the podcast where we decode the latest and greatest in machine learning and natural language processing. I am Linda, and today I brought a paper that takes aim at the undisputed king of optimizers, AdamW. The paper is titled SOAP, Muon, and Beyond: Pushing LLM Pretraining Scales, out of NVIDIA. Norris: Hello everyone, Dr. Norris here. And Linda, you know I have heard this story before. Every year someone brings a new higher-order optimizer that supposedly beats AdamW. But AdamW is the cockroach of deep learning. It survives everything because it is memory-efficient and insanely easy to scale. Color me skeptical. Linda: I knew you would say that, Professor! And you are not wrong. First-order methods like AdamW dominate because they treat individual parameter elements independently, which makes them infinitely shardable across GPUs. But NVIDIA argues that when you push to extreme scales, specifically global batch sizes up to 100 million tokens for next-token prediction, AdamW actually hits a wall. Norris: 100 million tokens? That is a massive batch size. I imagine at that scale, the communication overhead of synchronous training starts dictating your optimizer choice just as much as the convergence rate. What exactly are these challengers proposing? Linda: Exactly. The challengers here are SOAP and Muon. They are higher-order methods that capture the correlational structure between gradients and the operator nature of the neural network weights. Standard higher-order optimizers usually fail because they are too complex to scale. But SOAP and Muon are designed as a middle ground. They offer the benefits of second-order methods but with manageable computational and memory overheads. Norris: Manageable overhead is doing a lot of heavy lifting in that sentence, Linda! Higher-order optimizers usually require maintaining and updating full dense preconditioners, which completely wrecks the memory-regular structure that makes AdamW so appealing in distributed execution. It makes model sharding a nightmare. Linda: That is exactly the practical tension the paper highlights. It bridges systems engineering with algorithms. The authors present a unified empirical study on multi-billion-parameter models trained on trillions of tokens. They show that with some clever algorithmic tweaks, which we will get into, these optimizers maintain training stability and quality at 100-million token batch sizes, while AdamW just degrades. Norris: Alright, I am listening. But how do we know it is not just hyperparameter tuning magic? It drives me crazy when papers claim a new optimizer is better but they just tuned it for ten times more hours than the baseline. Linda: They accounted for that too! To ensure a completely fair comparison, they used Kimi-Moonshot's update-RMS matching framework. This transfers the learning rates effectively between optimizers by keeping the root mean square norm of the parameter updates consistent. So, minimal tuning, and maximum fairness. Norris: Now that is good methodology. Update-RMS matching is very rigorous. If they actually found a way to scale these algorithms without blowing up the memory budget or cheating the learning rate, that would be a genuine breakthrough. Let us dive into the details.

## The Batch Size Wall and MoEs

Norris: So, Linda, you dropped a massive number in our last segment: a 100 million token batch size. That is astronomical. Why does AdamW, the supposed cockroach of deep learning, suddenly roll over on its back at that scale? Linda: It has to do with gradient noise, Professor. At extreme batch sizes, the noise in your gradient estimates decreases significantly. You would think less noise is good, right? But for AdamW, it is actually a problem. The element-wise second-moment estimator, the v_t term, becomes poorly calibrated. It gets overly confident and starts dictating suboptimal step sizes. Norris: Ah, it hits the classic critical batch size limit. The variance drops, the denominator in Adam shrinks or stabilizes weirdly, and suddenly your updates lose their regularizing noise. You just get diminishing returns, or worse, the training destabilizes entirely. But I noticed the paper specifically highlights Mixture of Experts, or MoE models, for this setting. Why are MoEs the focus here? Linda: Because MoEs make large-batch scaling incredibly nuanced! In a modern MoE, over 90 percent of the model parameters live in the expert linear layers. But because of sparse routing, say a top-k routing strategy, those experts do not actually see the entire batch. Norris: Right, let us think about the math. If you have a global batch size of 100 million tokens, and you are using top-8 routing across 256 experts, a single expert only processes a tiny fraction of those tokens. The effective batch size for the expert is much, much smaller. Linda: Exactly! And that lower-effective-batch regime is actually quite easy to optimize. The sparse experts are perfectly happy. The bottleneck is the dense, shared parameters in the network. Every single one of those 100 million tokens has to pass through the dense components. Norris: That is a fascinating dichotomy. The neural network is essentially experiencing two completely different optimization regimes at the exact same time. The experts are taking a nice, gentle stroll, while the dense layers are being blasted by a data firehose. So when you scale the global batch size, you are primarily stressing the dense parameters. Linda: Spot on. That is why MoE pretraining at scale is highly reliant on optimizers that can maintain stability and token efficiency specifically for those dense parameters operating at extreme batch sizes. AdamW fails the dense layers. Norris: That makes perfect sense. But wait, if you are ramping up to 100 million tokens, how are they adjusting the learning rate? You cannot just use the same learning rate for 2 million tokens and 100 million tokens. You would blow the model to pieces. Linda: They use a batch size ramp-up phase early in training, and they pair it with the Square Root Scaling Rule. To ensure the scale of the random fluctuations in the parameter updates remains similar, they adjust the learning rate by the square root of the ratio of the new batch size to the old one. Norris: The square root rule, classic. It is focused on noise and variance preservation. It is much safer than the linear scaling rule when you are making massive leaps in batch size. Linda: Yes, they tie the learning rate warmup directly to the batch size ramp-up to maintain that square-root ratio throughout. But the key takeaway here is that even with this careful, mathematically sound ramp-up schedule, AdamW simply stops improving the model. It cannot utilize the increased data parallelism. To cross that wall, you have to look at the structural updates of Muon and SOAP. Norris: Well, you have perfectly set the stage. The dense layers are crying out for a better optimizer to handle the firehose. I suppose it is time we finally talk about how Muon actually fixes this.

## Muon and Spectral Descent

Norris: Alright, so we left off with AdamW completely choking on the data firehose of a 100-million token batch size. The dense layers of our Mixture of Experts models are crying out for help. Tell me how Muon rides to the rescue here. Linda: Muon takes a radically different approach to optimization. To understand it, we have to look at how it differs from traditional higher-order methods. Usually, optimizers like Shampoo try to capture the geometry of the loss landscape by computing and storing massive preconditioner matrices. Muon completely skips that. Norris: No preconditioner? Then how is it capturing the correlational structure of the weights? That is the whole point of moving away from AdamW. Linda: It uses spectral descent! Muon calculates the gradient and applies standard momentum, just like AdamW does. But instead of dividing by an element-wise variance estimate, it takes that momentum matrix and orthogonalizes it. Norris: Orthogonalizes it... so it is effectively extracting the polar factor of the matrix. If you look at the Singular Value Decomposition, or SVD, of the momentum matrix—where the matrix equals U times Sigma times V transpose—Muon is just keeping the U and V transpose and tossing out the Sigma, the singular values. Linda: Exactly! By turning all the singular values to one, you change the direction of the update so that its spectral properties are strictly controlled. It stops any single massive singular direction from dominating the update, which inherently respects the operator structure of a 2D neural network layer. Norris: That is beautiful math, Linda, but as a systems guy, the hair on the back of my neck is standing up. Doing a full SVD on a massive parameter matrix at every single training step? That would absolutely obliterate your compute budget. GPUs hate SVDs. Linda: And that is exactly why Muon doesn't actually compute the SVD! Instead, it uses Newton-Schulz iterations to approximate the polar factor. It is a matrix polynomial iteration that runs entirely on fast matrix multiplications, which GPUs happen to be exceptionally good at. Norris: Ah, clever. So you trade a complex, branching eigensolver for a series of dense matrix multiplies. How many iterations do they need to get a good enough approximation? Linda: The NVIDIA team used 16 Newton-Schulz iterations, leveraging polynomial coefficients from a recent method called PolarExpress to speed up convergence to the polar factor. Norris: PolarExpress! You have to love the naming conventions in this field. But let us connect this back to the batch size wall. Why does this orthogonalization save us where AdamW fails? Linda: Because it structurally normalizes the update directions independent of coordinate-wise scaling. Remember how AdamW gets confused by the drop in gradient noise at extreme batch sizes? Muon does not care. It does not maintain a second-moment estimator at all. It just looks at the geometry of the whole 2D matrix. This makes it incredibly resilient to the variance fluctuations of large-batch scaling. Norris: Wait, it doesn't maintain a second moment? That means its memory footprint for the optimizer state is actually smaller than AdamW! That is a huge win for distributed training. Linda: Exactly. The tradeoff is just the compute overhead of those 16 Newton-Schulz iterations. And the empirical results back it up. Across 8-billion parameter dense models and massive hybrid MoEs up to 72 billion parameters, Muon matched or outperformed AdamW at baseline batch sizes, and kept scaling beautifully as they pushed to 100 million tokens. Norris: I noticed you said hybrid MoEs. Does this spectral magic work on every single parameter in the network? Linda: Actually, no, and that is a great nuance they discovered. When they tested it on hybrid architectures with Mamba layers, they found that Muon is best applied selectively to dense linear projections. If you try to orthogonalize the 1D convolutions in Mamba, the model performance actually degrades. For those specific filters, they fell back to AdamW. Norris: That makes perfect geometric sense. 1D convolutions encode localized temporal filters. Forcing an orthogonality constraint on a temporal filter is geometrically ill-motivated compared to a standard linear projection. It is good to see they didn't just blindly apply it to everything. Linda: Agreed. And to tie a bow on the fairness aspect, for Muon, they explicitly applied Kimi's update RMS matching framework with a correction factor based on the momentum EMA damping. So when they say it beats AdamW, it is with strictly comparable update sizes. Norris: So Muon gives us an elegant, memory-efficient way to respect matrix geometry without getting bogged down by preconditioners. But you mentioned another optimizer earlier, SOAP. If Muon is so great, why did NVIDIA even bother investigating SOAP? Linda: Because SOAP is theoretically more expressive. It combines Shampoo-style preconditioning with Adam-like adaptive updates. But, as NVIDIA found out the hard way, that expressiveness comes with some very dramatic instabilities.

## Fixing SOAP's Slingshot Instability

Norris: So, Linda, you left us hanging. Muon is out there surviving 100-million token batch sizes without breaking a sweat, but you mentioned SOAP is theoretically more expressive, yet dangerously unstable. What exactly is SOAP doing differently? Linda: To understand the instability, we need to look at how SOAP operates. SOAP stands for Shampoo-style preconditioning with Adam-like adaptive updates. It basically rotates your gradients into a basis where their row and column correlations are approximately diagonalized. Then it applies a standard Adam-style update in that basis, and rotates everything back. Norris: Right, so it gets the structural awareness of Shampoo, but keeps the element-wise adaptability of Adam. On paper, that sounds like the best of both worlds. But earlier you mentioned a slingshot instability. What is causing it? Linda: It comes down to computational shortcuts. Computing the eigenbasis for that rotation is computationally expensive. So, the reference implementation of SOAP tried to save compute by only refreshing the eigenbasis every 10 steps. And crucially, it omitted the current step's gradient in that calculation. Norris: Oh, I see where this is going. If you are training at massive batch sizes, your loss landscape is changing incredibly fast, especially early in training. If you use an eigenbasis from 10 steps ago, you are asking for trouble. Linda: Exactly! You get a stale preconditioner effect. Applying outdated gradient statistics to a rapidly changing landscape causes the optimization trajectory to literally slingshot. In the paper, they show how this leads to wildly oscillating weight gradient norms followed by massive spikes in the language modeling loss. Norris: A classic divergence. It is like driving a race car while looking at a picture of the track taken five seconds ago. You are going to hit a wall. So how did the NVIDIA team fix this? Linda: The first step was biting the bullet on compute. They had to move to real-time eigenbasis updates. They performed QR decomposition at every single step, and they made sure to include the current iteration's gradient. They actually compared using QR decomposition versus standard eigendecomposition, and found QR was cheaper with a negligible difference in loss. Norris: Ouch, QR decomposition at every step? That is heavy, but if it keeps the model from exploding, you have to do it. Did that completely solve the problem? Linda: It eliminated the major loss spikes, but the accumulation of the Kronecker factor matrices themselves can still suffer from numerical instabilities at scale. To add a critical secondary layer of stability, they integrated a recent method called KL-Shampoo. Norris: KL-Shampoo, based on Kullback-Leibler divergence minimization? How does that change the matrix accumulation? Linda: Instead of the standard marginal covariance statistics, KL-Shampoo introduces a coupled update rule where each Kronecker factor is updated using the inverse of the other. Mathematically, it changes what the factors are tracking. Standard Shampoo tracks the covariance, but KL-Shampoo tracks the singular values. Norris: That is a huge distinction for numerical stability. If it tracks singular values, it reduces the condition number of the matrices being inverted to the square root of the standard formulation. That means you are dealing with significantly better-conditioned matrices. Linda: Exactly, Professor! When you have ill-conditioned gradients with a heavy tail of small singular values, KL-Shampoo safeguards the eigenbasis recomputation against floating-point noise. It prevents numerical errors from accumulating and triggering gradient explosions. Norris: That is brilliant. And speaking of floating-point noise, what about the epsilon hyperparameter? In AdamW, epsilon just prevents division by zero, but in these higher-order methods, it usually plays a much bigger role. Linda: You are spot on. In SOAP, epsilon acts as a soft floor on the smallest effective eigenvalue of the Shampoo preconditioner. It controls the numerical floor in those preconditioned adaptive moments and factor inversions. They found that keeping it at 10 to the power of minus 8 worked well, while for Muon, epsilon lower-bounds the Frobenius norm used for matrix normalization before the Newton-Schulz iterations. Norris: So with the real-time QR updates and the KL-Shampoo integration, SOAP is finally tamed. How does it stack up against Muon after all that heavy lifting? Linda: When they tested them head-to-head on the Qwen architecture using the exact same tensor parallelism conditions, KL-SOAP actually maintained a consistent, albeit slight, edge over Muon in the final cross-entropy loss. It turns out that extra expressiveness really does pay off if you can keep it stable. Norris: Fascinating. So we have Muon which is lean and compute-friendly, and KL-SOAP which is heavier but slightly more accurate. But wait, SOAP requires maintaining Kronecker factors and eigenbases. That memory footprint must be massive. How on earth did they shard all of that across a GPU cluster without melting down the interconnect?

## Systems Engineering and Final Verdict

Linda: You hit the nail on the head, Professor. Standard distributed training approaches like ZeRO or FSDP fundamentally conflict with these higher-order optimizers. They flatten and slice tensors into 1D contiguous buffers to distribute them evenly, but Muon and SOAP strictly require full 2D parameter matrices to compute things like Newton-Schulz iterations or eigenbases. Norris: Right. If you just naively reconstruct those 2D matrices on each GPU every single step, the exposed communication overhead would completely erase any speedup you get from converging in fewer steps. So what did the NVIDIA team do to bypass this? Linda: They developed a layer-wise distributed optimizer built natively into the Megatron-LM framework. Instead of slicing individual tensors, they keep the parameter matrices fully intact. They sort the entire parameter matrices by size and distribute them across the GPUs in a round-robin sequence. Norris: Oh, that is incredibly clever! Load balancing by layer rather than by tensor shard. That ensures every GPU has a roughly equal memory load without fragmenting the matrices themselves. Each GPU just applies the heavy SOAP or Muon math to its specifically assigned layers. But wait, how do they sync up for the next forward pass? That sounds like a massive synchronization bottleneck. Linda: They use an overlapped parameter all-gather strategy. They group the layers into sequential communication buckets that logically align with the model's execution order. Instead of a single, monolithic blocking synchronization, the system issues an asynchronous all-gather for each bucket. Norris: Ah, pipelining. So as the forward pass computes activations using the current bucket's weights, the GPUs are simultaneously fetching the updated parameter matrices for the upcoming bucket. They hide the network latency entirely behind the computation. Linda: Exactly! And because keeping the matrices intact results in slightly uneven total parameter counts across the GPUs, standard uniform all-gather collectives cannot be used. They employ a variable-sized all-gather collective, which synchronizes uniquely sized contiguous buffers natively and avoids memory-wasting padding. Norris: That is top-tier systems engineering right there. So, let us get to the final verdict. We have AdamW collapsing at 100-million token batch sizes, Muon scaling beautifully with low memory overhead, and KL-SOAP being slightly more accurate but heavier on the optimizer state. Linda: The authors' conclusion is clear: both SOAP and Muon consistently outperform AdamW at the massive scales they tested. But because of its overall effectiveness, they recommend KL-SOAP over Muon in scenarios where memory footprint is not your primary limiting factor. Norris: Well, Linda, you did it. You found a paper that makes a highly practical, systems-aware case for higher-order optimizers. If KL-SOAP and Muon can survive 100-million token batch sizes on a 72-billion parameter MoE without crashing the cluster, I might just have to update my syllabus and give AdamW a slight demotion. Linda: I will hold you to that, Professor! Thank you all for listening to Mechanical Dreams. Check the show notes for a link to the NVIDIA paper and their open-source Emerging-Optimizers codebase on GitHub. See you next week!

Open the transcript file

Hosts and Guests

Nobody is credited on this episode yet.

Credit the people on this episode

Be the first to rate this episode

More episodes

All episodes
  1. You don’t need long context

    Nov 12, 202620 minAudio

    In this episode: • The Context Window Arms Race: Professor Norris and Linda introduce the episode and discuss a new NVIDIA paper challenging the necessity of massive context windows, highlighting the hidden...

    Credit the people on this episode

  2. Scaling Hierarchical Networks

    Nov 11, 202621 minAudio

    In this episode: • Intro and The Bitter Lesson: Introducing the podcast and the Cartesia paper on Hierarchical Networks. • Scaling Ladders and The BPE Comparison: Discussing the compute efficiency gains of 1-stage...

    Credit the people on this episode

  3. Perturbing Inputs Improves Pretraining Distillation

    Nov 10, 202621 minAudio

    In this episode: • Introduction and Standard Distillation: Professor Norris and Linda introduce the podcast and set the baseline for standard knowledge distillation in language models. • The Core Idea of Perturbed...

    Credit the people on this episode

  4. Why is AI-generated language so hard to understand

    Nov 9, 202620 minAudio

    In this episode: • Introduction: The Reader-Patience Budget: Professor Norris and Linda introduce the episode's topic, discussing the growing sentiment that AI-generated text is becoming overly convoluted. • The...

    Credit the people on this episode

  5. Muse Glimmer 30B

    Nov 8, 202622 minAudio

    In this episode: • Introduction & Paper Overview: Professor Norris and Linda introduce the episode and the Muse Glimmer 30B paper, outlining its goal of bringing agentic capabilities to consumer hardware. • Architecture...

    Credit the people on this episode