NF4 Isn't Information Theoretically Optimal (and that's Good)

Davis Yoshida
6/12/2023
16 citations
cs.LG

Official code: davisyoshida/abnormal-floats (20 stars, Python, last commit 2023-06-22).

Abstract

This note shares some simple calculations and experiments related to absmax-based blockwise quantization, as used in Dettmers et al., 2023. Their proposed NF4 data type is said to be information theoretically optimal for representing normally distributed weights.

Show full abstract

I show that this can't quite be the case, as the distribution of the values to be quantized depends on the block-size. I attempt to apply these insights to derive an improved code based on minimizing the expected L1 reconstruction error, rather than the quantile based method. This leads to improved performance for larger quantization block sizes, while both codes perform similarly at smaller block sizes.

View on arXivView PDF

Code Implementations(1)

Code for the note "NF4 Isn't Information Theoretically Optimal (and that's Good)

201PythonMay 25, 20233 years ago

Similar Papers

Cite this paper

@article{yoshida2023isnt,
  title  = {NF4 Isn't Information Theoretically Optimal (and that's Good)},
  author = {Davis Yoshida},
  year   = {2023},
  eprint = {2306.06965},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2306.06965v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2306.06965.svg)](https://codeofpaper.com/paper/2306.06965)

Discussion