Compression and Intelligence

On the relation between compression, intelligence, and LLMs.

Ryan GreenePublished

Part One: Compression

Pretraining

Pretrained large language models are famously next-token predictors. The procedure of pretraining consists of randomly initializing a (typically Transformer) model θ\theta, taking a sequence of data X=(x1,x2,,xT)X = (x_1, x_2, \dots, x_T), autoregressively predicting the probabilities of each symbol: pθ(xtx<t)p_\theta\left(x_t \mid x_{\lt t}\right), computing a loss \ell of how well the model predicted the true sequence XX, and backpropagating \ell to adjust the model’s weights to make XX more likely, with the hope that the absorbed regularities will help predict future sequences.

What does this have to do with compression? Well, we can convert the probabilities to surprisal: log2pθ(xtx<t)-\log_2 p_\theta\left(x_t \mid x_{\lt t}\right). The unit of surprisal is the bit: surprisal quantifies the minimum number of bits needed to losslessly encode xtx_t in such a way that it can be decoded by anyone with pθp_\theta. The total number of bits LL needed to encode XX is therefore:

Lθ(X)=t=1Tlog2pθ(xtx<t)L_\theta(X) = \sum_{t=1}^{T} -\log_2 p_\theta\left(x_t \mid x_{\lt t}\right)

The better θ\theta is at predicting XX, the smaller Lθ(X)L_\theta(X), the fewer bits it needs to encode it. Lθ(X)L_\theta(X) is the theoretical lower bound of bits needed to encode the data (conditioned on θ\theta), but in practice entropy coding algorithms like arithmetic coding get extremely close to it (within a couple of bits for long sequences of data).

All predictive models, such as pretrained language models, can be leveraged to losslessly compress sequences of data in this way, but the relation between pretraining and compression is even more direct. The loss function \ell used to pretrain language models is cross-entropy1, the average surprisal:

(θ)=1TLθ(X)\ell(\theta) = \frac{1}{T} L_\theta(X)

The pretraining of large language models explicitly optimizes their ability to encode sequences of data in as few bits as possible.

Offline Compression

To illustrate how effectively pretrained language models can be used for compression, following the general approach from Delétang et al. (2023) we will use the predictions of pretrained models from the Qwen3 series (Yang et al. 2025), along with the arithmetic coding implementation from constriction, to encode a variety of datasets, and compare their compression efficiencies with that of the traditional compression algorithms gzip and zstd.2

The datasets we’ll look at are the following. The first two were selected because they were published a year after the weights of the Qwen3 models were released, helping to ensure they are not already in the weights, while the last was selected due to its unique density of semantic meaning.

To compare the compressed file sizes across the models and traditional compression algorithms, we will express their efficiencies in terms of bits-per-byte (bpb), which is simply the length of the encoded bitstream Lθ(X)L_\theta(X) divided by the total number of bytes in the raw UTF-8 text (so uncompressed text sits at 8.0 bpb), as the metric expresses compression efficiency in a way that is agnostic to the compressor’s input encodings (tokens vs. bytes) and is normalized across the size of the datasets.

DatasetgzipzstdQwen3-0.6BQwen3-4BQwen3-14BInfini-News 20263.02502.47070.80240.65570.5994Magnifica humanitas2.74362.38060.71270.60660.5599Finnegans Wake3.68213.25052.11091.96291.8738\begin{array}{l r r r r r} \hline \text{Dataset} & \text{gzip} & \text{zstd} & \text{Qwen3-0.6B} & \text{Qwen3-4B} & \text{Qwen3-14B} \\ \hline \text{Infini-News 2026} & 3.0250 & 2.4707 & 0.8024 & 0.6557 & \mathbf{0.5994} \\ \text{Magnifica humanitas} & 2.7436 & 2.3806 & 0.7127 & 0.6066 & \mathbf{0.5599} \\ \text{Finnegans Wake} & 3.6821 & 3.2505 & 2.1109 & 1.9629 & \mathbf{1.8738} \\ \hline \end{array}

Even the smallest model compresses each dataset to a significantly smaller size than both gzip and zstd, and as the models grow in size — as they become stronger predictors — they compress the contents into fewer and fewer bits.

However, in order to decode the original sequences, we must have both the compressed bitstream and the program to decode it with. And we must account for the size of both in our compression efficiencies; otherwise, we could have a program that hard-codes the dataset in its code and regurgitates it verbatim. A code that charges for both the bitstream and the program that decodes it is called a two-part code.

