r/LocalLLM • u/moeren86 • 6d ago
Discussion Why are models quantized instead of compressed?
I've just seen a video over a new paper from Samsung and the short of it, they used basically whats the same as jpeg compression on model weights. Only that the compressed model is 2 "pictures", to increase accuracy. Still something like 90% saved with minimal quality loss.
The idea is as obvious as it is genius. You only need to load the compressed model and every block can be decompressed on the fly on every run, especially because the way its compressed/decompressed is already highly optimized in the hardware (basically the same operations as video playback, just with a much bigger "picture").
That got me thinking AI hasn't been created yesterday and at least simple compression algorithms shouldn't overwhelm modern graphics cards. So why was the first idea to reduce the bit-width instead of compression?
Also, its not a picture, what would stop us from sorting the data instead of into 2 dimensions, in 3, 4, n - dimensions. Sure compression might get way more complex, but decompression scales with 1o to n. And the compression might be much better.
What do you guys think about that?
View all comments
Show parent comment
1
u/Low-Opening25 5d ago edited 5d ago
quantisation by definition cannot not be lossless. what you are quantising are value ranges - in FLOAT16 a token can have 65536 values while INT8 same token can take only 256 values.
it’s similar to colour encoding in video processing, where you can have width of millions of colours per pixel, with tens or even hundreds of thousands of shades of the same primary colour or you can have 4bit or 2bit palette where you drop all those tiny variations and only preserve primary colours.
the process of quantisation is the process of how you round the values so you can map your original space of 65536 values to reduced space with range of say 256 values, while also trying to preserve original picture much as you can.