NF4
What is NF4?
In one sentence: NF4, or 4-bit NormalFloat, is a 4-bit number format designed for neural network weights, used in QLoRA.
Most model weights follow a bell-curve shape, with many values near zero. NF4 places its 16 possible values to match that shape, so it wastes fewer values on rare numbers. This gives better accuracy than plain 4-bit integers.
What does NF4 look like?
QLoRA fine-tuning stores the base model in NF4 while training small add-on weights.
Why does NF4 matter?
NF4 helped make fine-tuning big models on one GPU possible.
Last updated · Fact-checked by The AI Math
Linking to this page from a lesson or article? <a href="https://getaimath.com/dictionary/nf4/">NF4, explained simply</a> (The AI Math Dictionary)