Learning from Students: Applying t-Distributions to Explore Accurate and Efficient Formats for LLMs

Jordan Dotzel, Yuzong Chen, Bahaa Kotb, Sushma Prasad, Gang Wu, Sheng Li, Mohamed S. Abdelfattah, Zhiru Zhang · DOI

Introduction

Quantizing Large Language Models (LLMs) to 4 bits is the "holy grail" of efficient AI deployment, promising to slash memory requirements and power consumption. However, this compression often comes at the cost of model intelligence. While the industry has gravitated toward formats like Normal Float (NF4), new research suggests that the underlying assumption of normally distributed weights may be flawed.

In "Learning from Students: Applying t-Distributions to Explore Accurate and Efficient Formats for LLMs," researchers from Cornell and Google argue that LLM weights follow a Student’s t-distribution. By embracing this "heavier-tailed" reality, they have developed new formats that improve both accuracy and hardware efficiency.

The Heavy-Tail Reality

The researchers profiled 30 different neural networks, including LLMs (LLaMA2, Mistral, Phi-2), BERT-style transformers, and CNNs. Using the Kolmogorov-Smirnov (KS) test, they determined that a Student’s t-distribution with approximately five degrees of freedom ($\nu \approx 5$) provides a significantly better fit for actual weight and activation data than a standard normal distribution.

Weight distribution and QQ plot comparing Normal vs. Student’s t fits.

As shown in the weight distribution and QQ plots, LLM layers exhibit "heavy tails"—meaning they contain more extreme outlier values than a normal distribution predicts. Standard quantization formats like NF4, which assume normality, fail to capture these outliers effectively, leading to information loss.

Designing Theoretically Optimal Formats

Based on these findings, the authors derived Student Float (SF4). Similar to NF4, SF4 is a lookup-based format where the 16 possible values of a 4-bit number are chosen to perfectly balance the probability mass of a Student’s t-distribution.

Recognizing that full lookup tables can be hardware-intensive, the researchers also proposed "Supernormal" variants of the standard E2M1 format. Standard 4-bit floats often waste a state on a redundant "negative zero." By reassigning this single value to a "supernormal" point, the authors created Super-range (SR) and Super-precision (SP) variants.

Quantization levels for various 4-bit formats against the distribution curve.

These variants reclaim wasted bit-space to add an extra high-value or high-precision point, bringing the hardware-friendly E2M1 format closer to the theoretically ideal SF4 shape without the complexity of a full lookup table.

Results and Hardware Impact

The benefits of the Student-t approach were consistent across models and benchmarks:

  • SF4 vs. NF4: SF4 consistently outperformed NF4, improving average accuracy on LLaMA2-7B by 0.76% across various tasks.
  • The Phi-2 Breakthrough: Using E2M1 with supernormal support increased the accuracy of the Phi-2 model by up to 2.19% compared to standard 4-bit formats.
  • Hardware Efficiency: The "Super-precision" E2M1 variant (E2M1-SP) achieved these gains with only a 1.22% estimated chip area overhead at the system level, offering a superior Pareto frontier between area and accuracy.
  • Vision Model Gains: On ResNet18, SF4 improved accuracy by 5.08% over NF4 when applied to both weights and activations.

Conclusion

By moving beyond the assumption of normality, this research provides a more accurate mathematical foundation for LLM quantization. The introduction of SF4 and Supernormal E2M1 variants demonstrates that small changes in how we represent data can lead to significant gains in model performance on constrained hardware. Future work will explore these formats in the context of Quantization-Aware Training (QAT) and even lower bitwidths.

Summary updated

BibTeX
@inproceedings{dotzel2024learning,
  author = {Jordan Dotzel and Yuzong Chen and Bahaa Kotb and Sushma Prasad and Gang Wu and Sheng Li and Mohamed S. Abdelfattah and Zhiru Zhang},
  title = {{Learning from Students: Applying t-Distributions to Explore Accurate and Efficient Formats for LLMs}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=iJlPJsTw2B},
}
Figure