<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Yashwanth Sai on Medium]]></title>
        <description><![CDATA[Stories by Yashwanth Sai on Medium]]></description>
        <link>https://medium.com/@yashwanthsai123?source=rss-a718a4ad3a7b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*bO3jZ2Fm3p-MfKLO5P2W5Q.jpeg</url>
            <title>Stories by Yashwanth Sai on Medium</title>
            <link>https://medium.com/@yashwanthsai123?source=rss-a718a4ad3a7b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 10:48:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yashwanthsai123/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Why 4-Bit Quantization Is Nearly Free, and Why Shannon Puts the Hard Floor Near 2 Bits]]></title>
            <link>https://medium.com/@yashwanthsai123/why-4-bit-quantization-is-nearly-free-and-why-shannon-puts-the-hard-floor-near-2-bits-c7683e50a058?source=rss-a718a4ad3a7b------2</link>
            <guid isPermaLink="false">https://medium.com/p/c7683e50a058</guid>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[information-theory]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Yashwanth Sai]]></dc:creator>
            <pubDate>Tue, 07 Jul 2026 17:24:29 GMT</pubDate>
            <atom:updated>2026-07-07T17:24:29.432Z</atom:updated>
            <content:encoded><![CDATA[<p>Model quantization is really Claude Shannon’s information theory in action. Here’s the idea, the methods, and where the research is heading.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OfLizgt6PtvfZvpgcXYHvg.png" /></figure><p>Quantization works better than it should.</p><p>Take a language model with billions of parameters. Each weight is stored as a 16-bit number. Now shrink every weight down to 4 bits. You just threw away 75% of the storage. The model should break. It doesn’t. It still writes code, still answers questions, and the quality barely drops.</p><p>Why?</p><p>The answer comes from Claude Shannon. In 1948 he founded information theory, and in 1959 he wrote a follow-up paper that gets far less attention. Between those two papers, he described exactly how far you can compress something and where it will break. He did this decades before neural networks existed, and his rules still decide whether a language model can fit on your phone.</p><p>This article explains those rules, shows how today’s quantization methods are quietly using them, and answers the question in the title: why dropping to 4 bits costs almost nothing, while dropping below 2 destroys the model. It ends with a surprising recent finding: the models we train today are becoming <em>harder</em> to compress than the models we trained yesterday.</p><h3>Compression has a hard floor</h3><p>Most people think of compression like this: take a lot of data, store it in fewer bits. Zip files. MP3s. So quantizing a model sounds easy: just use fewer bits per weight.</p><p>Shannon’s 1948 theorem says it’s not that simple. For lossless compression, there is a hard limit called <strong>entropy</strong>. If your data truly contains H bits of information per symbol, no algorithm can store it in fewer than H bits without losing something. Not now, not ever.</p><p>Compression doesn’t create space. It only removes <strong>redundancy</strong>, the predictable and repeated parts. That’s why English text compresses to about a quarter of its size (English is very predictable), while a file of random noise cannot be compressed at all (nothing in it is predictable).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*omqD-bn7gRVPE5HJOAOcjw.png" /></figure><p>So the real question about a neural network is not “can we use fewer bits?” It is</p><p><strong>How much redundancy do the weights contain?</strong></p><p>The answer, it turns out, is a lot.</p><h3>The right theorem: rate–distortion</h3><p>Quantization is not lossless. When you round 0.03712 to 0.037, information is destroyed. So the 1948 theorem isn’t the right tool here. The right one is Shannon’s 1959 <strong>rate–distortion theory</strong>.</p><p>It asks a more practical question: if you can accept some amount of error (distortion), what is the minimum number of bits (rate) you need? The answer is a curve: a trade-off between bits and quality. Every quantization method you’ve heard of, from GPTQ to AWQ, is an attempt to slide down that curve as far as possible before the model breaks.</p><p>But here’s the key insight. What counts as “error”? The obvious answer is: how far the rounded weights moved from the originals. But nobody cares about that. What we care about is whether the model’s <em>behavior</em> changed. Does it still know Paris is in France?</p><p>And it turns out neural networks can tolerate a lot of change in their weights before their behavior changes. The reason is geometric.</p><h3>Flat valleys: why rounding is nearly free</h3><p>Picture the loss landscape of a trained model as a surface, with the model sitting at the bottom of a valley. What does that valley look like up close?</p><p>The Hessian (the matrix of second derivatives) tells us. For trained networks, the answer is consistent: a few directions are steep, where moving even slightly makes the loss shoot up, but the vast majority of directions are nearly flat. You can move the weights a surprising distance and the loss barely changes.</p><p>Quantization is exactly that kind of move. Rounding every weight nudges the model in some direction, and if the valley is flat in most directions, the nudge costs almost nothing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4O7LPGZ2Drnse-efxqlmLQ.png" /></figure><p>Put simply: the weights use 16 bits each, but the <em>function</em> they compute only needs a few of those bits. The rest is redundancy, and redundancy is exactly what Shannon lets us remove for free.</p><p>There’s a nice irony here. We usually treat overparameterization as waste. But that extra room is exactly what makes networks compressible.</p><h3>Modern methods are Shannon’s ideas in disguise</h3><p>Once you see the rate–distortion picture, the quantization literature stops looking like a bag of tricks. It looks like one idea, applied four ways.</p><p><strong>1. Non-uniform codebooks.</strong> Trained weights follow a bell curve: most are near zero, few are large. Shannon’s advice for such data is to spend your precision where the values actually are. Vector quantization, which clusters the weights and stores cluster IDs, does exactly this. It’s classic entropy coding with a machine learning label on it.</p><p><strong>2. Curvature-aware rounding.</strong> GPTQ, one of the most widely used methods, quantizes weights one at a time and uses second-order (Hessian) information so the remaining weights can compensate for each rounding error. The idea traces back through <em>Optimal Brain Surgeon</em> to Yann LeCun’s <em>Optimal Brain Damage</em> from 1989. In Shannon’s terms: it measures distortion in the metric that actually matters (the loss) instead of raw weight error.</p><p><strong>3. Outliers.</strong> A tiny fraction of weights and activations in LLMs are huge, orders of magnitude larger than the rest, and they matter a lot. A simple uniform quantizer has to stretch its range to cover them, wasting most of its precision on empty space. LLM.int8() solves this by keeping the outliers in high precision and quantizing everything else. That’s mixed-rate allocation, exactly what the theory recommends.</p><p><strong>4. Rotations.</strong> My favorite. Methods like QuIP, QuaRot, and Google’s TurboQuant rotate the vectors <em>before</em> quantizing them. A rotation changes nothing mathematically, since lengths and angles are preserved, but it spreads the variance evenly across coordinates and smooths out the outliers. Instead of building a complicated code for ugly data, you reshape the data to fit a simple code. TurboQuant reports performance near the information-theoretic limit, a phrase you rarely get to say about a systems paper.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WjkQpXqzZ5SPF3Av5PVqyQ.png" /></figure><p>None of this is coincidence. When a limit is fundamental, every method eventually runs into it, and starts to look like the theory that predicted it.</p><h3>The cliff at 2 bits</h3><p>So how low can you go? In practice, the damage curve looks like this: from 16 bits down to about 4, almost nothing happens. Around 3 bits, quality starts to slip. Below 2, the model collapses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yIxTI49KKaAxnWHDk60Orw.png" /></figure><p>Why does the cliff sit there? Recent research on memorization gives a striking answer.</p><p>Morris and colleagues measured how much a model can actually store. Their trick: train transformers on pure random data, where there are no patterns to learn, so anything the model recovers must have been memorized bit by bit. The result: about <strong>3.6 bits per parameter</strong>, stable across model sizes. An earlier study by Allen-Zhu and Li, counting stored facts instead, found about 2 bits per parameter. So a parameter’s real storage budget is somewhere between 2 and 4 bits.</p><p>Now the cliff makes sense. Above that budget, quantization removes redundancy, which is just wasted precision. Below it, there is no redundancy left. You’re no longer compressing how the knowledge is written down. You’re deleting the knowledge itself. The cliff in the chart is Shannon’s entropy floor, showing up in an experiment he never lived to see.</p><p>There is one way around it: don’t create the entropy in the first place. BitNet-style models are <em>trained from scratch</em> with ternary weights. Every parameter is just −1, 0, or +1, about 1.58 bits. Training shapes the loss valley so that a good solution exists right on those three values. You’re not compressing a finished model; you’re forcing the model to learn a compressible solution from day one. Whether these models truly match full-precision quality at scale is still hotly debated, and projects like ParetoQ exist specifically to settle which bit-width wins. The debate is live, which is the most exciting thing you can say about a research question.</p><h3>The frontier: the floor is rising</h3><p>Here’s the recent result I find most interesting.</p><p>Researchers at Tencent AI Lab discovered that low-bit quantization works best on <strong>undertrained</strong> models. Early in training, a big model quantizes almost for free. But as training continues and the model absorbs more tokens, quantization starts causing real damage. In their experiments, a 12B model handled 3-bit quantization fine up to roughly 1⁰¹¹ training tokens. After that, degradation grew quickly. Their projection: models trained on 100 trillion tokens may not be good candidates for low-bit quantization at all.</p><p>Through the Shannon lens, this makes perfect sense. More training packs more information into each parameter. More information per parameter means higher entropy. Higher entropy means less redundancy, and less room to compress. <strong>The entropy floor isn’t fixed. It rises as training fills the weights up.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3sQbO6XjF3fY9O4AN1NSMQ.png" /></figure><p>Think about what that means: we are training models to be smarter, and by doing so, we are training them to be incompressible. It’s a scaling law running in the opposite direction of the ones we usually celebrate.</p><p>A few other active fronts, briefly:</p><ul><li><strong>KV-cache quantization</strong> may now matter more than weight quantization. At long context lengths, the cache dominates memory, not the weights. Methods like KIVI push it down to 2 bits, and TurboQuant does it with no calibration data at all.</li><li><strong>Reasoning models.</strong> The first systematic study found that 8-bit and 4-bit weight-only quantization stay essentially lossless, but below that, accuracy drops. It drops fastest on the hardest tasks and on RL-trained reasoning models. My guess (mine, not theirs): small per-token errors compound over a thousand-token chain of thought, like noise building up in a long channel.</li><li><strong>Hardware.</strong> Patent filings now describe processors built specifically for low-bit models. The theory is turning into silicon.</li></ul><h3>What this is really about</h3><p>To me, the fact that quantization works at all points at something bigger.</p><p>Compression and understanding are two views of the same thing. To compress data is to have found its structure; whatever refuses to compress is either noise or something you haven’t understood yet. When we quantize a model and it survives, we learn how much of it was scaffolding. When it finally breaks, we’ve found the load-bearing walls: the few bits per parameter where the knowledge actually lives.</p><p>Shannon worked all this out for telephone lines, before the transistor was famous, before anyone had trained anything. Seventy-five years later, his rate–distortion curve quietly decides whether a language model fits in your pocket. A theory built for copper wire now governs the compression of machine minds. That kind of convergence, an old curve meeting a brand new network and fitting, is exactly why I fell for this field.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7683e50a058" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>