News for hackers. Stuff that matters.
Re:Data Compression Explained by usernametaken29 on Saturday June 20, 2026 @02:06AM (#48606763)
Isn’t the idea of AI precisely to find universal compression from arbitrary input data, at least with LLMs?
Re:Data Compression Explained by briansm on Saturday June 20, 2026 @03:49AM (#48607233)
I think so, specifically lossy compression though.

A modern version of the book would include an extra section in the 'Lossy compression' chapter - 'Text' (alongside Images/Video/Audio) that would discuss LLM's.

Re:Data Compression Explained by eru on Saturday June 20, 2026 @04:39AM (#48607467)
No, it's not for lossy compression only.

An LLM can give you a probability distribution for the next token. You can pair that with arithmetic coding to get a lossless compression/decompression algorithm. See https://en.wikipedia.org/wiki/Arithmetic_coding

Re:Data Compression Explained by adrian_b on Saturday June 20, 2026 @05:36AM (#48607813)
In the way that you say, you can do lossless data compression, but then the LLM is used in a very distinct way than it is used in applications like chat or coding assistance.

In the latter applications, you do queries which aim to extract information from the training data set, but which may return hallucinated content instead of correct content.

If you use an LLM just to provide an estimation for the frequencies of tokens in an input data stream, and then you use the estimated frequencies to encode the input data, then you do not care about which were the tokens predicted by the LLM, because they are not used. The worst effect of any wrong predictions by the LLM is a slightly worse data compression ratio than the optimum.

When it is said that LLMs do a lossy data compression, that refers to the compression from the training data set to sequences of output tokens.

Re:Data Compression Explained by eru on Sunday June 21, 2026 @09:12AM (#48618682)
> If you use an LLM just to provide an estimation for the frequencies of tokens in an input data stream, [...]

Why would you use an LLM for that? The whole point is to encode contextual probabilities. So basically: given this prefix of text, what's are the probabilities for next tokens? You can use this conditional probability distribution to sample from to create plausible text, or you can use it for lossless compression. The math is very similar.

Re:Data Compression Explained by eru on Saturday June 20, 2026 @04:37AM (#48607457)
No, LLMs only do this for language. They don't try to do this for arbitrary data.
Re:Data Compression Explained by energy123 on Saturday June 20, 2026 @05:57AM (#48607920)
Transformers do this for any stream of tokens, those tokens can map to anything you want, and you will get lossy compression. Text produced by humans just happens to be dense, available, and a useful prior, but it is not intrinsically required. See 3D vision transformers for example.
Re:Data Compression Explained by jeremyjh on Saturday June 20, 2026 @08:41AM (#48608816)
It is not possible to compress arbitrary data. If the data is already compressed, or it is encrypted, or it is randomly generated, it cannot be compressed with any method. This is foundational information theory.

https://en.wikipedia.org/wiki/Lossless_compression#Limitatio...

Re:Data Compression Explained by thadt on Saturday June 20, 2026 @10:44AM (#48609587)
Whereas if we're talking about lossy compression (as is the person to whom you replied) we certainly can compress arbitrary data - almost as much as we want.

The hard question, then, is how much the decompressed output looks like the original.

Re:Data Compression Explained by eru on Sunday June 21, 2026 @09:13AM (#48618692)
Eh, you can't compress truly arbitrary data, sure. But you can compress almost any natural occurring data: reality is very sparse. For some reason.
Re:Data Compression Explained by woadwarrior01 on Saturday June 20, 2026 @04:47AM (#48607528)
There are many approaches around this, the simplest being to treat bytes as tokens (cf: Google's ByT5[1]). Also, BLT[2] from Meta and ByteFormer[3] from Apple.

[1]: https://arxiv.org/abs/2105.13626

[2]: https://arxiv.org/abs/2412.09871

[3]: https://arxiv.org/abs/2306.00238

Re:Data Compression Explained by adrian_b on Saturday June 20, 2026 @05:21AM (#48607722)
Which is why in this book the title of a paragraph is "Compression is an artificial intelligence problem".

However, I believe that is less useful to think that AI "finds an universal compression", than to think that the training of an AI model has the purpose to find a specific lossy data compression method, which is close to optimal for the input data that constitutes the training data set.

One could consider the training algorithm as a universal lossy data compression method, but this view is not useful in practice, because unlike a traditional lossy data compression algorithm, used e.g. for movie or picture compression, which you can use every day to compress many data sets, even in real time on an incoming data stream, the training of an AI model is a very long and expensive operation, which can be done only infrequently and which makes sense only for special important datasets, from which data will be frequently extracted by querying (i.e. AI inference) for a long time, to make worthwhile the compression, i.e. training, cost.

Moreover, for the best compression results the training of a new improved AI model does not consist only in determining the values of parameters (weights) of a fixed inference algorithm, but the structure of the inference algorithms is also tweaked for each new generation of models.

This is an additional reason that makes impractical to think about training as a universal compression algorithm (instead of a method for searching specific compression algorithms, which work for a given training set), because it is not a fixed algorithm, but a family of algorithms that evolves continuously, at least for now.

Re:Data Compression Explained by mtdewcmu on Saturday June 20, 2026 @11:51PM (#48615518)
I think that the common meaning of AI has changed since this was written. This book was written at least 14 years ago, long before anyone had heard of an LLM. Matt Mahoney incorporated neural networks in his compressors. Afaik they weren't pretrained. They were adaptive and made one pass over the plaintext, simultaneously learning and predicting. Decoding worked similarly.
Re:Data Compression Explained by hyperpape on Saturday June 20, 2026 @07:40AM (#48608496)
I think this is an analogy that's been taken far too far. The output of intelligence just isn't compression, that's memorization. The role of intelligence is to generate novelty.

It's true that LLMs do something that looks very compression like in their weights, but it is lossy, and it has to be--if you're not lossy, you've overfitted the corpus, and that's bad. Post-training takes this even further, because you're not doing anything that looks like training on a specific corpus, you're exploring in a wider space of text. That text doesn't even concretely exist until you start exploring it.

I'm sure there must be a serious attempt to pursue this analogy that isn't just handwaving, but I haven't seen it.

Re:Data Compression Explained by miki123211 on Saturday June 20, 2026 @07:54AM (#48608569)
LLM compression doesn't necessarily have to be lossy.

You can use the fact that LLMs predict P(next token | existing tokens) to losslessly and efficiently compress arbitrary token sequences. This idea is closely related to arithmetic coding.

Re:Data Compression Explained by hyperpape on Saturday June 20, 2026 @01:22PM (#48611045)
True, but it's not relevant because that isn't how we actually train LLMs for use as quasi-intelligent tools. We specifically do not want the model to be able to just memorize its input, which is what your process requires.

Many things about the process are similar, so there's some analogy, but it just isn't the same.

Re:Data Compression Explained by Timwi on Thursday June 25, 2026 @11:52AM (#48675259)
This is the one area where you actually want an LLM to be “nothing but a fancy auto-complete” like so many people say it is.
Re:Data Compression Explained by mtdewcmu on Saturday June 20, 2026 @05:23PM (#48613098)
When decompressing, you need to reproduce the output of the LLM exactly as it was during compression, otherwise the decompressor would output gibberish. Can you count on the LLM being that consistent?
Re:Data Compression Explained by fuglede_ on Saturday June 20, 2026 @08:49AM (#48608868)
3b1b just started a series under this slogan. Only one episode so far but chances are it'll be a good one; https://www.3blue1brown.com/
Re:Data Compression Explained by agumonkey on Saturday June 20, 2026 @09:54AM (#48609271)
semantic compression, that's how i see it