Information Theory in Representation Learning
A good visual feature keeps what the task needs and drops the rest. Information theory measures both sides: how much the feature remembers about the image versus about the label.
Why Does This Exist?
Visual features memorize shortcuts. A classifier trained on cows in fields learns green backgrounds; one trained on medical scans learns the hospital's scanner signature. Accuracy on the training distribution hides the smuggling, and deployment on new backgrounds exposes it. The problem is not too little information but the wrong information kept.
Information theory names the right kept information: a representation should minimize what it carries about the input while maximizing what it carries about the label . That compression-versus-prediction tradeoff is the information bottleneck, and it turns "don't learn shortcuts" from a wish into an objective. The probabilistic home is probabilistic foundations; the data-quality ally is data-centric AI.
The one idea you need first. Mutual information measures how much knowing reduces uncertainty about , in nats or bits: . Independent variables score zero; perfect predictors score the full entropy. The bottleneck objective is : squeeze the input channel, protect the label channel, with setting the exchange rate.
Think of It Like This
Packing a suitcase for one trip
A good traveler packs everything the trip needs and nothing else: passport, tickets, one adaptable jacket — not the living-room lamp "just in case". Every extra item costs carrying weight; every missing one costs a purchase abroad. The suitcase is judged by the trip, not by how much of home it contains.
A representation is that suitcase. The input image is home with all its clutter (backgrounds, watermarks, scanner brands); the label is the trip. is the suitcase weight; is trip readiness. Shortcut features are lamps: heavy, useless abroad. The bottleneck objective packs deliberately instead of stuffing the whole house.
The analogy stops at the zipper: suitcases have fixed volume, while tunes the tradeoff continuously — and unlike packing, nobody can directly see what got left out.
How It Actually Works
Training optimizes a tractable version of the bottleneck: an encoder regularized toward a prior (limiting ) plus a classifier on (protecting ). The variational bottleneck (VIB) makes both terms computable with the same Gaussian KL machinery as VAEs. InfoMax variants flip the emphasis, maximizing under augmentation constraints to keep views mutually informative (the engine inside many contrastive methods).
Reading a trained model informationally means probing: accuracy with backgrounds swapped estimates how much smuggled, and compression ratios bound how much trivia could hide.
Worked example
A binary feature predicts a binary label with joint probabilities , , , .
Margins are uniform ( each), so each cell contributes . The cells: each. The cells: each. Total: nats, about bits.
So this feature carries bits about the label — modest but real. A shortcut feature scoring high training accuracy with near-zero on swapped backgrounds is thereby exposed as memorization.
Code
The point of this snippet is the measurement: mutual information from a contingency table reproduces the nats.
import math
def mutual_information(joint: list) -> float: total = sum(sum(row) for row in joint) rows = len(joint) cols = len(joint[0]) mi = 0.0 for i in range(rows): for j in range(cols): p = joint[i][j] / total # joint probability pi = sum(joint[i]) / total # row margin pj = sum(joint[r][j] for r in range(rows)) / total # column margin if p > 0: mi += p * math.log(p / (pi * pj)) return mi
print(round(mutual_information([[0.4, 0.1], [0.1, 0.4]]), 3)) # -> 0.193Watch Out For
Mutual information is estimated, never measured
In high dimensions MI has no unbiased cheap estimator; variational bounds (MINE, InfoNCE) report lower bounds that move with the estimator's capacity. Teams that read "MI " as a physical constant chase estimator artifacts instead of representation changes.
Treat MI numbers as comparisons under one fixed estimator, never as absolutes across papers. If the estimator changes, the scale changes with it.
Beta set once, regretted everywhere
Small over-compresses: features drop label-relevant detail and accuracy sags on hard slices. Large under-compresses: shortcuts survive and robustness never arrives. The failure modes look like opposite problems (underfitting versus overfitting) from one knob.
Sweep across orders of magnitude and plot accuracy against a background-swapped evaluation, not just validation accuracy. The honest setting sits at the knee where robustness climbs before clean accuracy falls.
The Quick Version
- Representations should minimize input memory while protecting label content .
- The worked fixture computes nats ( bits) from a joint table.
- The bottleneck objective makes the exchange rate explicit through .
- High-dimensional MI is a bound under a fixed estimator, not an absolute constant.
- Sweep against background-swapped evaluations to find the robustness knee.