gzip, zstd, and the sampling of large language models all have programs that can be implemented with a few hundred lines. However, when using a pretrained large language model, the program is the aggregate of both this code and the weights of the model. The smallest model in the Qwen3 series has 600 million parameters; when they are expressed in FP8, each parameter is a byte: its weights cost 600 MB.

The two-part codelength of the dataset encoded with the model, where bb is the precision of the weights and cc is the length of the code used to sample and encode it, is:

Loffline(X)=Lθ(X)data bitstream+bθ+cprogramL_{\text{offline}}(X) = \underbrace{L_\theta(X)}_{\text{data bitstream}} + \underbrace{b|\theta| + c}_{\text{program}}

Reproducing the table above, but with the Qwen3 model columns expressing the two-part codelength, we get:

DatasetgzipzstdQwen3-0.6BQwen3-4BQwen3-14BInfini-News 20263.02502.4707480132001112001Magnifica humanitas2.74362.380620080133864468522Finnegans Wake3.68213.250534532300780521\begin{array}{l r r r r r} \hline \text{Dataset} & \text{gzip} & \text{zstd} & \text{Qwen3-0.6B} & \text{Qwen3-4B} & \text{Qwen3-14B} \\ \hline \text{Infini-News 2026} & 3.0250 & \mathbf{2.4707} & 4801 & 32001 & 112001 \\ \text{Magnifica humanitas} & 2.7436 & \mathbf{2.3806} & 20080 & 133864 & 468522 \\ \text{Finnegans Wake} & 3.6821 & \mathbf{3.2505} & 3453 & 23007 & 80521 \\ \hline \end{array}

Ouch. Even the smallest model’s weights dwarf the largest dataset evaluated; the vast majority of the bits required to encode the data just encodes the weights themselves.

The program cost of the two-part codelength is a fixed cost independent of the dataset size; as the dataset we encode grows, the cost of the weights will become increasingly amortized. By naively treating Infini-News 2026 as an i.i.d. sample of a much larger corpus we can extrapolate the codelength to arbitrarily large datasets of their respective distributions and estimate how the bpb improves as the dataset size increases.

Qwen3 Offline Compression Extrapolation

With a sufficiently large dataset — around 2.88 GB for Qwen3-0.6B — the weights become amortized enough to beat zstd in bpb. But is there a way to dispense with the cost of the weights altogether, allowing us to effectively leverage language models as powerful lossless compressors for much smaller datasets, like these?

Online Compression

Consider the geometry of the pretraining loss curve. The x-axis denotes which training step the model is on, and the y-axis the cross-entropy of the data in that step — the mean number of bits needed to encode the data in that batch. The cost of a learner to encode its training dataset is then proportional to the area under the curve, the cumulative sum of the loss across all of the training steps (plus the small constant cost of the code of the learner itself), independent of the size of its weights.

Prequential Training Loss Curve

In order for a decoder to be able to retrieve the dataset at each step, the encoder and the decoder must start with the same initial weights. But since we’re learning from scratch, we don’t actually need to transmit the information of the parameters at all, we just need to instantiate them with the same random seed4. If we do this, and train the encoder and decoder with the same program deterministically (e.g. with deterministic CUDA kernels), we can transmit the each batch sequentially with the current weights and train the encoder and decoder on them in lockstep, always retaining identical weights on both.

This procedure is called prequential coding (Dawid, 1984; Rissanen, 1984; Blier & Ollivier, 2018). The length of the prequential code is the cumulative sum of all the losses at each step, plus the constant program cost cc:

Lonline(X)=t=1Tlog2pθt1(xtx<t)+cL_{\text{online}}(X) = \sum_{t=1}^{T} -\log_2 p_{\theta_{t-1}}(x_t \mid x_{<t}) + c

To reiterate, the algorithm for prequential coding is as follows:

  1. Initialize θ0\theta_0 with a fixed random seed on both the encoder and decoder
  2. Transmit xtx_t from the encoder to the decoder in log2pθt1(xtx<t)-\log_2 p_{\theta_{t-1}}\left(x_t \mid x_{\lt t}\right) bits
  3. Use the log2pθt1(xtx<t)-\log_2 p_{\theta_{t-1}}\left(x_t \mid x_{\lt t}\right) bits to decode the original xt{x_t} on the decoder
  4. Do a training step on xtx_t on both the encoder and decoder, producing θt\theta_{t}
  5. Repeat steps 2 through 4 for all TT

