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

Muon-Optimized Distillation and Quantization for LLM Deployment

Aug 21, 202622 minAudio
ShareXLinkedInFacebookWhatsAppEmail

In this episode: • Introduction & The Edge Deployment Problem: Professor Norris and Linda introduce the episode's paper, focusing on the difficulty of running large language models on edge devices with limited memory and compute. • The Multi-Teacher Distillation Pipeline: Linda explains the dual-teacher approach, using Llama 4 Scout for synthetic data generation and Llama 3.3 70B for logit-based knowledge distillation to a 3B parameter student. • Hyperparameter Surprises with Optuna: The hosts discuss the surprising finding that Bayesian optimization consistently drops the cross-entropy loss in favor of pure Kullback-Leibler divergence from the teacher. • The Muon Optimizer and Quantization Robustness: Linda introduces the Muon optimizer and explains how fine-tuning with it dramatically reduces accuracy decay when the model is compressed to 4-bit weights using GPTQ. • Results & Conclusion: A summary of the final throughput and latency gains, proving that highly specialized, edge-ready LLMs can achieve double the speed and half the memory without sacrificing accuracy.

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

Transcript

From the show.

## Introduction & The Edge Deployment Problem

Norris: Welcome back to Mechanical Dreams, the podcast where we untangle the heavily weighted webs of machine learning and natural language processing. I am Professor Norris, your resident skeptic who remembers when a neural network with three hidden layers was considered showing off. And across from me is my brilliant graduate student, Linda, who always brings us the latest and greatest from the arXiv trenches. How are you doing today, Linda? Linda: I am doing great, Professor! And I am so excited for today's episode because I brought a paper that tackles one of your favorite complaints: the absolute nightmare of deploying massive models in the real world. The paper is titled Advancing Model Refinement: Muon-Optimized Distillation and Quantization for LLM Deployment. It is by Jacob Sander, Brian Jalaian, and Venkat R. Dasari. Norris: That is quite the mouthful of a title. Muon-optimized distillation and quantization. Let me guess, they are trying to cram a multi-billion parameter large language model onto a smart toaster again? Linda: Well, maybe not a toaster, but resource-constrained edge devices for sure! The authors are addressing a huge pain point in our field right now. We have these incredible LLMs doing amazing natural language processing, but inference requires massive compute, memory, and energy. If you want to deploy specialized models locally, say on a mobile phone or a drone, you hit a strict hardware wall. Norris: Right, the classic edge deployment problem. It is something my colleagues and I joke about. We spend billions of dollars training these models across massive GPU clusters, and then some poor engineer is told to make it run on a device with just a few gigabytes of RAM. Usually, you have to aggressively prune or quantize the model, which just decimates its reasoning abilities. Linda: Exactly. And that is why I love this paper. Instead of just applying one compression method and hoping for the best, the authors built an integrated, holistic pipeline. They take an already compact model, specifically Meta's Llama 3.2 3B Instruct, and figure out how to specialize it for a very specific task, compress it to half its size using GPTQ quantization, and actually preserve or even enhance its performance using a very clever distillation trick. Norris: Okay, you have my attention. Taking a 3 billion parameter model and cutting its memory in half means we are getting down to about 3 gigabytes. That is prime territory for real-world edge hardware. But I know from experience that fine-tuning and then quantizing usually leads to catastrophic accuracy decay. Linda: It usually does! But that is exactly what they solve. And spoiler alert, it has to do with that funny word in the title: Muon. Norris: A cliffhanger! Alright, let us get into the weeds. How exactly are they teaching this tiny model to punch above its weight class before they squash its precision?

## The Multi-Teacher Distillation Pipeline

