Compression need not preserve every detail. First specify which differences are acceptable; then ask how many bits the remaining information requires.
From exact reconstruction to useful omissions
Source coding in Chapter 3 required lossless reconstruction. Channel coding in Chapter 4 added redundancy against transmission noise. Here the application itself permits errors: how does that change the compression limit?
Image and audio compression may discard perceptually less important details; a classifier may ignore irrelevant backgrounds. What is safe to discard depends on the task. A nearly invisible pixel change can still affect measurement or recognition. Define distortion before assuming that discarded information has no value.
The minimum in R(D): choosing a reconstruction law
Let X be a source symbol, X^ its reconstruction, and d(x,x^) the cost of a reconstruction. For an i.i.d. source and additive per-symbol distortion, the rate–distortion function gives the asymptotic minimum rate under an average-distortion constraint:
R(D)=p(x^∣x):E[d(X,X^)]≤DminI(X;X^).
The optimization ranges over the entire conditional reconstruction distribution. The budget D limits average error without specifying how errors occur. Two reconstruction laws can have the same distortion but retain different amounts of source information. The minimum picks the least informative feasible law. Units are bits per source symbol; the single-letter expression characterizes a long-block limit, not the literal output length of a symbol-by-symbol compressor.
Under this standard setup, R(D) is nonincreasing and convex. Relaxing the constraint enlarges the feasible set, so the optimum cannot rise. Time-sharing between two codes on different portions of a long sequence gives the intuition for convexity.
The shading marks the asymptotically achievable region, with the blue curve as its lower rate boundary. At a fixed distortion budget, moving upward allows a higher rate; moving below the curve is unattainable.
This schematic assumes finite discrete alphabets and distortion that vanishes only for exact reconstruction. Then R(0)=H(X). For a continuous Gaussian source with squared error, R(0)=∞; differential entropy cannot replace the discrete endpoint.
The zero-rate endpoint is equally concrete. Define
D0=x^minE[d(X,x^)].
At D≥D0, a decoder can always output one constant and meet the budget without receiving a message. Thus R(D)=0.
Why are random flips wasteful even at the same 20% error rate?
Take X∼Bernoulli(0.2) and Hamming distortion: one for an error, zero otherwise. With binary entropy h2,
R(D)={h2(0.2)−h2(D),0,0≤D≤0.2,D≥0.2.
Independently flipping X with probability D gives the required error rate. But its mutual information is h2(0.2+0.6D)−h2(D), usually above the bound. At D=0.2, it still carries some source information, whereas always outputting zero already meets the same error budget with no information at all.
Preparing the visual
Why optimize reconstruction at the same distortion?
Fix a binary source with 80% zeros. Optimal reconstruction and independent flips have the same error rate but different mutual information. An entropy strip separates retained information from residual uncertainty.
{"id":"rd-bound","title":"Why optimize reconstruction at the same distortion?","summary":"Fix a binary source with 80% zeros. Optimal reconstruction and independent flips have the same error rate but different mutual information. An entropy strip separates retained information from residual uncertainty.","height":950,"html":"<p class=\"eyebrow\" data-i18n=\"eyebrow\"></p><h2 data-i18n=\"heading\"></h2><p class=\"intro\" data-i18n=\"intro\"></p>\n<label class=\"control\" for=\"distortion\"><span data-i18n=\"control\"></span><output id=\"d-value\"></output></label><input id=\"distortion\" type=\"range\" min=\"0\" max=\"200\" value=\"100\">\n<p class=\"note\" data-i18n=\"axis\"></p><div class=\"plot\"><svg viewBox=\"0 0 600 190\" preserveAspectRatio=\"none\" role=\"img\" data-i18n-label=\"chart\"><path id=\"naive-curve\" class=\"curve secondary\"/><path id=\"bound-curve\" class=\"curve\"/><line id=\"cursor\" y1=\"0\" y2=\"190\"/><circle id=\"bound-dot\" r=\"5\"/><circle id=\"naive-dot\" r=\"5\"/></svg></div><div class=\"scale\"><span>D = 0</span><span>0.2</span></div>\n<div class=\"legend\"><span class=\"blue\" data-i18n=\"optimal\"></span><span class=\"gold\" data-i18n=\"naive\"></span></div>\n<div class=\"metric-pair\"><div><span data-i18n=\"optimal\"></span><strong id=\"rate\"></strong></div><div><span data-i18n=\"naive\"></span><strong id=\"naive-rate\"></strong></div></div>\n<div class=\"formula\" id=\"decomposition\"></div><div class=\"band\" role=\"img\" data-i18n-label=\"strip\"><div id=\"retained\"></div><div id=\"discarded\" class=\"gold\"></div></div><div class=\"legend\"><span class=\"blue\">I(X;X̂)</span><span class=\"gold\">H(X|X̂)</span></div>\n<div class=\"formula\" id=\"reconstruction\"></div><p class=\"note\" data-i18n=\"note\"></p>\n","css":".intro { margin:8px 0 18px; color:var(--muted); font-size:14px; }\n.control { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:18px; }\n.control output { min-width:4em; flex-shrink:0; text-align:center; background:var(--accent-soft); color:var(--accent); padding:2px 8px; border-radius:6px; font-weight:600; }\n.formula { margin-top:18px; padding:14px 0; border-block:1px solid var(--rule); font-size:16px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }\n.copy-stack { display:grid; margin-top:14px; color:var(--muted); font-size:14px; }\n.copy-stack > * { grid-area:1/1; }\n.copy-stack .reserve { visibility:hidden; }\n.note { margin-top:14px; color:var(--muted); font-size:12px; }\n.metric-pair { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:18px; }\n.metric-pair > div { min-width:0; }\n.metric-pair span { display:block; font-size:12px; color:var(--muted); }\n.metric-pair strong { display:block; font-size:24px; font-weight:500; font-variant-numeric:tabular-nums; }\n.scale { display:flex; justify-content:space-between; color:var(--muted); font-size:12px; font-variant-numeric:tabular-nums; }\n@media(max-width:480px) { .metric-pair strong { font-size:21px; } }\n.presets { display:flex; }\n.plot { position:relative; margin-top:18px; height:190px; border-left:1px solid var(--rule); border-bottom:1px solid var(--muted); }\n.plot svg { width:100%; height:100%; overflow:hidden; }\n.plot .curve { fill:none; stroke:var(--accent); stroke-width:2.5; vector-effect:non-scaling-stroke; }\n.plot .curve.secondary { stroke:var(--second); stroke-dasharray:5 4; }\n.scale { position:relative; }.scale .middle { position:absolute; left:50%; transform:translateX(-50%); }\n.formula { font-size:14px; }.formula div+div { margin-top:6px; }\n@media(max-width:480px) { .plot { height:170px; } }\n.plot .curve { transition:d .28s cubic-bezier(.22,1,.36,1); }\n.band { display:flex; height:28px; border-radius:5px; overflow:hidden; background:var(--surface); margin-top:10px; }\n.band > div { background:var(--accent); transition:width .28s ease; }\n.band > .gold { background:var(--second); }\n.legend { display:flex; flex-wrap:wrap; gap:6px 18px; margin-top:10px; font-size:12px; color:var(--muted); }\n.legend .blue::before,.legend .gold::before { content:''; display:inline-block; width:9px; height:9px; border-radius:2px; margin-right:6px; background:var(--accent); }\n.legend .gold::before { background:var(--second); }\n.rows { margin-top:18px; display:grid; gap:12px; }\n.row { display:grid; grid-template-columns:32px 1fr 60px; align-items:center; gap:10px; font-size:13px; }\n.row > div { min-width:0; }.row output { text-align:right; font-variant-numeric:tabular-nums; }\n.track { height:14px; background:var(--surface); border-radius:3px; overflow:hidden; }\n.fill { height:100%; width:0; background:var(--accent); transition:width .28s ease; }\n.presets { flex-wrap:wrap; gap:4px; }.presets button { min-width:0; }\n.metric-pair strong { overflow-wrap:anywhere; }\n#cursor { stroke:var(--rule); vector-effect:non-scaling-stroke; }#bound-dot { fill:var(--accent); }#naive-dot { fill:var(--second); }\n","js":"const input=document.querySelector('input'),h=p=>viz.entropy([p,1-p]),base=h(.2),$=s=>document.querySelector(s);\nconst rate=d=>base-h(d),naive=d=>h(.2+.6*d)-h(d);\nfor(const [id,fn] of [['#bound-curve',rate],['#naive-curve',naive]])$(id).setAttribute('d',Array.from({length:201},(_,i)=>(i?'L':'M')+(i*3)+','+((1-fn(i/1000)) *190).toFixed(4)).join(' '));\nfunction draw(){const d=+input.value/1000,r=Math.max(0,rate(d)),n=naive(d),q=(.2-d)/(1-2*d);$('#d-value').textContent=viz.number(d,3);$('#rate').textContent=viz.number(r,3)+' bit';$('#naive-rate').textContent=viz.number(n,3)+' bit';\n for(const [id,value] of [['#bound-dot',r],['#naive-dot',n]]){$(id).setAttribute('cx',d/.2*600);$(id).setAttribute('cy',(1-value)*190);}$('#cursor').setAttribute('x1',d/.2*600);$('#cursor').setAttribute('x2',d/.2*600);\n $('#decomposition').textContent='H(X) = I(X;X̂) + H(X|X̂) ≈ '+viz.number(r,3)+' + '+viz.number(h(d),3)+' = '+viz.number(base,3)+' bit';$('#retained').style.width=r/base*100+'%';$('#discarded').style.width=h(d)/base*100+'%';\n $('#reconstruction').textContent='P(X̂ = 1) = (0.2 − D) / (1 − 2D) = '+viz.number(q,4);}\ninput.addEventListener('input',draw);draw();\n","audio":false,"strings":{"axis":"Horizontal D: 0–0.2. Vertical I: 0–1 bit. Blue is the bound; dashed gold is mutual information under independent flips.","chart":"Optimal and independent-flip mutual information curves, with points at the same distortion.","control":"Average error rate D","eyebrow":"THE MINIMUM IN RATE–DISTORTION","heading":"Why optimize reconstruction at the same distortion?","intro":"The source has P(X=1)=0.2. Move D to compare both curves at the same distortion. The strip decomposes only the optimal construction.","naive":"Independent-flip I","note":"The optimum uses X = X̂ ⊕ Z with independent X̂ and Z, P(Z=1)=D. This reverse description differs from independently adding noise to X. At D=0.2, always reconstruct zero: rate is zero. These are long-block limits; random flipping alone is not a compressor.","optimal":"Optimal R(D)","strip":"Fixed H(X): blue is retained information, gold is residual uncertainty."}}
Why is the blue bound attainable? Define the error variable Z=X⊕X^. For D≤0.2,
H(X∣X^)=H(Z∣X^)≤H(Z)≤h2(D).
Hence I(X;X^)≥h2(0.2)−h2(D). To achieve equality, construct the joint law backwards: draw X^∼Bernoulli(q) and independent Z∼Bernoulli(D), then set X=X^⊕Z. Keeping the source marginal at 0.2 requires
0.2=D+q(1−2D)⇒q=1−2D0.2−D.
This joint law has the required source distribution and distortion, and achieves the lower bound. Independence is between error and reconstruction, not error and original input. That distinction explains the two curves.
The information bottleneck: preserve the task, not every input detail
Rate–distortion starts with a chosen d(x,x^). Representation learning often cares about a label Y instead of reconstructing every detail of X. The information bottleneck fixes p(x,y) and chooses a stochastic encoder p(t∣x):
p(t∣x)minJIB=I(X;T)−βI(T;Y),β≥0.
The first term measures retained input information; the second rewards retained task information. Larger β places more weight on the task. Compression here means mutual information, not vector dimension or file size. A low-dimensional continuous vector does not automatically carry little mutual information.
This uses the color/shape example below: four equiprobable inputs, independent color and shape, and a task that identifies color alone. The two shapes merge into one representation per color, reducing 2 input bits to 1 bit while preserving exact color prediction.
The joint law is p(x,y,t)=p(x,y)p(t∣x), giving the Markov relation Y→X→T: the encoder only reads the input. The diagram's X→T→Y^ is the prediction pipeline, with Y^ the prediction. These arrows describe different things.
Equal compression can discard entirely different information
Let X=(S,N), where color S and shape N are independent fair bits, and let Y=S. Input entropy is 2 bits; task information is at most 1 bit.
Preparing the visual
What should a compressed representation forget?
Four equally likely inputs combine color S and shape N; the task is Y=S. Switch representations to see which inputs merge, then vary β to compare four bottleneck objectives.
{"id":"ib-representation","title":"What should a compressed representation forget?","summary":"Four equally likely inputs combine color S and shape N; the task is Y=S. Switch representations to see which inputs merge, then vary β to compare four bottleneck objectives.","height":950,"html":"<p class=\"eyebrow\" data-i18n=\"eyebrow\"></p><h2 data-i18n=\"heading\"></h2><p class=\"intro\" data-i18n=\"intro\"></p>\n<div class=\"presets\" role=\"group\" data-i18n-label=\"representations\"><button data-mode=\"all\" data-i18n=\"all\"></button><button data-mode=\"signal\" data-i18n=\"signal\"></button><button data-mode=\"noise\" data-i18n=\"noise\"></button><button data-mode=\"none\" data-i18n=\"none\"></button></div>\n<div class=\"mapping\"><svg viewBox=\"0 0 320 180\" role=\"img\" data-i18n-label=\"chart\"><g id=\"edges\"></g><g id=\"sources\"></g><g id=\"targets\"></g></svg></div><p class=\"note\" data-i18n=\"legend\"></p>\n<div class=\"metric-pair\"><div><span>I(X;T)</span><strong id=\"input-info\"></strong></div><div><span>I(T;Y)</span><strong id=\"task-info\"></strong></div></div>\n<label class=\"control\" for=\"beta\"><span data-i18n=\"control\"></span><output id=\"beta-value\"></output></label><input id=\"beta\" type=\"range\" min=\"0\" max=\"300\" value=\"150\">\n<div class=\"formula\" id=\"objective\"></div><div class=\"scores\" id=\"scores\"></div><p class=\"note\" data-i18n=\"note\"></p>\n","css":".intro { margin:8px 0 18px; color:var(--muted); font-size:14px; }\n.control { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:18px; }\n.control output { min-width:4em; flex-shrink:0; text-align:center; background:var(--accent-soft); color:var(--accent); padding:2px 8px; border-radius:6px; font-weight:600; }\n.formula { margin-top:18px; padding:14px 0; border-block:1px solid var(--rule); font-size:16px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }\n.copy-stack { display:grid; margin-top:14px; color:var(--muted); font-size:14px; }\n.copy-stack > * { grid-area:1/1; }\n.copy-stack .reserve { visibility:hidden; }\n.note { margin-top:14px; color:var(--muted); font-size:12px; }\n.metric-pair { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:18px; }\n.metric-pair > div { min-width:0; }\n.metric-pair span { display:block; font-size:12px; color:var(--muted); }\n.metric-pair strong { display:block; font-size:24px; font-weight:500; font-variant-numeric:tabular-nums; }\n.scale { display:flex; justify-content:space-between; color:var(--muted); font-size:12px; font-variant-numeric:tabular-nums; }\n@media(max-width:480px) { .metric-pair strong { font-size:21px; } }\n.presets { display:flex; }\n.plot { position:relative; margin-top:18px; height:190px; border-left:1px solid var(--rule); border-bottom:1px solid var(--muted); }\n.plot svg { width:100%; height:100%; overflow:hidden; }\n.plot .curve { fill:none; stroke:var(--accent); stroke-width:2.5; vector-effect:non-scaling-stroke; }\n.plot .curve.secondary { stroke:var(--second); stroke-dasharray:5 4; }\n.scale { position:relative; }.scale .middle { position:absolute; left:50%; transform:translateX(-50%); }\n.formula { font-size:14px; }.formula div+div { margin-top:6px; }\n@media(max-width:480px) { .plot { height:170px; } }\n.plot .curve { transition:d .28s cubic-bezier(.22,1,.36,1); }\n.band { display:flex; height:28px; border-radius:5px; overflow:hidden; background:var(--surface); margin-top:10px; }\n.band > div { background:var(--accent); transition:width .28s ease; }\n.band > .gold { background:var(--second); }\n.legend { display:flex; flex-wrap:wrap; gap:6px 18px; margin-top:10px; font-size:12px; color:var(--muted); }\n.legend .blue::before,.legend .gold::before { content:''; display:inline-block; width:9px; height:9px; border-radius:2px; margin-right:6px; background:var(--accent); }\n.legend .gold::before { background:var(--second); }\n.rows { margin-top:18px; display:grid; gap:12px; }\n.row { display:grid; grid-template-columns:32px 1fr 60px; align-items:center; gap:10px; font-size:13px; }\n.row > div { min-width:0; }.row output { text-align:right; font-variant-numeric:tabular-nums; }\n.track { height:14px; background:var(--surface); border-radius:3px; overflow:hidden; }\n.fill { height:100%; width:0; background:var(--accent); transition:width .28s ease; }\n.presets { flex-wrap:wrap; gap:4px; }.presets button { min-width:0; }\n.metric-pair strong { overflow-wrap:anywhere; }\n.mapping { margin-top:20px; }.mapping svg { width:100%; display:block; max-height:230px; }.edge { stroke:var(--muted); opacity:.45; stroke-width:2; fill:none; transition:d .28s ease; }.source-text { fill:var(--ink); font-size:18px; }.target { fill:var(--paper); stroke:var(--rule); }.target-text { fill:var(--ink); font-size:18px; }.scores { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:14px; }.score { padding:10px; border:1px solid var(--rule); border-radius:7px; min-width:0; }.score span { display:block; max-height:230px; font-size:12px; color:var(--muted); }.score strong { font-size:18px; font-weight:500; font-variant-numeric:tabular-nums; }.score.best { border-color:var(--accent); background:var(--accent-soft); }.score.current span { color:var(--ink); font-weight:600; }\n","js":"const $=s=>document.querySelector(s),ns='http://www.w3.org/2000/svg',modes={all:[0,1,2,3],signal:[0,0,1,1],noise:[0,1,0,1],none:[0,0,0,0]},info={all:[2,1],signal:[1,1],noise:[1,0],none:[0,0]};let mode='signal';\nfunction node(tag,attrs,parent,text){const e=document.createElementNS(ns,tag);for(const [k,v]of Object.entries(attrs))e.setAttribute(k,v);if(text)e.textContent=text;parent.append(e);return e;}\nfor(let i=0;i<4;i++){const x=40+80*i;node('path',{d:'M'+x+',90 C'+x+',105 '+x+',105 '+x+',120',class:'edge'},$('#edges'));node(i%2?'rect':'circle',i%2?{x:x-12,y:25,width:24,height:24,fill:i<2?'var(--accent)':'var(--second)'}:{cx:x,cy:37,r:12,fill:i<2?'var(--accent)':'var(--second)'},$('#sources'));node('text',{x,y:78,'text-anchor':'middle',class:'source-text'},$('#sources'),''+Math.floor(i/2)+(i%2));const g=node('g',{},$('#targets'));node('rect',{x:-28,y:120,width:56,height:40,rx:10,class:'target'},g);node('text',{x:0,y:146,'text-anchor':'middle',class:'target-text'},g,'T'+i);}\nfor(const m of Object.keys(modes)){$('#scores').insertAdjacentHTML('beforeend','<div class=\"score\" data-score=\"'+m+'\"><span></span><strong></strong></div>');$('[data-score=\"'+m+'\"] span').textContent=viz.t(m);}\nfunction draw(){const b=+$('#beta').value/100,values=Object.fromEntries(Object.keys(info).map(k=>[k,info[k][0]-b*info[k][1]])),best=Math.min(...Object.values(values)),map=modes[mode],count=Math.max(...map)+1;\n document.querySelectorAll('.edge').forEach((e,i)=>e.setAttribute('d','M'+(40+80*i)+',90 C'+(40+80*i)+',105 '+((map[i]+.5)*320/count)+',105 '+((map[i]+.5)*320/count)+',120'));[...$('#targets').children].forEach((e,i)=>{e.style.transition='transform .28s ease, opacity .2s';e.style.transform='translateX('+(i<count?(i+.5)*320/count:160)+'px)';e.style.opacity=i<count?'1':'0';});\n $('#input-info').textContent=info[mode][0]+' bit';$('#task-info').textContent=info[mode][1]+' bit';$('#beta-value').textContent=viz.number(b,2);$('#objective').textContent='J = I(X;T) − β I(T;Y) = '+info[mode][0]+' − '+viz.number(b,2)+' × '+info[mode][1]+' = '+viz.number(values[mode],2);\n document.querySelectorAll('[data-mode]').forEach(e=>e.setAttribute('aria-pressed',String(e.dataset.mode===mode)));for(const m of Object.keys(info)){const e=$('[data-score=\"'+m+'\"]');e.classList.toggle('best',Math.abs(values[m]-best)<1e-9);e.classList.toggle('current',m===mode);e.querySelector('strong').textContent=viz.number(values[m],2);}}\n$('#beta').addEventListener('input',draw);document.querySelectorAll('[data-mode]').forEach(e=>e.addEventListener('click',()=>{mode=e.dataset.mode;draw();}));draw();\n","audio":false,"strings":{"all":"Keep both","chart":"Four inputs merge into representation nodes according to the selected mapping.","control":"Task-information weight β","eyebrow":"MERGE IRRELEVANT DIFFERENCES","heading":"What should a compressed representation forget?","intro":"Color S determines label Y; shape N is independent of the task. All four combinations are equally likely. Merging lines means the encoder no longer distinguishes inputs.","legend":"The two digits are SN. Blue/gold encode S=0/1; circle/square encode N=0/1.","noise":"Shape only","none":"Merge all","note":"Smaller J is better; blue outlines mark every minimizer among these four choices. Color alone preserves the same task information as both features, with 1 bit less input information. Merge all wins for β<1; color wins for β>1. This is a finite discrete example, not a neural training trajectory.","representations":"Representation","signal":"Color only"}}
Color alone, T=S, gives I(X;T)=I(T;Y)=1. Shape alone, T=N, gives I(X;T)=1 but I(T;Y)=0. Both retain one bit, but only one retains the task. Keeping both gives (2,1) and is dominated by color's (1,1). Merging everything gives (0,0), compressing completely while losing the label.
Here I(T;Y)≤I(X;T) and I(T;Y)≤1. For β<1, J≥0, attained by a constant representation. For β>1, J≥1−β, attained by color alone. At β=1, both are minimizers. This is a tradeoff in an objective, not a theorem that less information always improves generalization.
“Fitting, then compression” is an observation, not a universal law
An information plane locates each layer at (I(X;T),I(T;Y)). Shwartz-Ziv and Tishby observed fitting and compression phases in particular networks and estimation settings, motivating one perspective on learning.
Movement on that plane does not establish the cause of generalization. Estimates depend on binning, noise, activation functions, and sample size. Deterministic representations of continuous inputs can even have infinite mutual information, so the probability model and estimator must be specified. Later work demonstrated limitations and counterexamples to universal compression claims. IB defines an analyzable objective; it does not prove that every network follows one training trajectory.
Contrastive learning is related, but not automatically IB
InfoNCE learns by distinguishing positive and negative pairs. With joint-distribution positives and appropriately independent marginal negatives, a natural-log loss with K total candidates yields
I(U;V)≥logK−LNCE.
Reducing the loss raises a lower bound; it does not directly measure mutual information. The bound depends on sampling and K and cannot exceed logK. This relates to retaining relevant information, but ordinary InfoNCE has no explicit I(X;T) compression term. Contrastive learning should not all be described as IB optimization.