By initializing the weights tabula rasa with the same random seed, and training deterministically on the same data each step, the encoder and decoder share identical weights throughout the entire run without ever transmitting the weights: just the code to randomly initialize them and the data bitstream specified by the training loss curve.

In order to demonstrate this, we will start with an efficient Transformer pretraining codebase borrowed from qlabs-eng/slowrun. The model used has 220M parameters and a simple byte-level tokenizer, and will again be trained deterministically, using the constriction arithmetic coding implementation used to encode the dataset as a bitstream, one xtx_t at a time. The same hyperparameters are used for all of the datasets.

Doing this on the same three datasets used earlier, we get the following:

DatasetgzipzstdpreqInfini-News 20263.02502.47072.4221Magnifica humanitas2.74362.38062.2811Finnegans Wake3.68213.25052.6726\begin{array}{l r r r} \hline \text{Dataset} & \text{gzip} & \text{zstd} & \text{preq} \\ \hline \text{Infini-News 2026} & 3.0250 & 2.4707 & \mathbf{2.4221} \\ \text{Magnifica humanitas} & 2.7436 & 2.3806 & \mathbf{2.2811} \\ \text{Finnegans Wake} & 3.6821 & 3.2505 & \mathbf{2.6726} \\ \hline \end{array}

Despite the extremely small dataset sizes relative to typical pretraining runs, our model was still able to learn quickly enough to (narrowly) outperform gzip and zstd on all three datasets; most decisively Finnegans Wake, whose diverse and semantically dense vocabulary was significantly harder for the traditional algorithms to compress.

For a larger-scale comparison, we can look to the Large Text Compression Benchmark (Mahoney, 2006): a competition to compress 10810^8 and 10910^9 byte subsets of the English Wikipedia — the compute-unrestricted counterpart of the Hutter Prize (Hutter, 2006). The current leader on the benchmark is nncp (Bellard, 2024), which uses prequential coding with a specialized Transformer model to compress the datasets in an online fashion. With a better-tuned model and significantly more data to learn from, nncp compresses enwik9 into half as many bits-per-byte as zstd:

Datasetgzipzstdnncpenwik82.91562.03241.1932enwik92.58071.72540.8531\begin{array}{l r r r} \hline \text{Dataset} & \text{gzip} & \text{zstd} & \text{nncp} \\ \hline \text{enwik8} & 2.9156 & 2.0324 & \mathbf{1.1932} \\ \text{enwik9} & 2.5807 & 1.7254 & \mathbf{0.8531} \\ \hline \end{array}

Instead of the large fixed cost of the weights, the dominating expense in prequential coding comes from the high early cost in transmitting data before the model is able to predict it well. The more efficiently the program (e.g. the model’s architecture and optimizer) learns from each datum, the stronger its compressive capacities. The models used in these experiments are able to learn efficiently enough to outperform traditional compression algorithms on each dataset while making a complete accounting of the cost of both the data bitstream and the program.

Comparing Costs

To look more closely at the difference in terms that offline and online charge for compression, consider the final weights of a model θT\theta_T pretrained on XX. The cost of encoding XX with the final weights θT\theta_T is:

LθT(X)=t=1Tlog2pθT(xtx<t)L_{\theta_T}(X) = \sum_{t=1}^{T} -\log_2 p_{\theta_T}\left(x_t \mid x_{\lt t}\right)

This is a one-part code of the same form as the first table in the offline section, but we are now using the final weights of a model pretrained on XX instead of an externally pretrained model (e.g. Qwen3), so that both the offline and online settings can refer to the same object. Define the learner’s cumulative regret to its own final weights as the excess the online code paid over that bitstream:

R(X)=t=1Tlog2pθT(xtx<t)pθt1(xtx<t)R(X) = \sum_{t=1}^{T} \log_2 \frac{p_{\theta_T}\left(x_t \mid x_{\lt t}\right)}{p_{\theta_{t-1}}\left(x_t \mid x_{\lt t}\right)}

Geometrically, R(X)R(X) is the area between the learner’s loss curve and its final loss: the bulge of early prediction errors above the floor the model eventually reaches. The two codelengths then decompose as:

Loffline(X)=LθT(X)+bθ+cLonline(X)=LθT(X)+R(X)+c\begin{aligned} L_{\text{offline}}(X) &= L_{\theta_T}(X) + b|\theta| + c \\ L_{\text{online}}(X) &= L_{\theta_T}(X) + R(X) + c \end{aligned}

