WaterSIC: Information-Theoretically (Near) Optimal Linear Layer Quantization
Organizations: MIT · Independent Researcher · Hebrew University of Jerusalem
Abstract
This paper considers the problem of converting a given dense linear layer to low precision. The tradeoff between compressed length and output discrepancy is analyzed information theoretically (IT). It is shown that a popular GPTQ algorithm may have an arbitrarily large gap to the IT limit. To alleviate this problem, a novel algorithm, termed ``WaterSIC'', is proposed and is shown to be within a rate gap of 0.255 bits to the IT limit, uniformly over all possible covariance matrices of input activations. The key innovation of WaterSIC's is to allocate different quantization rates to different columns (in-features) of the weight matrix, mimicking the classical IT solution known as "waterfilling". Applying WaterSIC to the Llama and Qwen family of LLMs establishes new state-of-the-art performance for all quantization rates from 1 to 4 bits. Our code is available at https://github.com/egorlifar/watersic.
Figures & tables
| Method | Avg. Bitwidth | WikiText-2 PPL |
|---|---|---|
| WaterSIC | 1.00 | 82.44 |
| WaterSIC-FT | 1.00 | 30.47 |
| WaterSIC-FT | 1.50 | 18.50 |
| WaterSIC | 1.50 | 30.73 |
| Huffman-GPTQ | 1.52 | 1000+ |
| Huffman-GPTQ | 1.94 | 86.80 |
| Method (bits) | 2.125 | 2.625 | 3.125 | 3.625 | 4.125 |
|---|---|---|---|---|---|
| Huffman-GPTQ | 13.97 | – | 10.34 | – | 9.81 |
| GPTQ | 57.51 | – | 12.77 | – | 10.10 |
| Huffman-RTN | 593.05 | – | 10.75 | – | 9.90 |
| RTN | – | 16.30 | – | 10.30 | |
| WaterSIC | 11.37 | 10.44 | 10.03 | 9.87 | 9.79 |
| WaterSIC-FT | 10.18 | 9.85 | 9.73 | 9.70 | 9.67 |
Appendix figures & tables27 assets
Supplementary material from the paper’s appendix.
Appendix
| Layer | Low-variance input indices |
|---|---|
| Layer 0, ATTN input | 278* |
| Layer 0, MLP input | 64*, 146*, 509, 1280*, 1618*, 1938*, 2023* |
| Layer 1, ATTN input | 146, 735, 762, 841, 894, 1002, 1314, 1334, 1476, 1503, 1619, 2037 |
| Layer 1, MLP input | 64*, 146*, 509, 1228, 2023 |
| Layer 2, ATTN input | 1159, 1314, 2023* |
| Layer 2, MLP input | 146*, 2023* |
| Layer | Matrix | entropy (all matrix entries) | max(col-entropy) | avg(col-entropy) | zstd (bpp) | lzma (bpp) |
|---|---|---|---|---|---|---|
| 6 | attention.wk | 1.963 | 4.100 | 1.866 | 2.037 | 2.126 |
| attention.wo | 1.975 | 4.397 | 1.853 | 2.016 | 2.107 | |
| attention.wq | 1.994 | 4.330 | 1.923 | 2.061 | 2.147 | |
| attention.wv | 1.979 | 3.355 | 1.922 | 2.049 | 2.194 | |
| feed_forward.w1 | 1.993 | 3.869 | 1.938 | 2.045 | 2.163 | |
| feed_forward.w2 | 1.986 | 4.162 | 1.892 | 2.094 | 2.142 |
| Rate | WaterSIC W2 | WaterSIC C4 | WaterSIC-FT W2 | WaterSIC-FT C4 |
|---|---|---|---|---|
| 1.00 | 82.45 | 643.29 | 32.85 | 160.70 |
| 1.50 | 30.73 | 140.72 | 19.16 | 59.97 |
| 2.00 | 16.19 | 37.73 | 13.59 | 27.80 |
| 2.50 | 11.83 | 18.81 | 11.34 | 17.80 |
| 3.00 | 10.57 | 15.26 | 10.45 | 15.06 |
| 3.18 | 10.35 | 14.73 | 10.27 | 14.61 |
| Rate | WaterSIC W2 | WaterSIC C4 | WaterSIC-FT W2 | WaterSIC-FT C4 |
|---|---|---|---|---|
| 1.12 | 25.59 | 102.52 | 14.54 | 43.17 |
| 1.62 | 14.45 | 33.96 | 11.27 | 24.33 |
| 2.12 | 11.37 | 18.64 | 10.18 | 16.54 |
| 2.62 | 10.44 | 15.15 | 9.85 | 14.50 |
| 3.12 | 10.03 | 14.11 | 9.73 | 13.83 |
| 3.62 | 9.87 | 13.77 | 9.70 | 13.63 |
| Method | Avg. Bitwidth | WikiText-2 PPL |
|---|---|---|
| WaterSIC-FT | 1.00 | 18.97 |
| WaterSIC | 1.00 | 47.15 |
| WaterSIC-FT | 1.50 | 10.90 |
| WaterSIC | 1.50 | 15.89 |
| Huffman-GPTQ | 1.91 | 22.79 |
| WaterSIC-FT | 2.00 | 8.06 |
| Method | Bitwidth | W2 PPL | C4 PPL |
|---|---|---|---|
| BF16 | 16 | 5.54 | 7.10 |
| QuIP | 2.01 | 76.95 | 98.47 |
| DB-LLM | 2.01 | 12.77 | 14.82 |
| PV-Tuning | 2.01 | 6.99 | 8.29 |
| WaterSIC (no FT) | 2.00 | 8.01 | 13.48 |
| WaterSIC (FT W2) | 2.00 | 7.20 | 11.69 |
| Method | Avg. Bitwidth | WikiText-2 PPL |
|---|---|---|
| WaterSIC-FT | 1.00 | 12.03 |
| WaterSIC | 1.00 | 22.43 |
| WaterSIC-FT | 1.50 | 7.64 |
| WaterSIC | 1.50 | 8.97 |
| Huffman-GPTQ | 1.53 | 83.23 |
| Huffman-GPTQ | 1.95 | 55.84 |
| Calib. CTX=1024 | Calib. CTX=2048 | |||
|---|---|---|---|---|
| Finetuning set | W2 PPL | C4 PPL | W2 PPL | C4 PPL |
| None | 6.152 | 9.853 | 6.123 | 9.813 |
| WikiText-2 | 5.864 | 9.237 | 5.864 | 9.285 |
| C4 | 5.994 | 8.737 | 5.977 | 8.729 |
| RedPajama | 5.986 | 8.832 | 5.976 | 8.818 |
| Method | Bitwidth | W2 PPL | C4 PPL |
|---|---|---|---|
| BF16 | 16 | 5.12 | 6.63 |
| AQLM | 2.02 | 6.64 | 8.56 |
| QuIP# | 2.01 | 6.19 | 8.16 |
| DB-LLM | 2.01 | 7.23 | 9.62 |
| YAQA-B (INT2) | 2.00 | 7.45 | 9.22 |
| PV-Tuning | 2.02 | 5.84 | 7.62 |
| Method | 2 bits | 4 bits |
|---|---|---|
| RTN | 3.60 | |
| QuIP | 13.0 | 3.40 |
| GPTQ | 11.9 | 3.30 |
| AWQ | 3.30 | |
| PB-LLM | 11.6 | – |
| OstQuant | – | 3.19 |
| Calibration on WikiText-2 | Calibration on RedPajama | |||
|---|---|---|---|---|
| Finetuning set | W2 PPL | C4 PPL | W2 PPL | C4 PPL |
| None | 16.19 | 37.73 | 27.43 | 30.33 |
| WikiText-2 | 13.59 | 27.80 | 12.51 | 17.73 |
| RedPajama | 14.52 | 23.78 | 14.52 | 17.40 |
| C4 | 14.56 | 23.53 | 14.76 | 17.37 |
| W2 PPL | C4 PPL | |||||
|---|---|---|---|---|---|---|
| Rate | No FT | FT W2 | FT RP | No FT | FT W2 | FT RP |
| 1.00 | 82.45 | 32.85 | 41.55 | 643.29 | 160.70 | 88.26 |
| 1.50 | 30.73 | 19.16 | 21.80 | 140.72 | 59.97 | 41.84 |
| 2.00 | 16.19 | 13.59 | 14.52 | 37.73 | 27.80 | 23.78 |
| 2.50 | 11.83 | 11.34 | 11.62 | 18.81 | 17.80 | 17.16 |
| 3.00 | 10.57 | 10.45 | 10.54 | 15.26 | 15.06 | 14.91 |
| Rate | Method | ARC-C | ARC-E | HellaSwag | OBQA | PIQA | SocialIQA | Wino |
|---|---|---|---|---|---|---|---|---|
| 1.50 | Huffman-GPTQ | 0.2722 | 0.2597 | 0.2619 | 0.2960 | 0.5185 | 0.3306 | 0.5067 |
| WaterSIC | 0.2415 | 0.3620 | 0.3127 | 0.2720 | 0.5729 | 0.3501 | 0.5107 | |
| WaterSIC-FT | 0.2577 | 0.3653 | 0.3368 | 0.2680 | 0.5778 | 0.3547 | 0.5328 | |
| 2.00 | Huffman-GPTQ | 0.2218 | 0.2959 | 0.3030 | 0.2520 | 0.5332 | 0.3465 | 0.5075 |
| WaterSIC | 0.2679 | 0.4655 | 0.4052 | 0.2920 | 0.6066 | 0.3685 | 0.5328 | |
| WaterSIC-FT | 0.2910 | 0.5143 | 0.4410 | 0.3080 | 0.6333 | 0.3823 | 0.5399 |
| Rate | Method | Wino | MMLU | HSwag | PIQA | SciQ | TQA-MC1 | TQA-MC2 |
|---|---|---|---|---|---|---|---|---|
| 16.000 | BF16 | 68.11 | 73.02 | 74.90 | 77.80 | 95.70 | 36.35 | 54.50 |
| 4.125 | Huffman-GPTQ | 67.17 | 72.28 | 74.84 | 77.42 | 95.60 | 35.01 | 53.36 |
| GPTQ | 68.82 | 71.76 | 74.22 | 77.58 | 95.30 | 36.35 | 54.55 | |
| HRTN | 67.56 | 72.15 | 74.72 | 76.99 | 94.20 | 36.47 | 56.46 | |
| RTN | 67.17 | 69.71 | 74.30 | 75.90 | 94.50 | 36.84 | 55.77 | |
| WaterSIC | 70.09 | 72.77 | 74.60 | 76.99 | 95.90 | 35.99 | 53.80 |
Neural Network Quantization
Neural network quantization represents weights, activations, and states with fewer bits to reduce memory use, computation, and deployment costs.
See all 403 papers