Post
288
sunday = lab day
goal: understand how GGUF compression works - what exactly is being lost?
approach: quantize/dequantize some images and look at error maps
spent 80% of the time tracing down what turns out to be a data distribution assumption: real LLM weights are symmetric and their mean is 0 so our test image MUST retain these properties or the results turn into a kind of nonsense soup where Q5_1 beats Q8
with that issue solved, we have some fun results! from left to right:
- test pattern image (mean value is around 0.01)
- q8 error (almost nothing - some light banding in the gradients)
- q5km error (starting to see the 'blocks' around the circles)
- q4_0 error (this is why q4_1 is 'preferred')
- q3k error. q3k is a really interesting set of trade-offs: it does not have a block-offset so it really leans into the 0-mean assumption HARD, if you violate it locally the results are BAD
- q2k error: q2k has a block-offset so for certain patterns the errors are actually less then q3k (a rather counter-intuitive result)
looking at mxfp4, i-quants and the other stuff that's possible inside gguf remains future work.. aiming to clean up this repo and push it this week, feel free to ping me if you want to play sooner.
goal: understand how GGUF compression works - what exactly is being lost?
approach: quantize/dequantize some images and look at error maps
spent 80% of the time tracing down what turns out to be a data distribution assumption: real LLM weights are symmetric and their mean is 0 so our test image MUST retain these properties or the results turn into a kind of nonsense soup where Q5_1 beats Q8
with that issue solved, we have some fun results! from left to right:
- test pattern image (mean value is around 0.01)
- q8 error (almost nothing - some light banding in the gradients)
- q5km error (starting to see the 'blocks' around the circles)
- q4_0 error (this is why q4_1 is 'preferred')
- q3k error. q3k is a really interesting set of trade-offs: it does not have a block-offset so it really leans into the 0-mean assumption HARD, if you violate it locally the results are BAD
- q2k error: q2k has a block-offset so for certain patterns the errors are actually less then q3k (a rather counter-intuitive result)
looking at mxfp4, i-quants and the other stuff that's possible inside gguf remains future work.. aiming to clean up this repo and push it this week, feel free to ping me if you want to play sooner.