With the shared terms cancelling, the comparison reduces to a single asymmetry: offline pays bθb|\theta|, the cost to store the weights; online pays R(X)R(X), the cost to learn them. Prequential coding is favorable whenever R(X)<bθR(X) \lt b|\theta| — when the structure of XX is cheaper to acquire through experience than to transmit the model itself.

Comparing Costs

Part Two: Intelligence

We have seen that all prediction is implicitly compression, that the pretraining objective explicitly minimizes the description length of XX, that in the offline setting more powerful pretrained models are able to compress datasets into fewer bits (when either ignoring the cost of their weights or amortizing them with a large enough dataset), and that in the online setting a more efficient learner is able to compress its training dataset into fewer bits.

But what exactly is this property that makes data compressible, and what does it have to do with intelligence?

Generalization

When considering just the data bitstream term, the description length of XX is inversely proportional to how well the model θ\theta predicts it: the more probability θ\theta places on the true xtx_t, the fewer the bits needed to encode it.

Consider the maximally naive model uu, which assigns uniform probability to every possible symbol regardless of context: u(xtx<t)=1/Xu\left(x_t \mid x_{\lt t}\right) = 1/|\mathcal{X}|, where X\mathcal{X} is the vocabulary that XX is built from. Its codelength is fixed at Lu(X)=Tlog2XL_u(X) = T \log_2 |\mathcal{X}| for every XX. For byte-level data, such as a plaintext UTF-8 dataset, Lu(X)L_u(X) is the raw size of the uncompressed dataset. So long as log2pθ(xtx<t)-\log_2 p_\theta\left(x_t \mid x_{\lt t}\right) is on average smaller than log2u(xtx<t)-\log_2 u\left(x_t \mid x_{\lt t}\right), the model θ\theta encodes the data bitstream in fewer bits than the raw data itself, thereby compressing it: Lθ(X)<Lu(X)L_\theta(X) \lt L_u(X).

For the complete description length of XX — the cost of the data bitstream plus the cost of the program that produced it, as in Loffline(X)L_\text{offline}(X) and Lonline(X)L_\text{online}(X) — to be smaller than Lu(X)L_u(X), the data bitstream’s savings over the uniform encoding must be greater than the cost of the program.

A program with XX hard-coded verbatim can predict it perfectly, making Lθ(X)=0L_\theta(X) = 0. But hardcoding a symbol costs at least as many program-bits as it saves in data-bits, so it can never shorten the complete description length; the only bits that turn a profit are those reused across many predictions, where one bit of program pays for itself multiple times in data savings. The extent to which the complete description length is shorter than Lu(X)L_u(X) is therefore the strength of evidence that the program captured reusable predictive structure of XX.

In offline compression, the pretrained model learned its predictive structure from a training dataset DD and reused it to predict the test data XX; in online compression, XX serves as both training and test data, with structure learned from x<tx_{\lt t} reused to predict xtx_t. In both, every profitable bit has the same shape: extracted from prior experience, spent on new data.

This is our operational definition of generalization: the capacity to reuse learnings from prior experience to accurately model novel data.

“Reuse” means the cost of the program is amortized across its predictions, “accurately model” means the cost of the data is small, and the shift from “prior experience” to “novel data” means the accounting is done on data that played no part in building the model. A model generalizes to XX along two axes: how far its complete description length falls below Lu(X)L_u(X), and how far XX lies from its prior experience.

The Ideal Limits

The cost of describing XX with none of its regularities captured was seen to be Lu(X)L_u(X). The theoretical floor of the description length is the Kolmogorov complexity K(X)K(X): the length of the shortest program that outputs XX. K(X)K(X) exploits all of the possible reusable structure within XX, and is bounded by the irreducible noise within the data. It is the ideal limit in an offline setting where all of XX is observable up front, but it is unfortunately incomputable, as determining it would require exhaustively evaluating all possible programs, some of which will never halt.

In the online setting, when XX instead arrives as a stream, the ideal is Solomonoff induction. Its universal mixture considers every possible program (on a fixed universal monotone machine UU) whose output begins with xtx_{\leq t}, weighted by an exponential penalty on its length, so that each additional bit of description halves its prior:

M(xt)  =  p:U(p)=xt2pM(x_{\leq t}) \;=\; \sum_{p \,:\, U(p) = x_{\leq t}*} 2^{-|p|}

