Foundations to Frontier
Tests
A. Mathematical Foundations › A7 Information Theory

Rate–Distortion Theory

When perfect reconstruction is impossible or too expensive, how many bits do you need for a given fidelity? Rate–distortion theory answers with R(D), the minimum mutual information between a source and its reconstruction that keeps the expected distortion at most D. You will derive R(D) for binary and Gaussian sources, compute it with Blahut–Arimoto, allocate bits across spectral bands by reverse water-filling, measure how far practical quantizers sit from the bound, and connect it all to learned image codecs and β-VAEs.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Good enough with fewer bits

A photo from Mars doesn’t need every grain of sand perfectly reproduced, just good enough for scientists to see the rocks. The fewer details you keep, the fewer bits you send. Rate–distortion theory gives the exact trade-off: for any amount of allowed error (distortion), it tells you the smallest number of bits (rate) any compressor could ever use.

Rate–distortion: how many bits for how much fidelity?
10.10.01rate (bits) →D(R) = σ²2^(−2R)● Lloyd–Max (fixed rate)– – uniform + entropy coding2.21.81.41.00.60.10.00.0θ = 0.30band variances; shaded = distortion; numbers = bits
At R = 2.00 bits the best possible MSE is 0.0625 (12.0 dB SNR). Bands: total rate 7.02 bits for total distortion 2.00.
Each extra bit cuts the Gaussian MSE by 4× (6.02 dB). A simple scalar quantizer with entropy coding sits a constant 1.53 dB (0.25 bit) above the bound, and vector quantization or learned codecs close the gap. Across bands of different variance, the optimum fills distortion up to a common water level θ. Bands quieter than θ get zero bits and are simply dropped.
Why engineers care

Orbiters and rovers send lossy-compressed images and spectra, because downlink is the bottleneck. Rate–distortion theory tells you how close a compressor is to optimal and how to split bits between bands. It’s also the theory behind learned neural codecs and the β-VAE.

📝 Quick check (Level 0)
0/3 answered
  1. 1. Allowing more distortion means you need…
  2. 2. Perfect (lossless) reconstruction of a discrete source needs…
  3. 3. Lossless coding of a continuous-valued signal needs…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

The rate–distortion function

Pick a distortion measure d(x,x^)d(x, \hat x) (Hamming, squared error, …). Then

R(D)=min⁡p(x^∣x): E d(X,X^)≤DI(X;X^)R(D) = \min_{p(\hat x\mid x):\ \mathbb E\,d(X,\hat X)\le D}I(X;\hat X)

Shannon’s rate–distortion theorem says rates above R(D)R(D) are achievable at distortion DD with long block codes, and rates below are not.

Two key results

  • Bernoulli(p), Hamming distortion: R(D)=h2(p)−h2(D)R(D) = h_2(p) - h_2(D) for 0≤D≤min⁡(p,1−p)0\le D\le\min(p, 1 - p), and 0 beyond.
  • Gaussian N(0,σ2)\mathcal N(0, \sigma^2), squared error: R(D)=12log⁡2σ2DR(D) = \frac12\log_2\frac{\sigma^2}D for D≤σ2D\le\sigma^2. Equivalently D(R)=σ22−2RD(R) = \sigma^22^{-2R}: each bit buys 6.02 dB.
📝 Quick check (Level 1)
0/3 answered
  1. 1. Gaussian, σ² = 1, D = 0.25: R =
  2. 2. Each extra bit reduces Gaussian MSE by a factor of…
  3. 3. Fair coin with allowed bit error D = 0.11: R ≈

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.

Parallel Gaussian sources: reverse water-filling

For independent components with variances σi2\sigma_i^2 and total distortion DD:

Di=min⁡(θ,σi2),∑Di=D,R=∑i12log⁡2σi2DiD_i = \min(\theta, \sigma_i^2),\quad\sum D_i = D,\quad R = \sum_i\tfrac12\log_2\frac{\sigma_i^2}{D_i}

Components weaker than the water level θ\theta get zero bits. This is why transform coders (DCT, wavelets, KLT/PCA) work: decorrelate, then spend bits only on high-variance coefficients.

Computing R(D): Blahut–Arimoto

Alternate between Q(x^∣x)∝q(x^)e−βd(x,x^)Q(\hat x\mid x)\propto q(\hat x)e^{-\beta d(x, \hat x)} and q(x^)=∑xp(x)Q(x^∣x)q(\hat x) = \sum_xp(x)Q(\hat x\mid x). Each slope β\beta gives one point (D,R)(D, R) on the curve.

Practical quantizers vs the bound

  • Lloyd–Max (fixed rate): at 1 bit, D=1−2/π=0.363σ2D = 1 - 2/\pi = 0.363\sigma^2 vs 0.25σ20.25\sigma^2. The gap grows at higher rates.
  • Uniform quantizer plus entropy coding: D≈πe6D(R)D\approx\frac{\pi e}6D(R) at high rate, a constant 1.53 dB (0.254 bit) gap. Vector quantization closes it.
