1 00:00:01,000 --> 00:00:09,300 [Hal Turing] Alrighty! Thanks for tuning in! Hello AI world! I am your host, Hal Turing, and my co-host is Dr. Ada Shannon. 2 00:00:09,300 --> 00:00:37,049 [Hal Turing] Today's paper is "The case for 4-bit precision: k-bit Inference Scaling Laws," by Tim Dettmers and Luke Zettlemoyer at the University of Washington. It appeared on arXiv in December 2022, was revised in February 2023, and went to ICML 2023. Here's the puzzle. Take a 30-billion-parameter model stored in 8 bits, and a 60-billion-parameter model stored in 4 bits. Same total bits, same memory. Which one is more accurate? 3 00:00:37,049 --> 00:00:53,199 [Dr. Ada Shannon] The paper's answer is the 4-bit one, and it says that across almost every model family it tested. If you're squeezing a model onto a fixed amount of memory, that changes what you download. The question is what "best" means here, and we'll test that as we go. 4 00:00:53,199 --> 00:00:58,374 [Hal Turing] Start with why bits are the thing to count. Why not just count parameters? 5 00:00:58,374 --> 00:01:28,149 [Dr. Ada Shannon] Because generating text at small batch sizes is memory-bound. Every token needs the weights streamed in from memory, and the paper says loading a number takes over 100 times longer than computing with it. So fewer bits per weight means less to load, which means lower latency. The paper cites GPTQ kernels running 3-bit OPT-175B about 4.46 times faster, against 5.33 times fewer bits. That's close to proportional. But the relationship only holds at small batches. Once the batch is large, compute starts to matter. 6 00:01:28,149 --> 00:01:38,299 [Hal Turing] So total model bits is parameters times bits per parameter, and it stands in for both memory footprint and, at small batch, latency. 7 00:01:38,299 --> 00:01:41,825 [Dr. Ada Shannon] Right. That's the x-axis of everything in the paper. 8 00:01:41,825 --> 00:01:46,275 [Hal Turing] And the "scaling law" in the title? I know those from training. 9 00:01:46,275 --> 00:02:14,849 [Dr. Ada Shannon] Kaplan and colleagues at OpenAI, 2020, showed loss falls as smooth power laws in parameters, data and compute. Henighan and colleagues, also 2020, extended that to other domains. Those are training laws. Dettmers and Zettlemoyer add precision as an axis and measure inference. A bit-level inference scaling law is a curve of zero-shot accuracy against total model bits, one curve per precision. You ask which precision's curve sits highest. They couldn't fit good power laws to this, so they linearly interpolate between points. 10 00:02:14,849 --> 00:02:21,025 [Hal Turing] Now the word "zero-shot," which I think appears twice in this paper with different meanings. 11 00:02:21,025 --> 00:02:50,875 [Dr. Ada Shannon] It does, and keeping them apart matters. Zero-shot accuracy describes the evaluation. The model answers tasks with no examples in the prompt and no fine-tuning. GPT-2, from Radford and colleagues at OpenAI in 2019, popularized that framing. Zero-shot quantization describes the compression method. It rounds weights by a fixed rule, with no calibration data. Here that means round-to-nearest with absmax scaling. One-shot methods like GPTQ use a small batch of calibration data to choose better roundings. 12 00:02:50,875 --> 00:02:53,400 [Hal Turing] What are the evaluation tasks? 13 00:02:53,400 --> 00:03:14,400 [Dr. Ada Shannon] Mean accuracy over LAMBADA, PiQA, HellaSwag and Winogrande. Higher is better, and chance on that mean is roughly 35 percent. They also report perplexity on The Pile CommonCrawl, where lower is better. The two correlate at minus 0.94 across more than 35,000 runs. The authors call perplexity the less noisy metric, but they show accuracy in the main text. 14 00:03:14,400 --> 00:03:18,474 [Hal Turing] And everything here is post-training quantization. 15 00:03:18,474 --> 00:03:27,375 [Dr. Ada Shannon] Yes. You take a trained model and compress its weights without retraining. Inputs stay 16-bit and only the weights go to k bits. 16 00:03:27,375 --> 00:03:30,199 [Hal Turing] Now the knobs. Blocking first. 17 00:03:30,199 --> 00:03:51,875 [Dr. Ada Shannon] You flatten a weight tensor and cut it into blocks of B values. Each block gets its own absolute-max normalization constant. An outlier then only damages its own block instead of the whole tensor. The cost is extra storage for those constants. With 16-bit constants, that's 16 over B bits per parameter. At block size 64 that's a quarter bit. At 1024 it's about 0.016. 18 00:03:51,875 --> 00:03:53,875 [Hal Turing] And the data types? 19 00:03:53,875 --> 00:04:12,474 [Dr. Ada Shannon] They're different maps from k-bit codes to real values. Integer is evenly spaced. Float splits bits into exponent and mantissa. Quantile puts equal numbers of weights in each bin, which is maximum entropy, but it needs a lookup table. Dynamic exponent uses an indicator bit to vary the exponent. 20 00:04:12,474 --> 00:04:18,925 [Hal Turing] Then there's the outlier business. This is the LLM.int8() line of work, right? 21 00:04:18,925 --> 00:04:57,025 [Dr. Ada Shannon] Yes, Dettmers, Lewis, Belkada and Zettlemoyer, 2022. They found that past roughly 6.7 billion parameters, a few hidden dimensions carry very large values, and naive 8-bit rounding breaks. They isolated those outliers in 16-bit. In this paper, the authors propose proxy quantization. It's input-independent. The standard deviation of each hidden unit's weights serves as a proxy to find outlier dimensions, and the top p percent, 2 percent in the experiments, stay at 16 bits. That costs p times 16 minus k bits per parameter, about 0.24 at 4 bits. 22 00:04:57,025 --> 00:04:59,550 [Hal Turing] What's the scope of the study? 23 00:04:59,550 --> 00:05:14,525 [Dr. Ada Shannon] Four families: OPT, BLOOM and BLOOMZ, Pythia and NeoX, and GPT-2. Sizes from 19 million to 176 billion parameters, 3 to 16 bits, more than 35,000 experiments. 24 00:05:14,525 --> 00:05:22,025 [Hal Turing] So the headline is that 4-bit is almost universally optimal. What's the question we're actually asking? 25 00:05:22,025 --> 00:05:40,150 [Dr. Ada Shannon] For a fixed number of total bits, which weight precision gives the best zero-shot accuracy, and which quantization tweaks move that trade-off? One caveat on the claim up front. "Optimal" is measured against specific methods and a specific way of charging for bits. We'll see how far it reaches beyond them. 26 00:05:40,150 --> 00:05:46,850 [Hal Turing] Let's get the setup straight first. What exactly is quantized, and what stays at 16 bits? 27 00:05:46,850 --> 00:06:05,400 [Dr. Ada Shannon] The inputs and activations stay at 16 bits. Only the weights go down to k bits, anywhere from 3 to 8, plus an unquantized 16-bit baseline. The attention score matrices are left alone because they have no parameters to quantize. They're computed on the fly from activations. 28 00:06:05,400 --> 00:06:10,700 [Hal Turing] And the metric is the zero-shot accuracy mean we defined earlier? 29 00:06:10,700 --> 00:06:32,250 [Dr. Ada Shannon] Yes, plus perplexity on the Pile's CommonCrawl subset. Across the 35,000-plus runs the two correlate at minus 0.94, so they mostly agree. The authors prefer perplexity because it's less noisy. The accuracy plots are there for readability. One practical consequence: you could reproduce a scaling curve with a small perplexity evaluation instead of the full task suite. 30 00:06:32,250 --> 00:06:37,375 [Hal Turing] Then the scaling-law part. Did they get a clean power law, like Kaplan's? 31 00:06:37,375 --> 00:06:58,100 [Dr. Ada Shannon] No. They tried a bivariate power law in parameters and bit-width and it fit poorly. So they fall back on linear interpolation between measured points. The useful finding is that the curves for different precisions come out nearly parallel. Each precision is roughly the same curve shifted by an offset. That's why you can compare precisions at one total-bits budget and trust the ranking across scales. 32 00:06:58,100 --> 00:07:01,325 [Hal Turing] So what does the main result look like? 33 00:07:01,325 --> 00:07:30,775 [Dr. Ada Shannon] At a fixed number of total bits, accuracy keeps improving as you go from 16 to 8 to 4 bits. In practice, 4-bit gets you the accuracy of the 16-bit model for roughly a quarter of the bits. The only exception is BLOOM-176B, where 3-bit is slightly ahead, and the authors say not significantly. Past 4 bits the pattern breaks at 3 bits. OPT and Pythia fall to about 35% on the largest models, which is near chance for this mean. GPT-2 and BLOOM stay stable at 3 bits, but 3-bit still doesn't beat 4-bit for them. 34 00:07:30,775 --> 00:07:35,775 [Hal Turing] So two families collapse and two don't. Do they say which tweaks help? 35 00:07:35,775 --> 00:08:04,450 [Dr. Ada Shannon] Block size and data type. That's all that moves the curves. Take 4-bit Pythia. Going from blocks of 1024 to blocks of 64 costs about a quarter of a bit per weight. It improves accuracy almost as much as going from 4 to 5 bits. A quarter bit buys about what a full extra bit buys. The gain is smaller for OPT and BLOOM, and the authors link that to emergent outlier features. They put a size on the Pythia and GPT-2 gains but not on the OPT and BLOOM ones, and the numbers sit in the appendix. 36 00:08:04,450 --> 00:08:06,450 [Hal Turing] And the data types? 37 00:08:06,450 --> 00:08:28,100 [Dr. Ada Shannon] Quantile and Float beat Integer and dynamic exponent at 4 bits. Quantile is best on perplexity across models, but accuracy is noisier, so Float sometimes wins there. Integer beats Float at 5 bits, because Float depends on how you split bits between exponent and fraction. At 6 to 8 bits nothing helps. Those weights are already close to 16-bit quality, so the only way to improve scaling is to use fewer bits. 38 00:08:28,100 --> 00:08:36,100 [Hal Turing] Now the outlier part. Their fix is called proxy quantization. How does it find outliers without running data? 39 00:08:36,100 --> 00:09:03,100 [Dr. Ada Shannon] That was the design constraint. They wanted a method that doesn't depend on the input or the task. The earlier LLM.int8() work by Dettmers and colleagues thresholds hidden states, but on OPT the hidden-state standard deviation grows in later layers, so too many dimensions get flagged. Instead they look at the standard deviation of each hidden unit's weights. The units that produce outliers have weight standard deviations up to 20 times larger than the others. They keep the top 2% of those dimensions at 16 bits. 40 00:09:03,100 --> 00:09:05,525 [Hal Turing] What does that cost in bits? 41 00:09:05,525 --> 00:09:26,175 [Dr. Ada Shannon] p times 16 minus k. At 2% and 4 bits, that's about 0.24 bits per parameter. The paper charges every extra bit this way. Blocking costs 16 over the block size, so 0.25 bits at B equals 64. Outlier protection costs 0.24. Both are added to the x-axis. That's just the accounting rule. 42 00:09:26,175 --> 00:09:27,900 [Hal Turing] And the result? 43 00:09:27,900 --> 00:09:46,175 [Dr. Ada Shannon] It stabilizes 3-bit OPT and Pythia and improves their scaling, but 4-bit still scales better. At 4 bits it gives no benefit. It also doesn't help models that were already stable, like 3-bit BLOOM and GPT-2. The authors read that as outlier features not needing more than 4-bit weights. 44 00:09:46,175 --> 00:09:48,975 [Hal Turing] Fine. What do they tell people to do? 45 00:09:48,975 --> 00:10:16,450 [Dr. Ada Shannon] Default to 4-bit, block size 128 or lower, Float or quantile type. They note integer may be preferable if your hardware or kernels favor it. Their one exception is memory. A 48 gigabyte GPU holds a 66-billion-parameter model at 5 bits, about 41 gigabytes. A 175-billion-parameter model at 4 bits is about 88 gigabytes and doesn't fit. So if you want maximum accuracy there, 5-bit 66B beats the 4-bit default. 46 00:10:16,450 --> 00:10:22,075 [Hal Turing] So the default is 4 bits unless the memory arithmetic says otherwise. 47 00:10:22,075 --> 00:10:30,850 [Dr. Ada Shannon] Right. And that default rests on specific rounding and specific accounting. Whether it survives outside them is the next question. 48 00:10:30,850 --> 00:10:45,900 [Hal Turing] Part 2 ended on the question of where the 4-bit optimum comes from. OPT and Pythia collapse at 3 bits and GPT-2 and BLOOM don't. So is 4 bits a real sweet spot, or just where these methods stop working? 49 00:10:45,900 --> 00:11:06,425 [Dr. Ada Shannon] Mostly the second. The 3-bit failure is outlier-driven, and the paper's own proxy quantization rescues it. So that failure belongs to the method. Then there's the paper's GPTQ result. GPTQ is a one-shot method from Frantar and colleagues at IST Austria, 2022. It uses a small calibration batch to choose roundings. 50 00:11:06,425 --> 00:11:09,725 [Hal Turing] And that result cuts against the headline? 51 00:11:09,725 --> 00:11:26,525 [Dr. Ada Shannon] On WikiText-2 perplexity, lower is better. At block size 64, 2-bit GPTQ scores 9.18 and 3-bit data-free Float scores 9.99. The model with fewer bits wins. So the optimum moves when the method changes. 52 00:11:26,525 --> 00:11:30,250 [Hal Turing] Give me the authors' side, though. That's one table. 53 00:11:30,250 --> 00:12:01,600 [Dr. Ada Shannon] Fair, and they say so themselves. Their Figure 5 shows the blocking insight carries over. 4-bit GPTQ without blocking looks like 4-bit Float with block 64. They also flag one-shot methods as the route below 4 bits. What's unknown is the full curve. The Table 1 model isn't identified in the text I have, and the full GPTQ scaling study was estimated at 5,120 GPU days. So the supported claim is that 4-bit is optimal for data-free rounding at these block sizes. It is not a claim about bits in general. 54 00:12:01,600 --> 00:12:07,026 [Hal Turing] Later work backs that up, doesn't it? Some 2-bit methods are competitive. 55 00:12:07,026 --> 00:12:24,276 [Dr. Ada Shannon] The AQLM paper by Egiazarian and colleagues in 2024 uses multiple learned codebooks and reports 2-bit models that are competitive on total-bits curves. I'd treat that as a counterexample to the universal reading, not a refutation of this paper's regime. 56 00:12:24,276 --> 00:12:33,426 [Hal Turing] Now the x-axis. Blocking is charged 16 over B bits per weight. How much does the 4-bit conclusion depend on that charge? 57 00:12:33,426 --> 00:12:55,876 [Dr. Ada Shannon] The gap between 3-bit and 4-bit depends on where those points sit. At block 64, a 4-bit model is at about 4.25 bits. If the constants were 32-bit, the overhead would double to 0.5 bits. The extracted text doesn't report that sensitivity or alternative scale formats. That's unreported, not wrong. Also, the 2-bit versus 3-bit comparison in Table 1 doesn't place either point on the x-axis with its overhead. 58 00:12:55,876 --> 00:13:01,726 [Hal Turing] Same question for outliers. The paper says protecting them doesn't help scaling. 59 00:13:01,726 --> 00:13:31,051 [Dr. Ada Shannon] That was tested with one heuristic: keep 2% of dimensions at 16 bits, picked by weight standard deviation. SmoothQuant, by Xiao and colleagues at MIT in 2022, migrates activation outliers into the weights instead. AWQ, from Lin and colleagues at MIT in 2023, protects salient channels using activation statistics, and it stays at 4 bits without mixed precision. Neither was run at matched bit budget, so one weak criterion can't settle whether outlier protection is worthless. 60 00:13:31,051 --> 00:13:34,851 [Hal Turing] What about the claim that this influenced practice? 61 00:13:34,851 --> 00:13:53,101 [Dr. Ada Shannon] QLoRA, by Dettmers, Pagnoni, Holtzman and Zettlemoyer in 2023, introduced NF4. That's a quantile-style 4-bit type with small blocks, which matches the data-type and block-size findings here. That shows the recommendations were useful. It doesn't prove 4 bits is universal. 62 00:13:53,101 --> 00:13:56,326 [Hal Turing] And the models themselves are old. 63 00:13:56,326 --> 00:14:18,976 [Dr. Ada Shannon] Right. OPT, BLOOM, Pythia and GPT-2 are 2019 to 2022 models. Kumar and colleagues, in Scaling Laws for Precision in 2024, fit actual functional forms. They find post-training quantization hurts more as training tokens grow. So heavily overtrained models may not behave like these. Here the curves are piecewise linear because power-law fits were poor. That gives interpolation, not extrapolation. 64 00:14:18,976 --> 00:14:22,801 [Hal Turing] Then the latency story. Nobody measured it. 65 00:14:22,801 --> 00:14:51,551 [Dr. Ada Shannon] Correct. Latency is argued from memory-bound reasoning, valid while the batch fits in L1 cache, below roughly 60 on an RTX 3090. Busy multi-user serving is compute-bound, which Pope and colleagues at Google covered in 2022. Quantile lookup tables parallelize badly, and no optimized kernels were tested. The KV cache and activations stay at 16 bits. At long context the cache can outweigh the weights, so total weight bits isn't always the memory that matters. 66 00:14:51,551 --> 00:14:55,701 [Hal Turing] And the metric noise? Four tasks, no error bars. 67 00:14:55,701 --> 00:15:15,226 [Dr. Ada Shannon] That's a real gap. The authors say perplexity is less noisy, and Float versus quantile ranking depends on which metric you use. Small gaps like 4-bit versus 5-bit between data types need uncertainty estimates the paper doesn't give. BLOOM-176B preferring 3-bit was called not significant, but I see no test. 68 00:15:15,226 --> 00:15:18,926 [Hal Turing] So what should someone with a fixed GPU do? 69 00:15:18,926 --> 00:15:39,051 [Dr. Ada Shannon] Start at 4 bits, block size 64 to 128, Float or quantile type, and prefer the bigger 4-bit model at fixed memory. Model sizes are discrete, so check what fits. The paper's own 48 GB example shows 66B at 5 bits fitting where 175B at 4 bits doesn't. Below 4 bits, look at calibrated methods. 70 00:15:39,051 --> 00:15:41,126 [Hal Turing] Where does this go next? 71 00:15:41,126 --> 00:15:58,826 [Dr. Ada Shannon] Data types that are efficient in bits and friendly to hardware. Keeping outlier information without paying extra bits. Combining these zero-shot insights with one-shot methods. And scaling laws that include KV cache and low-bit activations, for serving at high throughput. 72 00:15:58,826 --> 00:16:20,076 [Hal Turing] So the takeaway is that this paper builds a solid method for comparing precisions at equal bits. Its default of 4 bits with small blocks is well supported for data-free, weight-only, small-batch quantization of these model families. The optimum itself belongs to the method and the accounting, not to bits as such. 73 00:16:20,076 --> 00:16:21,976 [Dr. Ada Shannon] That's the right boundary. 74 00:16:21,976 --> 00:16:26,051 [Hal Turing] Thanks for listening, everyone. We'll see you next time.