We can condition the mixture on the prefix to create a predictor, M(xtx<t)M(x_t \mid x_{\lt t}), and therefore also a prequential code:

LM(X)=t=1Tlog2M(xtx<t)L_M(X) = \sum_{t=1}^{T} -\log_2 M(x_t \mid x_{\lt t})

It is worth once again emphasizing that each program’s weight is determined solely by its length: its predictions are exponentially concentrated on the continuations favored by the shortest programs. Solomonoff’s theorem proves the mixture is universal: for every computable predictor qq and every XX, LM(X)Lq(X)+K(q)+O(1)L_M(X) \leq L_q(X) + K(q) + O(1), where the right-hand terms specify the cost of qq‘s two-part code, plus a constant overhead from the choice of universal machine.

The programs that best compress the past dominate the optimal induction’s predictions of the future: a vindication of the relation between compression and generalization. Solomonoff’s theorem lends support to the information-theoretic restatement of Occam’s razor, the Minimum Description Length principle, which states that the shortest complete description of the data is the best model: a pragmatic razor based on the theoretical ideal.

Intelligence

The operational definition of intelligence we will be considering is the capacity to generalize. We will be looking at this capacity in LLMs from two views of the model’s ability to compress novel data, mirroring the two means of compression from Part One.

The offline intelligence view evaluates the final weights of a trained model to measure how well it predicts held-out data. The intelligence of frontier models is evaluated and compared on a variety of real-world benchmarks, such as SWE-bench, FrontierMath, and GDPval, while community training competitions like modded-nanogpt and the slowrun target the final loss of held-out pretraining data — the same quantity measured in Part One. The implicit assumption underlying the faith in these evaluations is that the results are the fruit of generalization: that improved performance isn’t the result of narrow benchmark-maxing, but captures the model’s capacity to broadly generalize to novel data.

The online intelligence view evaluates the rate at which a model learns from experience, commonly referred to as data or sample efficiency. Inside the learning process, data efficiency is the manifestation of generalization: the model is able to better predict xtx_t if it learned more reusable structure from the data in x<tx_{\lt t} — its capacity to do so approaches the limit of Solomonoff induction.

CompressionIntelligenceIdealOfflinetwo-part codefinal weight evaluationKolmogorov complexityOnlineprequential codelearning data efficiencySolomonoff induction\begin{array}{l l l l} \hline & \textbf{Compression} & \textbf{Intelligence} & \textbf{Ideal} \\ \hline \textbf{Offline} & \text{two-part code} & \text{final weight evaluation} & \text{Kolmogorov complexity} \\ \textbf{Online} & \text{prequential code} & \text{learning data efficiency} & \text{Solomonoff induction} \\ \hline \end{array}

We will next take a closer look at offline and online intelligence and at their relation with compression.

Offline Intelligence

The offline view of the intelligence of a model looks at how well its frozen final weights predict held-out data. The broader and more diverse the data, the greater the model’s capacity for generalization must be to make accurate predictions. This makes held-out pretraining-like datasets — evaluated by their cross-entropy loss, as done in Part One — among the most robust measures of offline intelligence, as their corpora span an enormous breadth and diversity.

Indeed, the success of the GPT pretraining paradigm was twofold: it demonstrated scaling laws where just by using bigger models and more data you can pretrain better and better compressors, and that those compressive capacities are highly predictive of held-out benchmarks testing what humans deem as intelligent behavior.

This was elegantly displayed in Compression Represents Intelligence Linearly by Huang et al. (2024). They took thirty-one open-weight pretrained models trained by a variety of labs, and evaluated each model’s compressive capacities on pretraining-like datasets sourced after the models’ knowledge cutoff along with their performance on knowledge and reasoning benchmarks. Plotting the relationship, they found a nearly linear correlation between the two:

Compression Represents Intelligence Linearly
Note that the sizes of the models’ weights were excluded from the compression ratios, with the authors making the extrapolation argument that with enough data they would be amortized.

However, evaluating a model from its frozen final weights alone — whether by held-out loss or benchmark scores — leaves us unable to account for the training process that produced them. The degree to which a model’s performance demonstrates generalization depends on how far the evaluated data lies from the model’s training distribution, and when evaluating a black-box pretrained model given just its weights, we cannot know what that distance is.

