Module 16. Course Reference Sheet
16.1. Course Reference Sheet: Key Ideas and Formulas
This is not another theory module. It is a working reference for three situations: recalling a definition, choosing the right information-theoretic object, and catching an overclaim before it turns into a modeling or experimental error.
You do not need to read it linearly. Return to the relevant block when the real question is: what exactly am I measuring, relative to which distribution, and in which units? Proofs, examples, code, and primary sources remain in Modules 1–15.
Four diagnostic questions to ask first
Before using any information-theoretic formula, ask:
- Whose distribution appears inside the logarithm? The data-generating law , the model , a posterior, a policy, or a critic?
- Which distribution defines the average? Data, model samples, a mixture, policy trajectories, or the randomness of the learning algorithm?
- What is the unit? Bits, nats, bits per token, bits per byte, bits per pixel, bits per channel use, or total description length?
- What is the status of the quantity? A population object, a finite-sample estimator, a training objective, a variational bound, or a physical bitstream?
Much of the confusion in ML comes not from difficult mathematics but from silently changing the answer to one of these questions.
Notation and units
Here usually denotes the source or data distribution, and denotes a model. Base-two logarithms produce bits; natural logarithms produce nats:
If but , the model has declared a possible event impossible, so the corresponding cross-entropy and KL divergence are infinite.
1. Surprisal, entropy, and the model's bill — M1–M3
Surprisal of one outcome
The logarithm turns products of independent probabilities into additive information costs:
Rare events receive a large bill; likely events receive a small one. This bill says nothing by itself about semantic importance: an unlikely typo may be expensive in bits and still be meaningless.
Entropy
Entropy is the average bill for source uncertainty. For a finite alphabet of size ,
with equality at the upper end for the uniform distribution.
The chain rule is
and for a sequence,
This is the accounting identity behind autoregressive modeling: one global bill becomes a sequence of conditional bills.
Cross-entropy and KL
The central decomposition is
is irreducible source uncertainty. KL is the average surcharge for using the wrong probabilistic model.
For conditional prediction,
Maximum likelihood can reduce the mismatch term, but it cannot remove uncertainty inherent in the data distribution.
Autoregressive NLL and perplexity
An average log loss becomes perplexity through
Perplexity is a monotone re-expression of average NLL, not a separate measure of truth, reasoning, or factual correctness.
Softmax cross-entropy gradient
If , is the target distribution, and cross-entropy is measured in nats, then
For base , the gradient is . The model increases logits where target mass exceeds model mass and decreases them where it has allocated too much probability.
Do not conflate
- Predictive entropy asks how spread out the model is before the answer is observed.
- NLL asks how much probability the model assigned to the realized answer.
- Source entropy belongs to the true data distribution.
A confidently wrong prediction can have low predictive entropy and enormous NLL.
2. Averaging through a nonlinearity: Jensen and variational bounds — M4
For convex ,
For concave functions the direction reverses. This is a reliable compass: identify curvature first, then decide whether averaging happens before or after the nonlinear map.
Probability ensembles
Because is convex,
An arithmetic mixture of probabilities is no worse than the average member in per-example log loss. This does not automatically improve accuracy, calibration, or robustness under distribution shift.
ELBO
For a latent-variable model,
where
The ELBO is a lower bound on log evidence, and its gap is known exactly: posterior KL.
Coarse-graining
If a deterministic or stochastic map discards detail, KL distinguishability cannot increase:
This is an early instance of a recurring principle: processing can reorganize information but cannot manufacture distinguishability from nothing.
3. Mutual information: the value of an observation — M5
The entropy-difference identities below are written for discrete variables with finite . In general, MI is defined through KL, avoiding subtraction of infinities.
Mutual information has three equivalent readings:
- reduction in population-optimal log loss after observing ;
- divergence from the world in which and are independent;
- average strength of statistical dependence.
Conditional mutual information is
It asks what adds about after is already known. This is why CMI captures redundancy and synergy that one-feature-at-a-time selection can miss.
Data processing inequality
If
then
An encoder may make existing target information easier for a restricted classifier to extract without creating new bits about the target.
InfoNCE
With a positive pair drawn from and negatives drawn independently from , independently of the positive pair, the population bound is
The ceiling belongs to this particular lower bound, not to population MI and not to representation quality in general.
Estimating MI
Keep these three objects separate:
Plug-in, nearest-neighbor, and neural estimators have different bias, variance, and failure modes. A numerical MI value without an estimation protocol is rarely meaningful.
4. From probabilities to bits and from messages to channels — M6–M7
Kraft inequality
For binary prefix-code lengths,
This is the budget of a binary tree: a short codeword occupies a large share of the available space.
Source coding theorem
For an optimal one-symbol prefix code,
For a code tuned to model , the ideal expected length is
An arithmetic or range coder turns sequential conditional probabilities into an actual reversible stream, but finite precision, termination, headers, and metadata add overhead.
Therefore distinguish
The last quantity may include the model, tokenizer, and decoding protocol.
AEP and entropy rate
For an i.i.d. source,
For a stationary source with memory, the central object is entropy rate:
Channel capacity
For a discrete memoryless channel,
at a fixed input distribution is one operating point. Capacity additionally optimizes over admissible input laws.
Canonical examples are
Reliable communication is asymptotically possible at and impossible with vanishing error at .
For the standard asymptotic memoryless source-channel problem with channel uses per source symbol, separation guarantees achievability in the interior region
The equality boundary requires separate analysis: the strict inequality is sufficient, not universally necessary.
A context window, attention matrix, or hidden state is not automatically a channel capacity. Messages, admissible inputs, noise, cost, a unit of channel use, and an error criterion must first be defined.
5. MaxEnt, exponential families, and exponential tilting — M8
Relative maximum entropy
Given a reference measure and linear expectation constraints, solve the information projection
For an interior solution under the conditions in §8.2, the exponential form follows; a boundary solution may require a parameter limit:
Exponential tilting is a recurring mechanism: redistribute reference mass toward high-score states, then pay the normalization cost.
Exponential family
For a regular family,
The gradient of the log-partition function gives mean sufficient statistics; its Hessian gives their covariance and Fisher information in natural coordinates.
Softmax as an exact optimum
With entropy in nats, the exact optimality gap is
Energy-based model
Its NLL gradient is
The positive phase lowers data energy; the negative phase raises energy for typical model samples.
KL-regularized policy
The objective
has the Gibbs optimum
KL prices movement away from the reference policy; it does not certify the reward itself.
Along the exponential path ,
Proxy reward increases because its derivative is its variance. True quality increases only while its covariance with the proxy remains positive.
6. Useful forgetting: rate–distortion, IB, and VAE — M9
Rate–distortion
asks how much information must be retained to keep expected distortion below . The answer depends on the distortion function; information becomes “irrelevant” only relative to a task and an error criterion.
Information Bottleneck
Under ,
A representation is compressed relative to the task when it merges inputs without materially changing what can be predicted about .
VIB and VAE
In VIB, KL to a chosen prior upper-bounds the rate:
For a VAE,
A standard VAE is a rate–distortion system for modeling , but it is not identical to supervised IB with an external relevance variable .
I–MMSE
For the Gaussian channel
with and , mutual information in nats satisfies
The rate at which information accumulates with SNR equals half the optimal estimation error. This is a powerful bridge to denoising and diffusion, not a complete choice of architecture or noise schedule.
7. Individual descriptions and MDL — M10
Kolmogorov complexity of one string is
It depends on the universal machine only up to an additive constant, but is uncomputable in general.
Most length- strings are incompressible:
for uniform .
For a computable distribution , Shannon and algorithmic descriptions meet on average:
Minimum description length uses
A model pays both for its own description and for the data residual it fails to explain. Description length is still not semantic value, computational cost, or practical compressor output.
8. Comparing implicit distributions — M11
For convex with and , the -divergence is
With different convex generators it includes KL, total variation, , squared Hellinger, and Jensen–Shannon. Without absolute continuity, use the extension that includes the singular part (§11.2); the displayed expectation under alone omits that contribution.
Classifier-based density-ratio estimation
If samples from have prior probability , then the optimal discriminator obeys
Strong source classification does not by itself guarantee a numerically accurate density ratio; calibrated probabilities are also required.
Variational representation
Under suitable conditions,
In practice, distinguish the exact supremum, the best critic in a restricted class, and the critic obtained from finite-sample training.
For the original minimax GAN with an optimal discriminator,
This is a population identity, not a description of each finite optimization step.
When supports are separated, KL and JS may provide poor optimization geometry. Integral probability metrics offer different structures: Wasserstein measures transport cost, while MMD compares RKHS mean embeddings.
9. Adaptivity and generalization — M12
PAC-Bayes-kl
For loss , an i.i.d. certification sample of size , and a prior independent of that sample, with probability at least , simultaneously for all posteriors ,
The guarantee is for the Gibbs predictor , not automatically for a network with averaged weights.
A generalized Gibbs distribution minimizes empirical risk plus a KL price:
MI generalization bound
For -sub-Gaussian losses,
This controls an expected gap over the sample and algorithmic randomness; it is not a high-probability certificate for one realized run.
PAC-Bayes and MI meet in the exact average decomposition
MI measures dependence of the learned result on the sample. The second term measures mismatch between the chosen prior and the algorithm's marginal output distribution.
10. Reasoning and test-time computation — M13
Suppose an internal scratchpad is generated as
Then
An internally generated chain adds no new fact about the correct answer beyond the full input for an ideal observer. It can still help as sequential computation, working memory, or search.
If the system receives an external observation ,
and the final term may be positive.
For independent candidates, each correct with probability , an ideal verifier obtains
Real performance depends on both generator coverage and selection quality. Wider search can find more correct candidates while also creating more opportunities to exploit verifier errors.
For arbitrary non-nested states,
State improvement is a balance between newly available relevant information and relevant information discarded when the previous state is replaced.
11. Computer vision: four different budgets — M14
Learned image compression
A typical learned codec optimizes
where is expected code length for quantized latents and side information, and is an explicitly chosen distortion.
For a hyperprior,
Side information is useful only when the savings in the main latent code exceed its own transmission cost.
Denoising and score
For
with , , , and , the MSE-optimal denoiser is the posterior mean:
The score of the noisy marginal is
This is an exact bridge from denoising to score estimation, not a complete derivation of a diffusion architecture.
Keep four budgets separate
- a data codec is measured in actual bits or bits per pixel;
- a representation is judged by information useful for a chosen task;
- a noisy observation limits estimation quality;
- a deployed model pays in storage, bit width, memory bandwidth, and latency.
12. Information geometry — M15
Fisher as the local form of KL
For a smooth family ,
where
Fisher measures local statistical distinguishability; it does not turn globally asymmetric KL into a metric distance.
Natural gradient
The natural gradient associated with a local KL budget is
Descent uses its negative. Here is positive definite. In regular coordinates the vector field transforms invariantly, while a finite Euler step agrees only to first order. A singular requires working on the identifiable space: selects a coordinate-dependent representative, although compatible gradients may induce the same distributional motion. Damping and an approximate Fisher also depend on implementation.
Two geometries
Fisher–Rao asks how distinguishable neighboring distributions are. Wasserstein asks how much it costs to transport probability mass through observation space:
No single geometry is universally correct. Choose the object first: predictive distribution, policy, image density, or physical mass flow.
For an exponential family,
and KL is the Bregman divergence of the log-partition function:
13. A quick lookup table
| Question | Primary object | What it does not promise |
|---|---|---|
| How spread out is the model itself? | predictive entropy | truth or calibration |
| What bill did the model receive on data? | NLL / cross-entropy | source entropy without additional assumptions |
| What is the cost of model mismatch? | KL | symmetry or metric geometry |
| What does one variable reveal about another? | MI / CMI | causal direction |
| How many bits does a source require? | entropy, entropy rate, actual code length | model and protocol cost unless counted |
| How fast can messages pass through noise? | channel capacity | an answer without channel and input constraints |
| Which distribution should satisfy partial information? | MaxEnt / I-projection | correctness of the constraints themselves |
| How much information must be retained at allowed error? | rate–distortion / IB | a universal distortion function |
| How can implicit distributions be compared from samples? | variational -divergence, MMD, Wasserstein | accuracy with a weak critic or small sample |
| How should adaptive model choice be paid for? | PAC-Bayes KL or | the same type of guarantee |
| What do extra reasoning tokens buy? | sequential computation, search, external observations | automatic creation of new information |
| What counts as a small model update? | Fisher/KL, Bregman, or Wasserstein geometry | one geometry for every object |
14. Common overclaims
| Overcompressed claim | Precise version |
|---|---|
| Low entropy means the answer is correct | Low entropy means the model distribution is concentrated |
| NLL is the entropy of language | NLL estimates data-model cross-entropy under a particular protocol |
| KL is a distance | KL is asymmetric; its local quadratic form defines Fisher geometry |
| An encoder creates target information | Without external data it can only preserve, lose, or reorganize it |
| InfoNCE measures all of MI | It gives one lower bound under one sampling scheme |
| A VAE is the same as supervised IB | They share rate–distortion structure but use different relevance variables |
| KL prevents Goodhart | KL limits distribution shift but does not repair a misspecified reward |
| A longer chain of thought adds new facts | Internal CoT adds computation; new facts require external observations |
| A strong classifier accurately estimates | Density-ratio estimation also requires calibrated probabilities |
| Better compression equals intelligence | Compression exactly measures predictive log loss and may correlate with some capabilities |
| PPO clipping guarantees small KL | Clipping controls a local surrogate on sampled actions |
| One information quantity explains all of ML | Variables, protocol, constraints, and guarantee type must be specified first |
15. Seven mechanisms that connect the course
- Logarithms turn probability products into additive costs. This gives surprisal, NLL, code length, and autoregressive factorization.
- KL isolates mismatch cost. It appears in cross-entropy, variational inference, MaxEnt, RLHF, PAC-Bayes, and information geometry—but between different objects each time.
- Jensen controls the order of averaging and nonlinearity. Ensemble guarantees, ELBO, log-sum, and many variational bounds grow from it.
- MI measures the predictive value of an observation. CMI measures added value, DPI limits processing, and InfoNCE supplies one trainable lower bound.
- Coding gives probabilities an operational meaning. A probabilistic model becomes a compressor only together with an entropy coder and a shared decoding protocol.
- Exponential tilting is a universal constrained update. It unifies MaxEnt, exponential families, softmax, and KL-regularized policies.
- Information does not replace the task, computation, or semantics. A formula becomes useful only after variables, quality criterion, available observations, and resource constraints are fixed.
With this map in place, the formulas stop looking like a collection of tricks. They become different answers to one recurring question:
How should we measure, transmit, preserve, compare, or redistribute uncertainty under explicit constraints?
This reference sheet introduces no new results. Primary sources and full conditions remain in the reference lists of Modules 1–15 next to the corresponding topics.