Norris: So at the end of our last segment, you left me hanging with the promise of teaching our tiny 3 billion parameter model to punch above its weight class before we ruthlessly compress it. You mentioned a pipeline. Where do we begin? Linda: We begin with the training data, or rather, the lack of it. When you are specializing a model for an edge device, you often do not have a massive, perfectly curated dataset for that specific task. To solve this, the authors use a multi-teacher distillation pipeline. And they literally use two different teacher models for two completely different purposes. Norris: Multi-teacher? That sounds like having two professors co-teaching a seminar. It usually just ends up confusing the graduate students. Why on earth would they need two teachers? Linda: I promise it is much more coordinated than an academic seminar! Teacher 1 is used purely for generating synthetic data. For this, they pull out the big guns: Meta's Llama 4 Scout 109B model. Because it is so large and powerful, it has a very broad data distribution, making it perfect for generating high-quality, task-aligned question-and-answer pairs. Norris: Ah, the self-instruct paradigm. So they are essentially using the 109-billion parameter model to bootstrap a training dataset for the smaller model. Linda: Exactly. They feed Teacher 1 seed prompts containing task-specific keywords. For example, if they are targeting the MMLU benchmark, they might use keywords like 'Astronomy' or 'Virology'. Teacher 1 then generates sub-topics, creates instruction prompts, and finally generates the question-answer pairs to cover the domain comprehensively. Norris: And how do they ensure the generated data is actually good? Generative models are known to hallucinate or produce poorly formatted garbage, even the big ones. Linda: They implement a self-critique step. Teacher 1 evaluates its own generated pairs using a scoring rubric and simply discards the poorly formed entries. They target about 600 question-answer pairs for each of the 8 benchmarks they tested, things like ARC-easy, CommonsenseQA, and HellaSwag. After filtering, they format it all into the standard Alpaca format to preserve the student model's instruction-tuning capabilities. Norris: That is a very robust way to handle data sparsity. So we have our 600 pristine, task-specific examples. What is Teacher 2 doing? If Llama 4 Scout is so smart, why not just use it to distill the knowledge directly into our 3B student? Linda: That is the most elegant part of the paper, Dr. Norris. Teacher 2 is Llama 3.3 70B Instruct. The authors switch to this model for the actual logit-based knowledge distillation. And they do it for one very specific, crucial reason: Llama 3.3 70B and the student, Llama 3.2 3B, share the exact same tokenizer. Norris: Oh, that is brilliant! I have reviewed so many papers where researchers completely ignore tokenizer alignment. If you try to do logit-based distillation between models with different tokenizers, their vocabulary spaces are totally misaligned. Linda: Right! Because in logit-based distillation, you are calculating the Kullback-Leibler Divergence, or KLD, between the probability distributions of the teacher and the student. You are trying to make the student's output probabilities match the teacher's. Norris: Exactly. And if token ID 1500 means 'apple' for Teacher 1 but means 'asteroid' for the student, the loss function is going to explode. You are essentially comparing apples to tokenized asteroids. The student learns nothing but noise. Linda: Exactly. By sharing the tokenizer, the probability distributions map perfectly. This allows the student to learn from the rich soft labels of the 70B teacher. Soft labels give the student so much more information than just a ground-truth hard label, because it tells the student exactly how wrong or right alternative tokens might be. It acts as a fantastic regularizer. Norris: It is a beautifully decoupled architecture. Use the massive model with a different tokenizer for generating the text dataset, then use the slightly smaller, tokenizer-aligned model to generate the probability distributions for that text. How are they actually applying these updates to the student model? Full fine-tuning on a 3 billion parameter model is still quite heavy. Linda: They use LoRA, Low-Rank Adaptation. By injecting trainable low-rank matrices into the linear layers and freezing the original weights, they only optimize a tiny fraction of the parameters. This drastically reduces the memory and computational costs compared to full fine-tuning, while still avoiding catastrophic forgetting. Norris: LoRA is an absolute staple at this point. So they do a parameter-efficient fine-tuning pass over this synthetic dataset, trying to minimize both the standard cross-entropy loss from the dataset labels and the KL divergence from Teacher 2. Balancing those two losses is usually a dark art. Let me guess, they did a grid search for weeks to find the magic weight parameter? Linda: Actually, they used Bayesian Hyperparameter Optimization with Optuna using just 16 samples. They optimized the learning rate, LoRA rank, weight decay, and that critical alpha parameter balancing the two losses. And Dr. Norris, what the optimizer chose for that alpha parameter was incredibly surprising. Norris: Another cliffhanger, Linda? You are really mastering the art of podcast suspense. Let us take a short break, and when we come back, we will dive into what this Bayesian optimizer discovered.

## Hyperparameter Surprises with Optuna

