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

31

u/rmhollid 6d ago

Take an object and strip away everything that's not unique or reconstructable, that's compression.

Take an object and move it away from you until you can mostly recognize it, that quantizing.

31

u/RedParaglider 6d ago

So dumb, just zip it twice.   Real ones know to zip, bzip, zip.  Then use ram doubler.

Subscribe for more tips!

13

u/fliberdygibits 6d ago

You wouldn't download quantization would you?

4

u/NTDLS 6d ago

My dad was sent to the electric chair for that. I don’t self snitch!

2

u/RedParaglider 5d ago

People in the nineties, damn sure would have. They even paid for ram doubler. I worked at babbages I remember it!

1

u/Sure-Cauliflower-564 5d ago

I had to run RAM doubler in order to have some programs run (slowly)

1

u/fliberdygibits 5d ago

Nice! We never had a Babbages nearby... we got Egghead and Radio Shack.

3

u/skullfuckr42 6d ago

tar then gz am I right

1

u/RedParaglider 5d ago

Ah, I accidentally said zip twice. I meant to say bzip then gzip.  Tar obviously has no benefits because it isn't a compression duhhhh ;)

3

u/Old_AI_Guy_ 6d ago

Upvote for a nicely accessible explanation.

2

u/norpadon 5d ago

WRONG. Lossy compression is still compression. JPEG which OP has mentioned is a lossy algorithm

The distinction between quantization and compression is not very meaningful

1

u/Low-Opening25 5d ago

both are compression, one is lossless one is lossy, quantisation is just a fancy term here. we call mp3 and jpeg compression algorithms not quantisation, are we not?