Information / Foundations
verifiedEntropy
How surprised should you expect to be? Entropy measures that in bits: a fair coin costs one bit per flip, a coin that always lands heads costs nothing, and a language model's entropy is how many bits it needs on average to say what comes next. Every compression bound and every training loss in this graph is a statement about it.
Entropy is the floor on lossless compression: no code can average fewer bits per symbol than the source's entropy, and arithmetic coding gets arbitrarily close. That is why a language model is a compressor — its cross-entropy on held-out text is a measured code length, in bits per token, and improving the model is literally shrinking the file.
H(X) = −Σ sub x p(x)·log sub 2 p(x), in bits. It is maximal for the uniform distribution over n outcomes, at log sub 2 n, and zero when one outcome is certain. Cross-entropy H(p,q) = −Σ sub x p(x)·log sub 2 q(x) is what you actually pay for coding p's symbols with q's code, and it is never less than H(p) — the excess is exactly the KL divergence.
16 values. The left group decays steeply; the right group is 36% of the way to flat, and reads flatter than the left.
A distribution over symbols, as given and as it is pushed toward uniform. Drag the uniformity up to watch the entropy climb — a flat distribution is the most expensive one to describe, and a certain one is free.
Reviewed by opendroid · 2026-08-18
- arXiv:2309.10668 — Language Modeling Is Compression
Origin · not linkable
- Shannon 1948 — A Mathematical Theory of Communication · Bell System Technical Journal 27 · doi:10.1002/j.1538-7305.1948.tb01338.x