Skip to content

why do we force the 8th number to be zero in NF4 data type? #1441

Closed Answered by matthewdouglas
lidh15 asked this question in Q&A
Discussion options

You must be logged in to vote

This is briefly discussed in the QLoRA paper. The main reason is that the value 0 is actually quite important, and as such an inexact representation would likely result in a less desirable result.

A problem for a symmetric k-bit quantization is that this approach does not have an exact representation of zero, which is an important property to quantize padding and other zero-valued elements with no error. To ensure a discrete zeropoint of 0 and to use all $2^k$ bits for a k-bit datatype, we create an asymmetric data type by estimating the quantiles $q_i$ of two ranges $q_i$: $2^{k−1}$ for the negative part and $2^{k−1} + 1$ for the positive part and then we unify these sets of $q_i$ and r…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lidh15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants