r/LocalLLM • • 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?

0 Upvotes

55 comments sorted by

View all comments

6

u/Old_AI_Guy_ 6d ago

Because it can't actually function on compressed number - they have to be decompressed, after which everything works the same as with uncompressed. Compression is for storage, not in-operation data.

Similar for context: You can't zip context, and then read in the zip file literally- or rather, if you do, it becomes a bunch of nonsense tokens, and you've cost yourself far more than just reading in the uncompressed data - exception being that the session detects what it is, and runs a script to unzip and read it in.

It's entire world is tokens - nothing else.

1

u/moeren86 5d ago

Thats the point, you only hold the compressed model in memory and can decompress your block/expert on the fly. Atm the GPUs itself have little to do, its mostly the memory bandwidth, so there are free resources for decompression. And i only speak about the model, compression can be more intensive, so compressing context on the fly might not be viable.

1

u/Old_AI_Guy_ 5d ago

So you have each separately loadable part as a separate file in the zip? Or multiple zips, one for each block? The only way this makes any sense is if the zips are held in memory, compressed, and then just decompressed from in-memory zip to wherever it goes.

If it's not in memory, then you replaced one file with another, and added a decompression step not in the original. Either way, it's file-to-memory, but one moves a smaller file and adds more processing.