HACKER PAPER · 2024 · ICLR 2024
Language Modeling Is Compression
What question does this paper answer?
The paper connects autoregressive prediction with lossless coding: probabilities assigned to the next symbol can be converted into code lengths through arithmetic coding. The authors compare language models with classical compressors on preprocessed text, image, and audio samples, distinguishing rates for the encoded data alone from rates that also include model parameters. This helps examine training objectives and evaluation conventions; it does not establish that good compression makes a reliable assistant.
What it contributes
- 01
In the arithmetic-coding setting discussed in the paper, cross-entropy connects to expected code length, allowing the prediction objective to be examined through encoding length.
- 02
Offline compression with a fixed pretrained model requires specifying preprocessing, context length, and coding overhead. Data-only and model-adjusted rates answer different questions.
- 03
Model size and dataset size jointly affect adjusted rates; a larger model does not automatically produce a better total compression rate at every dataset size.
Check the original passages
Pages count from the first page of the PDF file. Page jumps depend on the source viewer; section names and short quotes provide another way to find the passage.
minimizing the log-loss is equivalent to minimizing the compression rateit adds the model size to the log-loss of the dataGuide source: ICLR 2024 proceedings ↗
Read this paper alongside other sources
These readings connect the paper with specific arguments from talks and other sources.
Hacker News comments 23
Verified mentions linking to this paper, newest first. This is not the complete comment tree of any one submission. Recommendations, references, and criticism are labeled separately; comments remain in their original language.
Language modeling is compression[1] and all the state to manage the cloud doesn't organically exist, it's added to the system.
We will see huge gains as all the developer middleware is compressed out as nonsense syntax outdated to the task at hand of linking phones and tablets to world models governments control.
Sam Altman was just saying they know best how to use your memory; what they decide is stored in memory is what we all experience.
It's not to store and copy around versions of C and Python and JS. They don't exist organically.
This shit will continue to get whittled down to just the geometric state transforms in memory and on screen just how government agencies decide. It's all electrical state in the machine at the end of the day. The math of machine latent space is what they're recursively self learning towards.[2]
[1] https://arxiv.org/abs/2309.10668
[2] https://arxiv.org/pdf/2605.27734
Language modeling is fundamentally compression: https://arxiv.org/abs/2309.10668
The entire endeavor is ultimately fundamentally coupled to reducing compute
Eventually we will compress models further by removing outdated knowledge like Python and Cobol cause who needs 1960s like languages to then layout data in the screen when the model has knowledge of geometry and can mutate the screen geometry without needing a Python interpreter or C compiler
Computer science has been a subset of math since the field was established decades before the first vacuum tube or transistor based machine was invented
"Computer" was coined to describe humans who did math all day
What we been doing the last few decades is fundamentally just algebra relative to values in RAM; LLMs only work because of math: https://arxiv.org/abs/2309.10668
def arbitraryFunctionName() { some math to achieve a physical state in memory } ...where arbitrary function name is some biz logic or use case
We're just pushing those arbitrary semantics from the code to the presentation layer; just need to ship a kernel that handles geometry transforms to draw to screen what looks like a text editor and a video game and label it via the GUI
Text systems are just outdated GUI that we had to start with due to hardware limitations back in the day.
Learning being a compression is also recently proposed as Gibbs compression proposition.
See Gibbs randomness-compression proposition https://arxiv.org/abs/2505.23869v5
Read 19 more comments
gzip can be used as a (not very good) LLM-like text and image generator: https://arxiv.org/abs/2309.10668
The relationship between probabilistic modeling and lossless compression is very direct. A model that predicts the next symbol with probability p can on average losslessly compress that symbol with the help of an entropy coder (e.g. arithmetic coding) in -log(p) bits. Therefore improved probabilistic models immediately translate into improved lossless compressors.
There are two ways people have used compressors for ML: the first is based on the Minimum Description Length (MDL) principle [0] which says that the best model is the one which provides the shortest description of the data, counting the size of the model itself. This is similar to the technique used in this blog post (argmin code length across class-conditioned compressors) except for counting the model size. Basically you can train a compressor per class and then choose the class compressor which best compresses the test data. It is a maximum likelihood argument because of Shannon's source coding theorem: a code length L corresponds to a probability 2^-L. The second way is the Normalized Compression Distance (NCD) [1], which uses code lengths to calculate information-theoretic distances which can then be plugged into distance-based algorithms like kNN. MDL interprets compressed lengths as likelihoods, while NCD interprets them for distance calculations. The theoretical foundation is Kolmogorov complexity which is the ideal (& uncomputable) lossless compressor, used to define information distance, an "ideal" distance metric based on algorithmic similarity.
Data compression is not in principle restricted to syntactic similarity. As others have mentioned, the new wave of neural compressors (e.g. NNCP [2], CMIX [3], leading the large text compression benchmark [4]) outperform their traditional counterparts (e.g. gzip) because of the ability of neural networks to learn complex semantic patterns. Their improved ability to predict the next token means improved lossless compression. This has also been shown to be the case with pre-trained LLMs [5].
I think it's neat that improving compression improves machine learning, and improving machine learning improves compression!
Looking forward to hearing other thoughts.
[0] https://arxiv.org/abs/math/0406077 [1] https://arxiv.org/abs/cs/0111054 [2] https://bellard.org/nncp/nncp_v2.pdf [3] https://www.byronknoll.com/cmix.html [4] https://www.mattmahoney.net/dc/text.html [5] https://arxiv.org/abs/2309.10668
Just a few years ago code gen LLMs were impossible to SWEs. In the 00s SWEs were certain no business would trust their data to the cloud.
OS and browsers are bloated messes, insecure to the core. Web apps are similarly just giant string mangling disasters.
SWEs have memorized endless amount of nonsense about their role to keep their jobs. You all have tons to say about software but little idea what's salient and just memorized nonsense parroted on the job all the time.
Most SWEs are engaged in labor role-play, there to earn nation state scrip for food/shelter.
I look forward to the end of the most inane era of human "engineering" ever.
Everything software can be whittled down to geometry generation and presentation, even text. End users can label outputs mechanical turk style and apply whatever syntax they want, while the machine itself handles arithemtic and Boolean logic against memory, and syncs output to the display.
All the linguist gibberish in the typical software stack will be compressed[1] away, all the SWE middlemen unemployed.
Rotary phone assembly workers have a support group for you all.
[1] https://arxiv.org/abs/2309.10668
An interesting thing about transformers is that they are world-class at compressing 2D image data even when not trained on anything but textual language ( https://arxiv.org/abs/2309.10668 ). Whether that notion is relevant for 3D content would be two or three figures over my pay grade, though.
"Higher level" implies acceptance of geometric structure. You place tokens like a Chomsky diagrams at each step up and down, where you should see parameters to transform geometry of the structure.
My team works "above" the contrived state management of software workers to more efficiently sync memory matrix to display matrix. LLMs are a form of compression [1]. My team is working on compressing them further into sets of points that make up each glyph and functions to recreate them.
Electromagnetic geometry transforms hardcoded[2] into hardware so reduce energy use of all the outdated string mangling of software dev as most know it.
What's higher level, relative to our machines, than design and implementation of the machine?
DnD dungeon master versus WOTC game designer.
Notice outside how there are no words and philosophy? Just color gradient and geometry?
Notice inside the human body no philosophy or words?
Language is not intelligence it's an emergent phenomena of geometry created by fundamental forces of physics organizing matter at various speeds relative to light.
You've read too much into an ultimately arbitrary statement meant to invoked a subtext, a subtle emotion context. You think of language as Legos, when it is music to feel.
[1] https://arxiv.org/abs/2309.10668 [2] https://iopscience.iop.org/article/10.1088/1742-6596/2987/1/...
Let’s say everyone agrees to refer to one hosted copy of a token “cat”, and instead generate a unique vector to represent their reference to “cat”.
Blam. Endless unique vectors which are nice and precise for parsing. No endless copies of arbitrary text like “cat”.
Now make that your globally distributed data base to bootstrap AI chips from. The data driven programming dream where other machines on the network feed new machines boot strap.
American tech industry is IBM now. Stuck on recent success of web SaaS and way behind the plans of AI.
So text wikipedia at 24G would easily hit 8G with many standard forms of compression, I'd think. If not better. And it would be 100% accurate, full text and data. Far more usable.
It's so easy for people to not realise how massive 8GB really is, in terms of text. Especially if you use ascii instead of UTF.
Maxwell could not get the theory of electromagnetism to work until he ditched pulleys and levers he’d included to describe the mechanics.
We won’t get AGI until we realize “there is no spoon” and language has nothing to do with our intelligence, just with out social tribalism: https://www.scientificamerican.com/article/you-dont-need-wor...
Take language out of the equation and drawing a circle, triangles, letters is just statistical physics. We can capture in energy models stored in an online state, statistical physics relative to the machine; its electromagnetic geometry: https://iopscience.iop.org/article/10.1088/1742-6596/2987/1/...
Our language doesn’t exist without humans. It’s not an immutable property of physics. It’s obfuscation and mind viruses. It’s story mode.
The computer acting as a web server or an LLM has an inherent energy model to it. New models of those patterns will be refined to a statefulness that strips away unnecessary language constructs in the system; like a lot of software most don’t use just developers.
I look forward to continuing my work in the hardware world to further compress and reduce the useless state of past systems of though we copy paste around to serve developers, to reduce context to sort through, and improve model quality: https://arxiv.org/abs/2309.10668
Single function factory hardware with embedded “prompt” that will boot from a model and the machines state will scaffold itself from there are coming: https://creativestrategies.com/jensen-were-with-you-but-were...
All the chip world talk of single function machines and how tech is now energy constrained industry, means pruning the state we store; most software is software to deliver software.
Single function pipeline hardware platforms will act as little more than sync engines from models.
I mean it’s is 2025. Still write software like it’s the 1970s. So high tech.
Edit: https://arxiv.org/abs/2309.10668
From LLMs to energy models that transform electromagnetic geometry. Saving what’s needed to recreate cat pics and emails to mom. Pruning the tail as interest dips with generational churn.
I look forward to a data driven system future where a few functions transform the machines electromagnetic geometry to solve a task based upon the most efficient energy model for solving a task as we continue to compress from the model all the non-essential syntax sugar of modern software.
https://arxiv.org/abs/2309.10668
https://arxiv.org/pdf/2309.10668
Transformers are also used in the top algorithm right now on the Large Text Compression Benchmark. https://bellard.org/nncp/nncp.pdf
This is one paper you could read - it's about text and not films, but same idea:
"LANGUAGE MODELING IS COMPRESSION" - https://arxiv.org/pdf/2309.10668
The main paper: https://gwern.net/doc/reinforcement-learning/exploration/act...
It sounds kinda crazy (is there really that much far transfer?), but you know, I think it would work... He just needed to use LLMs instead: https://arxiv.org/abs/2309.10668#deepmind
Are we sure there’s anything “net new” to find within the same old x86 machines, within the same old axiomatic systems of the past?
Math is a few operations applied to carving up stuff and we believe we can do that infinitely in theory. So “all math that abides our axiomatic underpinnings” is valid regardless if we “prove it” or not.
Physical space we can exist in, a middle ground of reality we evolved just so to exist in, seems to be finite; I can’t just up and move to Titan or Mars. So our computers are coupled to the same constraints of observation and understanding as us.
What about daily life will be upended reconfirming decades old experiment? How is this not living in sunk cost fallacy?
When all you have is a hammer…
I’m reminded of Einstein’s quote about insanity.
Take, for instance, the unprincipled definition of "parameter count" not only in the LLM scaling law literature, but the Zoo of what statisticians called "Information Criteria for Model Selection". https://en.wikipedia.org/wiki/Model_selection#Criteria
The reductio ad absurdum of "parameter count" is arithmetic coding where an entire dataset can be encoded as a single "parameter" of arbitrary precision.
By contrast, the algorithmic bit of information (whether part of an executable instruction or program literal) is an unambiguous quantity up to the choice of instruction set. If you want to quibble about that instruction set choice, take it up with John Tromp https://tromp.github.io/cl/cl.html because what I'm about to propose obviates that along with a lot of other "arguments".
Since any executable archive of any kind of data can serve as a model of the world generating that data, it follows that any executable archive of any text corpus can serve as a language model with a rigorous "parameter count". Therefore, a procedure which runs LLM benchmarks against any such executable archive as a language model, contributes a uniquely rigorous data point to the literature on LLM scaling laws.
So, what I'm proposing is that authors of lossless compression algorithms consider adding a command-line option that, at the end of decompression, saves the state of the decompression process in a file that can be read back in and executed as a language model -- with the full understanding that these language models will perform very poorly on the vast majority of LLM benchmarks. The point is not to produce high quality language models. The point is to increase rigor in the research community by providing some initial data points that exemplify the approach.
https://arxiv.org/pdf/2309.10668.pdf
You have to create a prompt/function that for a wide set of inputs, generates a token sequence that will perpetually expand in a manner that corresponds to an externally observed truth.
Way too often it feels like you have to shove a universal decoding sequence into a prompt.
“Talk your steps, list your clues, etc.”
Just trying to luck into a prompt that keeps decompressing the model/ generating the next token that ensures the next token is true.*
I recall there was a paper with a relevant title recently… https://arxiv.org/abs/2309.10668
Basically - LLMs don’t reason , they regurgitate. If they have the right training data, and the right prompt, they can decompress the training data into something that can be validated as true
——-
* Also this has to be done in a limited context window, there is no long term memory, and there is no real underlying model of thought.
https://arxiv.org/pdf/2309.10668.pdf
Direct submissions and discussions (2)
Language Modeling Is Compression · 3 points · 2023-09-30 ↗Language Modeling Is Compression · 5 points · 2023-09-20 ↗