Norris: We are back. And before the break, Linda, you were about to tell me what Optuna, our Bayesian optimization overlord, decided to do with the loss function. As a reminder for our listeners, the pipeline is trying to balance Cross-Entropy loss from the hard synthetic labels, and Kullback-Leibler Divergence from our 70-billion parameter teacher model. Linda: Right! The parameter 'alpha' controls this balance. An alpha of zero means the model only learns from the cross-entropy of the text labels. An alpha of one means it only learns from the KL divergence of the teacher's probabilities. I expected a balanced mix, maybe 0.5 or 0.7. But across almost all the tasks, Optuna consistently set alpha to exactly 1.0. Norris: Wait, exactly 1.0? It completely dropped the supervised cross-entropy term? Linda: Completely dropped it! The hyperparameter optimization systematically eliminated the hard label loss across multiple benchmarks. The model learned entirely by mimicking Teacher 2. Norris: That is fascinating. You usually expect researchers to force at least a small weight on the ground truth. But Optuna essentially looked at the synthetic text labels and said, 'No thanks, I will just copy Teacher 2's brain directly.' Linda: That is a perfect way to put it. And it actually makes a lot of sense when you look at the validation loss on their 10 percent holdout split. The consistent choice of alpha equals 1 indicates that pure KL-divergence alignment with the strong 70B teacher is simply the best signal for minimizing loss. Norris: It does make mathematical sense. We touched on this earlier. A hard label is essentially a one-hot vector. It is a single '1' for the correct word and a vocabulary full of '0's for everything else. It is incredibly sparse. But Teacher 2's probability distribution contains a wealth of structural and semantic information about the language. It tells the student the relative likelihood of every single possible token. Linda: Exactly. And because they were so careful to share the tokenizer between the student and Teacher 2, that rich information transferred flawlessly. Optuna basically recognized that blending in the sparse hard labels actually degraded the learning process, providing a much lower-quality signal compared to the teacher's logits. Norris: I have to hand it to them, using Bayesian optimization here was a very smart move. If they had tuned this by hand, they probably would have forced some arbitrary blend, like a 50-50 split, and wondered why the final performance was suboptimal. Optuna modeled it as a Gaussian process and found the true optimum. Linda: Right, and it did that in just 16 evaluations! And remember, Optuna was simultaneously optimizing the LoRA rank, the LoRA scaling factor, the learning rate, weight decay, and the distillation temperature. Finding that sweet spot by hand in such a highly non-convex, high-dimensional space would be impossible. Norris: So now we have an optimally fine-tuned, task-specialized 3-billion parameter model. But earlier you promised me we were putting this thing on an edge device. In 16-bit precision, a 3B model is still around 6 gigabytes of memory. That is still a bit heavy for a lot of embedded edge systems. Linda: You are completely right. To get it ready for the edge, they had to shrink it further. So they compress the student model using GPTQ post-training quantization. Norris: GPTQ is an excellent algorithm. Let me guess, they quantized it down to 4 bits? Linda: Yes, specifically W4A16 quantization. That means the weights are compressed to 4 bits, while the activations stay in 16 bits. This cuts the memory footprint in half, bringing the model down to just 2.86 gigabytes. Norris: Under 3 gigabytes is phenomenal. But Linda, you know as well as I do that there is no free lunch. Post-training quantization, especially aggressive 4-bit quantization on a small model that has just been fine-tuned, is notorious for causing catastrophic accuracy decay. Linda: Normally, you would be absolutely right! But this is where the second half of the paper's title comes into play. They did not just use the standard Adam optimizer during that fine-tuning step we just talked about. They ran parallel experiments using a highly specialized optimizer called Muon. Norris: Muon. Now that is a name I have been seeing pop up in pre-training optimization discussions recently. But does it actually help with quantization decay?

## The Muon Optimizer and Quantization Robustness

Norris: At the end of the last chapter, you dropped a very heavy physics term on me. Muon. I have seen the chatter on arXiv about it. It uses Newton-Schulz iteration to factor gradients and performs descent over the spectral norm of the weight matrices, effectively bypassing the noisy principal direction you get with Adam. Very elegant math. But what does that have to do with saving our 4-bit quantized model from catastrophic forgetting? Linda: It all comes down to outliers! Previous research by Park and colleagues showed that when you pre-train a model with Muon, the resulting network has a much lower population of outlier channel activations compared to a model pre-trained with Adam. Norris: Ah, of course! Outliers are the absolute bane of quantization. If you have a few massive activation spikes, your quantization grid has to stretch to accommodate them, squashing all the normal, nuanced values into a single bin. You lose all your precision. Linda: Exactly! By suppressing those outliers, Muon-optimized models fit much more neatly into those tiny 4-bit bins, drastically reducing rounding errors. But, as you pointed out, that earlier research was specifically about pre-training. The authors of this paper wanted to know: does this quantization robustness hold up if we only use Muon for a single epoch of parameter-efficient fine-tuning with LoRA? Norris: I would be highly skeptical. LoRA only updates a tiny fraction of the model's parameters. How could a single epoch of updating low-rank adapter matrices fundamentally change the outlier distribution enough to save the model from GPTQ's wrath? Linda: I would not have believed it myself without the empirical data, Dr. Norris. They ran the entire hyperparameter optimization and fine-tuning pipeline twice: once with Adam, and once with Muon. Then they measured the accuracy of both before and after applying the 4-bit GPTQ compression. Norris: Alright, let us hear the damage. How did our old industry-standard friend Adam fare? Linda: Well, on the ARC-easy benchmark, the Adam-optimized model dropped about 3.2 percent in accuracy when it was quantized. But the Muon-optimized model? It dropped only half a percent. Norris: Half a percent? That is barely statistical noise! Are you saying that just by swapping the optimizer for the fine-tuning step, they almost entirely eliminated the quantization penalty? Linda: Yes! And it was not just a fluke on one dataset. Across 6 of the 8 benchmarks they studied, the Muon-optimized models degraded significantly less than their Adam counterparts when subjected to the exact same aggressive 4-bit compression. Norris: That is genuinely a paradigm shift. We usually think of optimizers just as vehicles to get us to the lowest loss possible on a training landscape. But this implies the optimizer is actually sculpting the geometry of the weights to be inherently more compression-friendly. Linda: Exactly! The authors explicitly call it a 'critical design lever in the compression-aware fine-tuning pipeline.' It turns out that performing gradient descent under the spectral norm of the weight updates disproportionately benefits these small models destined for the edge. Norris: And it synergizes perfectly with the distillation we talked about earlier. So, if we look at the final scoreboard, how does this fully optimized, Muon-distilled, 4-bit model compare to just taking the base model and quantizing it out of the box? Linda: It dominates. The pipeline using the Muon optimizer surpassed the accuracy of a naive GPTQ-quantized model across 5 of the benchmarks. And if you include the Adam variant for the specific datasets where it performed better, the integrated framework wins on 6 out of 8 tasks. Norris: I have to say, Linda, you have completely won me over on this framework. They solved the data sparsity problem with a 109-billion parameter generator, solved the distribution shift with a 70-billion parameter tokenizer-aligned teacher, completely bypassed the hard labels with Bayesian optimization, and then shielded the whole thing from quantization decay using spectral norm gradient descent. Linda: It really is a mechanical dream! But the ultimate test for edge deployment is not just maintaining accuracy on a benchmark. It is speed and responsiveness. In our final segment, we need to talk about what happens when you actually load this tiny 3-gigabyte model onto hardware and ask it to generate tokens. Norris: I am looking forward to it. We will take a quick break, and when we return, we will see if this highly engineered student model can actually sprint. Stay tuned.