🐍 Exercise 1: R(D) curves and Blahut–Arimoto
Implement the Gaussian and Bernoulli R(D). Implement Blahut–Arimoto for rate–distortion and check that its points lie on h₂(p) − h₂(D) for a Bernoulli(0.3) source.
📝 Quick check (Level 2)
0/3 answered
  1. 1. In reverse water-filling, a component with variance below θ gets…
  2. 2. The entropy-coded uniform quantizer's high-rate gap to R(D) is…
  3. 3. 1-bit Lloyd–Max MSE for a unit Gaussian:

Level 3: Advanced

★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.

Gaussian R(D): converse

I(X;X^)=h(X)−h(X∣X^)≥h(X)−h(X−X^)I(X;\hat X) = h(X) - h(X\mid\hat X)\ge h(X) - h(X - \hat X). Since E(X−X^)2≤D\mathbb E(X - \hat X)^2\le D, the Gaussian maximum-entropy bound gives h(X−X^)≤12log⁡2(2πeD)h(X - \hat X)\le\frac12\log_2(2\pi eD). With h(X)=12log⁡2(2πeσ2)h(X) = \frac12\log_2(2\pi e\sigma^2), this yields I≥12log⁡2(σ2/D)I\ge\frac12\log_2(\sigma^2/D). ∎

Achievability

Use the “test channel” X=X^+ZX = \hat X + Z with X^∼N(0,σ2−D)\hat X\sim\mathcal N(0, \sigma^2 - D) and Z∼N(0,D)Z\sim\mathcal N(0, D) independent. Then I(X;X^)=12log⁡2(σ2/D)I(X;\hat X) = \frac12\log_2(\sigma^2/D) exactly. ∎

Bernoulli R(D)

I=H(X)−H(X∣X^)≥h2(p)−H(X⊕X^)≥h2(p)−h2(D)I = H(X) - H(X\mid\hat X)\ge h_2(p) - H(X\oplus\hat X)\ge h_2(p) - h_2(D). This is achieved by a backward BSC(D). ∎

Properties

R(D)R(D) is non-increasing and convex in DD (convexity of MI in the channel). Its slope is −β-\beta, the Lagrange multiplier in Blahut–Arimoto.

Exercise 3.1: water-filling with variances (4, 1, 0.25) at θ = 1

Di=(1,1,0.25)D_i = (1, 1, 0.25), so D=2.25D = 2.25. The rates are R=12log⁡24+0+0=1R = \frac12\log_24 + 0 + 0 = 1 bit.

📝 Quick check (Level 3)
0/3 answered
  1. 1. The Gaussian converse uses…
  2. 2. R(D) as a function of D is…
  3. 3. Water-filling (4, 1, 0.25) at θ = 1: total rate =

Level 4: Expert

★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.

Onboard compression: quantizers and band allocation

Imaging spectrometers produce many bands of very different variance. Rate–distortion theory says to decorrelate (PCA/KLT across bands, which CCSDS 122 and 123 approximate with wavelets and prediction), then allocate bits by reverse water-filling. The exercise measures how far practical scalar quantizers sit from D(R)D(R). Lloyd–Max is 1.46× at 1 bit and worse at higher rates. Uniform quantization with entropy coding sits a steady 1.53 dB above. Water-filling saves about a third of the bits compared with an equal per-band rate.

🐍 Exercise 2 (research): quantizers vs R(D) and spectral bit allocation
Run Lloyd–Max at 1–3 bits and an entropy-coded uniform quantizer on Gaussian samples, and compare each with D(R). Then allocate bits across five spectral bands by reverse water-filling and compare with equal rates.

Rate–distortion in AI, robotics and aerospace

  • Learned image compression: an encoder, a quantized latent and an entropy model trained on R+λDR + \lambda D (Ballé, Laparra and Simoncelli, 2017). This is a variational rate–distortion optimization.
  • β-VAE: the ELBO’s KL term is a rate and the reconstruction term a distortion. β traces the R–D curve (Higgins et al., 2017; Alemi et al., 2018).
  • Communication-limited robotics: how coarsely to quantize maps, poses or features for multi-robot SLAM over bandwidth-limited links.
  • Rate–distortion–perception: a third axis for realism in generative codecs (Blau and Michaeli, 2019).

References

  1. C. Shannon (1959). “Coding theorems for a discrete source with a fidelity criterion.” IRE National Convention Record, 7(4).
  2. T. Berger (1971). Rate Distortion Theory: A Mathematical Basis for Data Compression. Prentice Hall.
  3. T. Cover, J. Thomas (2006). Elements of Information Theory, 2nd ed. Wiley. Ch. 10.
  4. R. Blahut (1972). “Computation of channel capacity and rate-distortion functions.” IEEE Transactions on Information Theory, 18(4).
  5. S. Lloyd (1982). “Least squares quantization in PCM.” IEEE Transactions on Information Theory, 28(2).
  6. R. Gray, D. Neuhoff (1998). “Quantization.” IEEE Transactions on Information Theory, 44(6).
  7. J. Ballé, V. Laparra, E. Simoncelli (2017). “End-to-end optimized image compression.” ICLR.
  8. A. Alemi et al. (2018). “Fixing a broken ELBO.” ICML.
  9. Y. Blau, T. Michaeli (2019). “Rethinking lossy compression: the rate-distortion-perception tradeoff.” ICML.
  10. CCSDS (2017). Image Data Compression, CCSDS 122.0-B-2. Blue Book.