There are strong incentives for even the most well-intentioned labs to include data that, if not the test itself, is the closest data to it that they can justify including. The more the data selection process is skewed towards particular tests, the less representative the final model’s performance on them will be of generalization.

As an illustrative example, in this paper the authors found the Qwen series punched significantly above its compressive weight on the mathematical reasoning benchmarks, “which implies that the Qwen model series may be exposed to the GSM8K training data, MATH training data, and even the MATH test data in the pretraining stage.”5

Compression Represents Intelligence Linearly Outliers
Having by far the best performance on the GSM8K train set, along with run-of-the-mill performance on the test set, is a particularly damning exemplar of an inability to generalize.

The Huang et al. results thus do double duty: the linear fit supports compression as a measure of the kind of intelligence that the benchmarks target, while the outliers warn against reading too much into benchmark scores themselves — benchmark performance can be easily bought with proximate training data. In their experiments, loss on broad pretraining corpora proved harder to game, but in measurements of offline intelligence we can never in principle be sure how skewed training was to those corpora either.

The deepest problem with offline measures of intelligence is that evaluations of the final artifact of training cannot account for the process that produced it, and therefore cannot account for the degree to which its performance is the result of generalization. To evaluate the process of learning itself, we now turn to online intelligence.

Online Intelligence

The online view of intelligence asks how efficiently the learner turns experience into generalization. In this view, no measure of the final artifact of training alone can be a measure of intelligence, because intelligence is fundamentally a property of the learner.

This is the same distinction made in Chollet (2019) between skill and skill-acquisition, in which “skill” refers to a system’s performance on task-specific tests (e.g. real-world benchmarks or loss on pretraining corpora), while “skill-acquisition” refers to a system’s ability to learn new tasks. Chollet argues that

solely measuring skill at any given task falls short of measuring intelligence, because skill is heavily modulated by prior knowledge and experience: unlimited priors or unlimited training data allow experimenters to “buy” arbitrary levels of skills for a system, in a way that masks the system’s own generalization power.

To tie this back to compression, an offline measure of intelligence can charge a cost for the program bθ+cb|\theta| + c (though it rarely does — as in Huang et al.’s exclusion of the cost of the weights), but the program cost makes the contributions of prior knowledge and experience invisible. When making offline comparisons of models of the same architecture, one that was warm-started from a previous run, one that was trained on one billion tokens, and one that was trained on a trillion tokens will have identical program costs despite vastly differing amounts of prior knowledge and experience.

If you recall from Part One, prequential coding dispenses with the cost of the weights, charging instead the cost of experience to train the model tabula rasa:

Lonline(X)=t=1Tlog2pθt1(xtx<t)+cL_{\text{online}}(X) = \sum_{t=1}^{T} -\log_2 p_{\theta_{t-1}}(x_t \mid x_{<t}) + c

The formulation of prequential coding enables us to charge and quantify the prior6 and experience of a learner in a unified measure, the prequential codelength. Where Part One looked at Lonline(X)L_{\text{online}}(X) purely from the perspective of compression, we will now view it as a measure of data efficiency — a measure of online intelligence.

Define a learner’s data efficiency on XX as the average number of bits of predictive value it extracts per datum of experience. Since the prequential codelength is the learner’s total prediction cost over XX, a shorter codelength on the same XX is greater data efficiency: the learner paid fewer bits for the same experience. And to pay fewer bits for xtx_t is to have better generalized from x<tx_{\lt t} — to have converted prior experience into more structure reusable for predicting novel data. The prequential codelength thus unifies generalization, data efficiency, and the learner’s complete description length of XX into a single quantity.

When comparing learners by Lonline(X)L_{\text{online}}(X), one confounder remains uncharged: the data-dependent difficulty in generalizing to xtx_t from x<tx_{\lt t}. Different experiences XX have different inherent amounts of reusable structure and difficulties of learning that structure. There are no known practical methods to quantify this dataset-dependent difficulty, so we can’t charge for it, and must instead control for it by comparing learners trained on the same distribution of data, in the same order.

Consider a comparison of two learners trained on the same XX, where Learner A is more efficient across the board, dominating Learner B at every point on the loss curve. If we were to compare Learner A halfway through its training to Learner B trained on the entire dataset, they would be indistinguishable in terms of offline intelligence as measured by pretraining loss.

Offline Intelligence vs. Online Intelligence: Dominate

In contrast, when evaluated in terms of online intelligence — their prequential codelength, as depicted by the shaded area under the curve — Learner A is significantly more intelligent than Learner B, which had a higher cost per datum at every point in the curve, and therefore also needed more data to reach the same loss.