## Results & Conclusion

Norris: Welcome back. We have spent the last twenty minutes exploring a rather heroic pipeline to squeeze a highly specialized, 3-billion parameter model into a tiny 4-bit box, using dual-teacher distillation and the Muon optimizer. But the rubber meets the road at inference. Did they actually test the speed, Linda? Linda: They absolutely did. They deployed both the pre-quantized, full-precision model and their final W4A16 compressed model using vLLM to measure the exact throughput and latency metrics. Norris: Let us hear the numbers. We already know the memory footprint was slashed from about 6 gigabytes down to a highly portable 2.86 gigabytes. But what about the generation speed? Linda: The gains are exactly what you would hope for. The Inter-token Latency, or ITL, and the Time per Output Token, TPOT, both dropped by 50 percent. They went from about 17.5 milliseconds per token down to just 8.8 milliseconds. Norris: 8.8 milliseconds per token. That is incredibly snappy. For a real-time edge application, anything under 100 milliseconds feels instantaneous to a user, so being sub-10 milliseconds gives you a massive overhead buffer for other system processes. Linda: Exactly! They do note that the overall throughput gains, measured in total tokens per second, were a bit more modest, going from around 1380 to 1720 tokens per second. Norris: Ah, let me guess. The prefill phase? Linda: Nailed it, Professor! Even with the faster token generation, the per-sequence prefill overhead using the MarlinLinearKernel in vLLM bottlenecks the overall throughput slightly. But for an edge device where you are typically dealing with a batch size of one anyway, that 50 percent reduction in per-token latency is the metric that truly matters. Norris: Absolutely. Batch throughput is a data center metric; inter-token latency is a user-experience metric. So, to summarize this paper: they orchestrated synthetic data generation via a massive 109-billion parameter model, used a 70-billion parameter model with a shared tokenizer for pure logit-based distillation, optimized the hyperparameters with Optuna, shielded the weights from quantization decay using the Muon optimizer, and finally compressed it with GPTQ. Linda: That is the entire pipeline in a nutshell! And the end result is a model that uses half the memory, generates tokens twice as fast, and maintains, or even exceeds, the accuracy of the base model on specific domain tasks. Norris: I have to admit, I started this episode highly skeptical. The phrase 'integrated framework' usually means a messy Frankenstein of loosely connected scripts. But Sander, Jalaian, and Dasari have put together a truly coherent, scientifically sound methodology here. It proves that we do not have to sacrifice deployability for performance if we are smart about how we compress. Linda: I completely agree. It is a fantastic blueprint for any engineer trying to push the boundaries of what is possible on resource-constrained hardware. Norris: Well, Linda, thank you for bringing this paper to my attention, and for an excellent discussion. And thank you to our listeners for tuning in to Mechanical Dreams. Whether you are training on a thousand GPUs or deploying on a smartwatch, keep your gradients stable and your outliers in check. We will 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