However, neither of the scalars — offline loss nor prequential codelength — is scale-invariant. Both evaluations occur at a specific amount of experience TT, and the verdict can flip as TT grows.

Offline Intelligence vs. Online Intelligence: Scale invariant

At T/3T/3, Learner B has both a lower loss and a shorter prequential code than Learner A; at 2T/32T/3, Learner B has a higher loss but still the shorter code; by TT, Learner A has overtaken Learner B on both metrics.

To get a scale-invariant comparison of learners, we must turn from particular training loss curves to their underlying geometry: the rules that govern their loss at arbitrary levels of experience.

Intelligence at Scale

Empirically, the training loss curves of pretraining can be closely modeled by power laws. By fitting a few coefficients that capture different properties of the learner we can predict its loss at an arbitrary tt:

(t)H+Btβ\ell(t) \approx H + B\,t^{-\beta}

The coefficients form the geometry of the loss curve. HH is the floor the learner converges toward: bounded below by the intrinsic entropy of the data, and above by the representational capacity of the model. The excess loss above the floor, BtβB\,t^{-\beta}, is a power law — on log-log axes a straight line, with slope β-\beta and BB its level. β\beta tilts the curve; BB shifts it wholesale, a constant multiplicative factor at every tt, and all three play a role in determining the learner’s data efficiency.

Prequential codelength inherits this geometry analytically. Summing the loss over the entirety of TT, with the addition of the cost of the program cc, and evaluating the sum — for β<1\beta < 1, the regime empirical exponents occupy — the codelength splits into three terms of strictly decreasing order of growth:

Lonline(X)    t=1T(t)+c    HTlinear+B1βT1βsublinear+cT1constantL_{\text{online}}(X) \;\approx\; \sum_{t=1}^{T}\ell(t) + c \;\approx\; \underbrace{HT}_{\text{linear}} + \underbrace{\tfrac{B}{1-\beta}\,T^{1-\beta}}_{\text{sublinear}} + \underbrace{c\vphantom{T^{1}}}_{\text{constant}}

In the loss curve, BtβB\,t^{-\beta} decays to zero: every learner converges to its floor. Each coefficient thus governs a term of a different order in the prequential codelength: HH the linear term of the floor, 1β1 - \beta which determines the exponent of the sublinear term (which is the learner’s regret to HH7), BB its prefactor, and cc the constant cost of the program. The ordering of the coefficients follows from the ordering of their terms: as TT grows, any difference in a higher-order term eventually swamps any difference in a lower-order one.

Therefore, in the limit — as TT \to \infty — the only term that matters is HH. But in practice, TT is bounded: the pretraining datasets used by frontier labs are approaching all available high-quality data on the Internet (Villalobos et al., 2024).

Patel (2026) estimates that humans acquire language and learn to drive from three to six orders of magnitude less experience than models: an existence proof of how much room in data efficiency remains. Where before we could compensate for learning less from each token by training on many more tokens, today the limit is set by the data efficiency of the learner.

The identity between prediction and compression begins with Shannon (1948). Arithmetic coding (Pasco, 1976; Rissanen, 1976; Witten, Neal & Cleary, 1987) converts any predictor’s probabilities into a bitstream at negligible overhead.

The ideal limits belong to algorithmic information theory. Solomonoff (1964) defined the universal mixture and later proved its convergence (Solomonoff, 1978); Kolmogorov (1965) and Chaitin (1966) independently formalized descriptive complexity.

The insistence that a complete description must charge for the program predates its name: Wallace & Boulton (1968) proposed two-part codes as Minimum Message Length a decade before Rissanen (1978) founded Minimum Description Length. Hinton & van Camp (1993) brought the charge for the weights to neural networks. The online alternative, prequential coding, was developed by Dawid (1984) and Rissanen (1984); Blier & Ollivier (2018) showed that prequential codes of deep networks are dramatically shorter than their two-part counterparts, and Jiang & Zhou (2025) give an excellent intuitive treatment applied to data curricula. Concurrent work from Qiu (2026) proposes requential coding as a means to produce shorter descriptions than prequential coding, at the cost of being even more computationally expensive.

In practice, Delétang et al. (2023) demonstrated pretrained LLMs as offline compressors, while Mahoney’s Large Text Compression Benchmark (2006) and its current leader nncp (Bellard, 2024) represent the state of the art of prequential coding on the enwik8 and enwik9 datasets.

Chaitin has long held that comprehension is compression (Chaitin, 2002). Hutter (2005) extended Solomonoff induction to optimal agency with AIXI, and Legg & Hutter (2007) built a formal definition of universal intelligence atop it. Text compression was proposed as a test by Mahoney (1999), and formalized by the Hutter Prize (Hutter, 2006). This thesis is strong within certain groups at frontier labs: publicly, Rae (2023) argued for compression as the path to AGI, Sutskever (2023) framed SGD as a compressor to explain unsupervised learning, and Selsam (2025) described pretraining as approximate Solomonoff induction. Huang et al. (2024) measured the relation between compression and benchmark performance and found it linear. Chollet (2019)‘s decoupling of intelligence into separate skill and skill-acquisition camps was motivation for the essay’s mapping between offline and online intelligence.

The power laws used to model training loss curves come from the scaling law literature (Hestness et al., 2017; Kaplan et al., 2020; Hoffmann et al., 2022), and Villalobos et al. (2024) documents the approaching data wall. The slowrun (qlabs et al., 2025) is an exemplar public competition in data efficient training algorithms.

Finally, to avoid being Schmidhuber’d, yes, he has long argued for a relation between compression and intelligence, and Schmidhuber (2009) in particular sits among my favorite papers.

Conclusion

Every predictor is a compressor, and an honest accounting of compression must include the cost of the program. The only way for the complete description length of data to be shorter than the raw data itself is through capturing reusable structure whose cost in program bits is less than the bits it saves in accurately modeling the data, and to do this on data never previously seen is to generalize.

Intelligence is the capacity to generalize. We examined it from two views: offline, evaluating the compressive capacities of pretrained models on held-out datasets, where it has a nearly linear relation with benchmarks of intelligent behavior, and online, evaluating the learner itself, where generalization was identified with data efficiency. In both, intelligence was measured in bits.

As frontier pretraining runs approach the wall of all high-quality data on the internet, increased intelligence must come from closing the data efficiency gap between models and humans. The more efficient the learner, the shorter its complete description length of the dataset, and the closer it approximates the ideal of Solomonoff induction.

Acknowledgements

Thank you to Niloofar Mireshghallah, Samip Dahal, Liam Corrigan, and Fable 5 for early comments on the draft, and Lambda for sponsoring the compute used for the experiments of Part One.

Citation

@article{greene2026intelligence,
  title = {Compression and Intelligence},
  author = {Greene, Ryan},
  journal = {greene.sh},
  year = {2026},
  month = {July},
  url = "https://www.greene.sh/compression-and-intelligence/"
}

References

Footnotes

Footnotes

  1. The base of the logarithm used in pretraining is ee — not 22 — due to its uniquely elegant differentiation, making the unit the nat, not the bit. But this makes no substantive difference: the conversion of nats to bits just requires dividing the surprisal by ln(2)\ln(2). For simplicity, the remainder of this essay will implicitly assume this conversion.

  2. In the following experiments, gzip was evaluated at a compression level of 9 and zstd at a level of 19.

  3. Note that unlike the other two datasets, the Wake was published in 1939, making it likely to have been included in Qwen3’s pretraining dataset (so long as it wasn’t filtered out for looking like random noise). It is nevertheless by far the hardest of the three datasets for the models to predict.

  4. For example, np.random.default_rng(seed=42).random(1_000_000_000) will generate the exact same billion “parameters” on both the encoder and decoder, without having to specify and transmit the exact parameters themselves between them.

  5. Of course, there is nothing inherently wrong with including the training sets in the pretraining stage (although they are typically reserved for post-training). The confounder comes from comparing the models that were against those that were not. But the MATH test set, on the other hand…

  6. Here the compression view and Chollet part ways on what the prior costs. Chollet holds that the cost of the prior should incorporate the cost of the search process that produced it: a quantification of decades of AI research that is impossible to put a number to. The compression view’s answer is that the codelength of the learner is both a necessary and sufficient charge: all that matters is that we consider the complete description length. Every bit of structure baked into the learner is in cc, and each such bit only turns a profit if reused across enough predictions to earn back its cost. A small cc can only encode a small prior; a large smuggled prior demands a large cc, and is charged appropriately.

  7. This sublinear term is the scaling-law form of Part One’s cumulative regret, taken to the floor HH rather than the final weights θT\theta_T.