Contents / Information Theory / Rate–Distortion Theory
Chapter 10
Rate–Distortion Theory
The best rate achievable at a given distortion, computed in closed form where it can be and numerically where it cannot.
Introduction
The best rate achievable at a given distortion, computed in closed form where it can be and numerically where it cannot.
10.1The Lossy Compression Problem
Fix a source alphabet and a reproduction alphabet . The two need not be the same set, and it is worth keeping them notationally distinct: a 16-bit audio sample lives in a set of size , while its reproduction may be one of levels, or one of a continuum.
Definition 10.1 (Distortion measure). A distortion measure is a map
It is bounded if . The distortion between sequences is the single-letter (per-symbol average) extension
Two measures do almost all the work in practice and in this chapter. Hamming distortion on a common finite alphabet, , makes the symbol error probability. Squared-error distortion on , , makes the mean squared error. Squared error is unbounded, which costs some technical work in the proofs but changes none of the answers.
Notation (Blocks, codes, rates). An rate–distortion code consists of an encoder
and a decoder . Its rate is bits per source symbol, and its distortion is
the expectation taken over the source. The set of reproduction sequences is the codebook; the encoder chooses a codeword, the decoder is merely a lookup table.
Definition 10.2 (Operational rate–distortion function). A pair is achievable if there is a sequence of codes with
The operational rate–distortion function is the infimum of all rates such that is achievable.
Everything in this chapter is an attempt to replace that infimum-over-codes, which you cannot compute, with a formula in the source distribution, which you can.
Intuition. If you insist on a perfect reproduction you must pay the full price of the source's randomness. If you allow the reconstructed picture to look a little blurry, you can describe it with far fewer bits — and is the exact exchange rate between blur and bits.
The curve is the boundary of the achievable region: everything above and to the right of it can be done, everything below and to the left cannot, no matter how clever the codec.
Two endpoints of the curve are forced by the definitions, and it is worth naming them before doing any work.
Definition 10.3 (Minimum and maximum distortion).
is the distortion of a decoder that is told exactly; is the distortion of the best decoder that is told nothing.
The order of the minimum and the expectation is the whole content of that definition. For Hamming distortion and , the error probability of always guessing the most likely symbol. For squared error with , and , attained by the constant reproduction .
Example 10.4 (Reading the two endpoints off a source). Let take values in with probabilities under Hamming distortion, and let under squared error. Find and for each.
Solution. For : every symbol has a perfect reproduction available, so for each and . For the other endpoint, a rate- decoder must output a fixed symbol; outputting errs with probability , outputting with probability , outputting with probability . Hence .
For : again . A constant reproduction has , minimized at , so .
Sanity check: in both cases is the distortion at rate and the distortion at infinite rate, so the interesting part of the curve lives on and respectively. Outside that interval is either undefined (below ) or identically zero (above ).□
Pitfall. is not the largest value the distortion measure can take. For squared error on a Gaussian source the distortion of a bad reproduction is unbounded, yet , because is defined by the best zero-rate reproduction, not the worst one.
10.2The Information Rate–Distortion Function
The operational definition quantifies over all codes of all block lengths. The informational one quantifies over a compact set of conditional distributions on a single symbol, and is the object we can actually compute with.
Definition 10.5 (Information rate–distortion function). For a source and distortion measure , the information rate–distortion function is
the minimum taken over all conditional distributions — test channels — for which the joint law meets the distortion budget. The feasible set is empty, and , when .
Notation (Test channel). The conditional law is called a test channel because it is formally a channel from to . It is not a physical channel and nothing is transmitted through it: it is a bookkeeping device that encodes a proposed statistical relationship between source and reproduction, and scores that relationship.
Writing " " rather than " " needs a word of justification on a finite alphabet.
Proposition 10.6 (The minimum is attained). If and are finite and , the minimum defining is attained by some test channel.
Proof. The set of conditional distributions is a product of probability simplices, hence a compact subset of . The expected distortion is a linear, hence continuous, function of , so the feasible set is a closed subset of a compact set, hence compact; it is nonempty because lets each put all its mass on an achieving . Finally is continuous in for fixed , with the convention . A continuous function on a nonempty compact set attains its minimum.∎
For continuous alphabets the minimum may only be an infimum, and the mutual information is the general measure-theoretic one; every formula below survives, and in the Gaussian case the infimum is attained.
Intuition. asks: how little can the reproduction know about the source, while still resembling it?
Mutual information is the right currency because it is exactly the number of bits a description must carry — this is what the rate–distortion theorem will make precise. So we choose the statistical relationship between and first, and only afterwards worry about codes that realize it.
Example 10.7 (A binary source, computed from the backward channel). Let on with Hamming distortion. Compute for .
Solution. Lower bound. For any test channel with ,
where the first inequality is "conditioning reduces entropy" and the second uses together with the fact that is increasing on . Here .
Upper bound. Specify the backward channel instead: let and with independent of . Then is indeed as required, , and . This exhibits a feasible test channel meeting the lower bound.
Hence for , and for .
Sanity check: at we get bit, the entropy of a fair bit; at we get , and indeed a decoder that flips its own coin agrees with half the time for free.□
Remark. The manoeuvre in that solution — specify the backward channel , not the forward one — is the standard trick for producing optimal test channels, and it recurs for the Gaussian source below. It works because the lower bound is naturally written in terms of , so the backward description makes the bound tight by construction. The one thing that must then be checked is consistency: the backward channel together with the chosen marginal on must reproduce the given source law .
10.3Properties of the Rate–Distortion Function
Before computing for particular sources it pays to establish its shape, because those properties are what make the converse proof work and what justify the numerical algorithms.
Lemma 10.8 (Mutual information is convex in the test channel). For a fixed source distribution , the map is convex.
Proof. Write the mutual information as a minimum of a conditional relative entropy:
the minimum over all distributions on . The identity holds because , with equality exactly at . Now is jointly convex in its two arguments, since relative entropy is jointly convex in its pair of arguments and a nonnegative weighted sum of jointly convex functions is jointly convex. Partial minimization of a jointly convex function over one argument leaves a convex function of the other.∎
Theorem 10.9 (Shape of the rate–distortion curve). On the function is
- non-negative and non-increasing;
- convex;
- continuous on , and strictly decreasing wherever it is positive;
- equal to for every , and strictly positive for .
Proof. (1) Mutual information is non-negative, and enlarging enlarges the feasible set, so the minimum cannot increase.
(2) Let and be test channels attaining and , and let for . Expected distortion is linear in the test channel, so has distortion and is feasible for that budget. By the previous lemma,
and the right-hand side is .
(3) A finite convex function on an interval is continuous on its interior. For strict decrease, suppose with . Convexity plus monotonicity would force to be constant at on all of , contradicting , which is part (4).
(4) If , take to be the constant attaining ; it is feasible and independent of , so . Conversely forces independent of , and then ; so a distortion strictly below forces a strictly positive rate.∎
Property (2) is the workhorse. It is what lets the converse proof push a per-symbol average through Jensen's inequality, and it is why the parametric sweep of the next part traces the whole curve rather than only part of it.
Now the endpoint at , which is where the classical link to lossless coding lives — and where a widely repeated statement needs care.
Proposition 10.10 (The value at zero distortion). Suppose is discrete and satisfies if and only if . Then and
If instead is a continuous random variable under squared-error distortion with , then as ; in particular is not the differential entropy , and is not finite at all.
Proof. Discrete case. Feasibility at forces , and since with equality only on the diagonal, . Then and . Every feasible channel gives the same value, so the minimum is .
Continuous case. By the Shannon lower bound proved later in this chapter, for squared-error distortion. As the subtracted term tends to , so the bound tends to .∎
Pitfall. The slogan " " is a theorem about discrete sources only, and even there it needs to vanish only on the diagonal. Replacing by the differential entropy for a continuous source is simply false: is finite and may be negative — a with has — whereas the rate needed to describe a real number exactly is infinite. What is true for a continuous source is the high-rate statement , in which the differential entropy appears only as an additive offset alongside a term that blows up.
Corollary 10.11 (Lossless coding is the corner). For a discrete memoryless source with a distortion measure vanishing only on the diagonal, the rate–distortion theorem at reduces to the source coding theorem: the minimum rate for asymptotically error-free description is .
Example 10.12 (A three-point source: endpoints and one interior value). Let with under Hamming distortion. Give and , and produce a feasible rate at .
Solution. bits.
, attained by always reproducing .
At , take the deterministic test channel , , . Its distortion is , so it is feasible, and is then binary with . Since is a deterministic function of , bits.
So . Sanity check: this sits strictly between (the value at ) and (the value at ), as monotonicity demands. It is only an upper bound — a randomized test channel does better, and the exact value must be found numerically by the Blahut–Arimoto algorithm of the next part.□
10.4The Bernoulli and Gaussian Rate–Distortion Functions
Two sources admit clean closed forms, and between them they carry most of the intuition in the subject.
Theorem 10.13 (Bernoulli source under Hamming distortion). Let with , and let be Hamming distortion on . Then
Proof. Converse (lower bound). Let be any test channel with , and put , so . Then
using — given , knowing and knowing are the same knowledge — then conditioning reduces entropy, then monotonicity of on with .
Achievability (upper bound). Specify the backward channel. Let with
and let with independent of . Consistency: , as required. Feasibility: . Value: .
The flat part. For the constant reproduction has distortion and ; and , so by the shape theorem exactly on .∎
Pitfall. The formula is wrong for : it goes negative — take , , giving — which is impossible for a mutual information. The restriction is part of the theorem, not a technicality, and the curve is identically zero beyond it.
Example 10.14 (Bernoulli numbers). For under Hamming distortion, compute and express it as a fraction of the lossless rate.
Solution. bits.
bits.
bits per symbol.
That is of the lossless rate: tolerating a symbol error rate has cut the bit budget by nearly two thirds.
Sanity check: , so the formula applies, and is positive but well under , as it must be for .□
Theorem 10.15 (Gaussian source under squared-error distortion). Let and . Then
Proof. Converse. For any with ,
because differential entropy is translation invariant given , and conditioning reduces it. Among all random variables with second moment at most the Gaussian maximizes differential entropy, so . Hence .
Achievability. Backward channel again: let and with independent. Then as required, , and .
The flat part. , attained by , so for .∎
Remark. Note which direction the noise runs. The backward channel is : the source equals the reproduction plus independent noise. The forward channel implied by it is not "add noise to "; it is for a suitable independent , a shrunken and noisy copy. The shrinkage factor is the MMSE regression coefficient, and it is exactly why a good decoder does not simply invert the quantizer but pulls its output toward the mean.
Intuition. says that every halving of the allowed mean squared error costs exactly half a bit per sample — equivalently, every extra bit per sample buys a factor of in MSE, the familiar dB per bit.
The formula also says the only thing about a Gaussian source that matters is its variance relative to the distortion budget. Scaling the source and the budget together changes nothing.
Example 10.16 (Gaussian numbers and the reconstruction rule). Let and . Find and the variance of the optimal .
Solution. Rate: bits per sample.
Optimal reproduction: , with and independent of .
Check by mutual information: bits, matching.
If the decoder instead holds a noisy observation with and , the MMSE reconstruction is .
Sanity check: , and , so the construction is legitimate. Had we asked for the "variance" would be negative — the signal that we are past and the answer is .□
Theorem 10.17 (The Gaussian source is the hardest one of its variance). Let have zero mean and variance , and let be squared error. Then for ,
with equality if and only if is Gaussian.
Proof. Put and define the forward test channel with independent of . Its distortion is
so it is feasible. Its mutual information is
using the Gaussian maximum-entropy bound on , whose variance is . The right side equals . Since is a minimum over all feasible channels, is at most this. Equality in the maximum-entropy step requires Gaussian, which for independent Gaussian forces Gaussian.∎
Remark. This is a design fact and not merely an aesthetic one: if you know only the variance of your source, budgeting bits per sample is always enough. Any departure from Gaussianity — sparsity, skew, heavy tails — is free compression waiting to be collected.
10.5The Rate–Distortion Theorem
The last part computed , an optimization over one-symbol conditional distributions. Nothing so far says that this number has anything to do with codes. That identification is the rate–distortion theorem, and it is the reason the whole subject is called rate–distortion theory rather than "constrained mutual information minimization".
Theorem 10.19 (Rate–distortion theorem). For a discrete memoryless source with a bounded distortion measure ,
That is, the infimum of rates achievable by block codes of any length equals the single-letter minimum over test channels meeting the budget. From here on we write for the common value.
The two halves of the theorem are proved by entirely different arguments. The converse, , says no code can beat the formula; it is short, exact, and uses only the properties established above. The achievability, , says a code exists; it is a random-coding argument.
Proof. (Converse.) Fix any code with distortion , where . Let , a random variable on values. Then
the last step by the data-processing inequality, since is a function of . Expand:
using independence of the for the first sum, the chain rule for the second, and "conditioning reduces entropy" for the inequality. So . Let . Each pair is a legitimate one-symbol test channel with distortion , so . Therefore
where the middle step is Jensen's inequality applied to the convex function , and the last is monotonicity together with . Taking the infimum over codes gives .∎
Remark. Look at what the converse did not use. It never assumed the encoder was deterministic, never assumed it looked at the whole block, and never assumed anything about the structure of the codebook. It used exactly three facts: the source is memoryless, is convex and non-increasing, and is a function of the message. This robustness is what lets the same argument be recycled almost verbatim for side-information problems later in the chapter.
Proof. (Achievability, sketch.) Fix a test channel with , and let be the induced output marginal. Generate codewords independently, each drawn i.i.d. from , and reveal the codebook to both encoder and decoder. The encoder, seeing , sends the index of any codeword jointly typical with under , and sends if none exists.
The whole argument turns on one counting question: how many independently drawn codewords are needed before one of them is jointly typical with a given ? For a fixed typical the probability that a single randomly drawn is jointly typical with it is approximately , because joint typicality confines the pair to about sequences out of the that independent drawing spreads over. With independent attempts, the probability that all fail is about
which tends to when and to when . This is the covering lemma, and it is the exact mirror image of the packing argument in channel coding: there one needs codewords far enough apart that noise cannot confuse them, here one needs them dense enough that every source sequence has a neighbour.
When the encoder succeeds, joint typicality forces the empirical distortion to be close to ; when it fails, the distortion is at most , an event of vanishing probability, so it contributes to the average. Hence for every the expected distortion of the random codebook is at most for large , and some particular codebook is at least as good as the average. Minimizing over feasible test channels gives .
The steps sketched above — the typical-set probability estimate, the concentration of the empirical distortion, and the handling of the failure event — are where the technical work lies; they are standard and are carried out in full in Cover and Thomas, Chapter 10. Boundedness of is used only to control the failure event, and can be relaxed to a finite-moment condition, which is what makes the squared-error Gaussian case legitimate.∎
Pitfall. The theorem is an asymptotic statement. At block length there is a penalty of order (the dispersion term), and — more importantly in practice — finding the jointly typical codeword requires searching a codebook of size . The theorem proves existence, not tractability; the rest of the chapter is about what one does instead.
Corollary 10.20 (Source coding theorem). For a discrete memoryless source with vanishing only on the diagonal, .
Proof. Combine the rate–distortion theorem at with the earlier proposition computing .∎
Intuition. Think of the codebook as a set of "representative sequences" scattered in the space of all source sequences. The typical set has about members, and each codeword "covers" about of them. To cover everything you need at least codewords.
Rate–distortion coding is a covering problem; channel coding is a packing problem. That duality is not a metaphor — it is why the same binning construction solves the distributed problems at the end of this chapter.
10.6The Lagrangian Formulation and Blahut–Arimoto
Outside the two closed forms of the previous part, must be computed numerically. Minimizing subject to a distortion constraint is a convex program, and the clean way to attack it is to dualize the constraint.
Definition 10.21 (Lagrangian rate–distortion functional). For a multiplier define
the minimum now unconstrained over all test channels. Writing for a minimizer and , the pair is a point on the curve .
Proposition 10.22 (The multiplier is the slope). is concave and non-decreasing on , , and wherever is differentiable,
Consequently the slope parameter is non-positive, and sweeping from to — equivalently from to — traces the whole curve from down to the left endpoint.
Proof. is a pointwise minimum of functions affine in , hence concave; each such affine function has non-negative slope , so is non-decreasing. Because the program defining is convex with a linear constraint and a strictly feasible point whenever , Slater's condition holds and strong duality gives ; the maximizing is precisely a negated subgradient of at . Evaluating the outer maximum at gives , and by the envelope theorem .∎
Pitfall. Sign conventions here are a classic source of error. The multiplier is non-negative and multiplies with a plus sign; the slope is non-positive. Writing the functional as with would reward large distortion and minimize the wrong thing. If a derivation produces test channel weights — putting more mass on worse reproductions — the sign has been flipped somewhere.
Stationarity of the Lagrangian gives the form of the optimal test channel, and that form is the whole algorithm.
Proposition 10.23 (Form of the optimal test channel). A test channel minimizes if and only if, with its own output marginal,
Proof. Write , which by the identity used in the convexity lemma satisfies , the minimum at . is jointly convex, so the joint minimum is characterized by stationarity in each argument. Minimizing over for fixed with a multiplier for the normalization gives, for each ,
so ; normalizing gives the displayed formula. Minimizing over for fixed gives . A point satisfying both conditions simultaneously is exactly the stated fixed point.∎
Method 10.24 (Blahut–Arimoto algorithm). Fix and an initial distribution with full support. For :
- Channel update. for every .
- Marginal update. .
- Stop when the two successive values of differ by less than the tolerance.
Then report the point and . Sweeping over a grid traces the curve.
Theorem 10.25 (Convergence of Blahut–Arimoto). Each iteration does not increase , and ; the iterates converge to a minimizing pair. Moreover the value is approached monotonically, so the algorithm supplies its own upper bound at every step.
Proof. Each of the two updates is an exact minimization of over one argument with the other held fixed, by the two stationarity computations in the previous proposition. So , a non-increasing sequence bounded below by , hence convergent. That the limit is the global minimum rather than a stalled coordinate point follows from joint convexity of together with the fact that is differentiable with full-support iterates: a point that is a minimum in each coordinate of a jointly convex differentiable function is a global minimum. The detailed argument, including the rate of convergence and the extension to unbounded alphabets, is due to Blahut and to Arimoto and is not reproduced here.∎
Intuition. Instead of fixing the distortion budget and minimizing rate, put a price on distortion and minimize rate-plus-cost. The optimal test channel then looks like a Boltzmann distribution: reproduction gets weight proportional to how popular it is overall, , discounted by for how badly it serves this particular .
Sweeping the price from "distortion is free" (, so at ) to "distortion is unaffordable" () draws the whole frontier. And because each iteration is an exact minimization of a jointly convex function, the algorithm cannot get stuck.
Example 10.26 (The slope parameter for a Gaussian source). For under squared error, find the slope at distortion , and the corresponding multiplier.
Solution. , so
At the slope is , finite, and as the slope steepens without bound.
Sanity check: the slope is negative and its magnitude increases as decreases, exactly as convexity of demands. Note also that this is the price at which one more unit of MSE is worth exactly the bits it saves — which is why reappears as the Lagrange multiplier in every practical codec's rate-control loop, where the encoder minimizes over coding modes.□
10.7Bounds, and Parallel Gaussian Sources
Closed forms are rare. What is available for a general source is a pair of bounds that pin between them, plus an exact answer for the one structured case that matters most in practice: a collection of independent Gaussians of different variances, which is what a transform coder produces.
Theorem 10.27 (Shannon lower bound). Let be a continuous source on with , and let be a difference distortion measure, . Then
In particular, for squared error ,
Proof. For any feasible ,
using translation invariance of differential entropy under a shift by the conditioning variable, then "conditioning reduces differential entropy". The variable satisfies , so is at most the stated maximum. For squared error the maximum-entropy distribution with second moment is , of differential entropy .∎
Remark. The Shannon lower bound is tight in the limit of small : for squared error, as for sources with well-behaved densities. It is not tight at large — indeed it goes negative there while is — so it should always be read as . Combined with the earlier theorem that the Gaussian is the worst source of its variance, it brackets for any source:
and the width of that bracket is , the non-Gaussianity of the source, measured in bits. For a Gaussian source it is zero and the bracket collapses to the exact answer.
Example 10.28 (How much is non-Gaussianity worth?). A zero-mean Laplacian source has density , variance and differential entropy bits. How many bits per sample does its non-Gaussianity save at high rate?
Solution. The bracket width is . With ,
The difference is bits per sample.
Sanity check: the number is positive, as it must be — the Gaussian maximizes entropy for a given variance — and it is small, which says a Laplacian is nearly as hard to code as a Gaussian of the same variance. Sparse sources do far better: the saving grows without bound as the density concentrates.□
Theorem 10.29 (Reverse water-filling for parallel Gaussian sources). Let be independent with , and take the total squared-error distortion . Then
where the water level is chosen so that . Components with receive no bits at all and are reproduced by their mean.
Proof. Converse. For any feasible joint test channel, independence of the components gives
with and , by the scalar Gaussian theorem applied componentwise. It remains to minimize over with . The objective is convex and separable; a Lagrange multiplier for the budget gives the stationarity condition , i.e. , for every component whose constraint is inactive; components hitting that ceiling take and contribute zero rate. Together these are exactly .
Achievability. Code the components separately, using an optimal scalar-Gaussian rate–distortion code at distortion for component . The rates add and the distortions add, so the bound is met.∎
Intuition. Ordinary water-filling in channel coding pours power into the strongest sub-channels. Reverse water-filling pours distortion into the weakest components: pick a level ; every component with variance above the level is coded down to exactly distortion , and every component already quieter than the level is thrown away entirely and replaced by zero.
Two consequences matter in practice. Components are not given equal bit budgets — they are given equal residual distortion. And below the water level the optimal bit allocation is zero, which is the theoretical justification for the zero-runs that dominate a JPEG or AAC bitstream.
Example 10.30 (Reverse water-filling, worked). Four independent Gaussian components have variances and the total distortion budget is . Find the water level, the per-component distortions, and the total rate.
Solution. Try a water level below every variance. Then gives , which exceeds — inconsistent, because component would then lie below the level. So component is discarded: , and the remaining three share , giving . Check: and . Consistent.
Distortions: , summing to . ✓
Rates: ; ; ; .
Total bits for the block of four, i.e. bits per component.
Sanity check: the loudest component gets the most bits and the quietest gets none; every coded component is left with exactly the same residual distortion ; and the total distortion exhausts the budget.□
Corollary 10.32 (Gaussian vector source). For in with total squared-error distortion, is given by reverse water-filling over the eigenvalues of .
Proof. Let with orthogonal. The map is an orthogonal change of coordinates: it preserves mutual information (being invertible) and preserves squared-error distortion (being an isometry). In the new coordinates the components are independent Gaussians with variances the eigenvalues , and the previous theorem applies.∎
Remark. This corollary is the theoretical charter of transform coding. The Karhunen–Loève transform — the eigenbasis of — turns a correlated vector source into independent components, after which the optimal thing to do is reverse water-filling. Real codecs replace the KLT by a fixed, signal-independent approximation such as the DCT, which is close to the KLT for the near-Markov statistics of natural images and costs instead of .
10.8Blahut–Arimoto in Practice: R(D) for a Binary Source
The algorithm itself was stated in the previous part, as the recipe Blahut–Arimoto algorithm: alternate the channel update with the marginal update . This part runs it.
Notation (The two ways the multiplier is written). Much of the literature writes the channel update as with , rather than with and . These are the same update under , which is the identification already made in the proposition the multiplier is the slope: is the price paid per unit of distortion in the objective , and is the slope of the curve at the converged point.
This chapter minimizes with and , and reports the converged operating point by its slope . A run "at " and a run "at " are the same run.
Intuition. Start with a guess at what the reproductions look like on average, .
Update the best way to map originals to reproductions given that guess, then update the guess to match what the mapping actually produces. Repeat.
The arithmetic is just re-normalizing exponentials of the distortion, down-weighted by : it is a soft version of "assign each source symbol to its closest reproduction", with controlling how soft.
Example 10.33 (Blahut–Arimoto against a known closed form). Binary source with and Hamming distortion . Target and check what the algorithm converges to against the closed form , valid for . Logs base 2.
Solution. Closed-form target. and , so bits.
What the iteration converges to. For this source the optimal test channel is a BSC with crossover : it flips the symbol with probability . Updating and then re-inducing drives the effective crossover to for the at which .
Reading off the rate. At the fixed point evaluated at that test channel equals bits, matching the closed form.
Checking the slope. The multiplier at convergence must satisfy . Here , so the run converges at and reports slope — negative, as a rate–distortion trade-off requires.
Sanity check: at the formula gives , and indeed zero rate is achievable by always outputting , incurring distortion exactly . ✓□
Example 10.34 (One channel update by hand). Run a single channel update for that source from at , and give .
Solution. The unnormalized weights for are and . The normalizer is , so
Sanity check: the matching reproduction is favoured, by the factor that separates a mismatch from a match — and as this tends to the hard assignment .□
10.9The Dual Problem: Alternating Minimisation for Channel Capacity
Rate–distortion coding is a covering problem and channel coding is a packing problem, and the two optimizations are duals of each other: one minimizes mutual information over test channels at a fixed source, the other maximizes mutual information over input distributions at a fixed channel. The alternating-minimisation machinery of the previous part does not care which. Arimoto published the capacity iteration and Blahut the rate–distortion one in the same year, and they are the same algorithm; seeing the capacity version is what makes clear that nothing in it was special to distortion. That is why it earns a section here, in a chapter otherwise about .
For capacity of a DMC with fixed forward channel , the iteration alternates two closed-form steps. Given the current input distribution :
- Compute the induced output .
- Update the input by reweighting each symbol by how "informative" it is, measured by the KL divergence between its output row and the average output: where is exactly , the mutual information contributed by input symbol .
Symbols whose output row stands out from the average (large divergence) get boosted; symbols that look like the crowd get suppressed. The normalization keeps a valid pmf. Note the sign: here the exponent is , because this problem is a maximization — the mirror image of the that down-weights bad reproductions in the iteration.
Proposition 10.35 (Fixed point of the capacity iteration). At the fixed point the KKT conditions hold: every symbol with has the same value , and every unused symbol has .
Inputs with lower are therefore driven to probability zero — the iteration prunes the alphabet as it goes. This is the exact counterpart of the stationarity condition for the optimal test channel: in both problems the fixed point is characterized by every active coordinate carrying the same marginal value.
Intuition. Guess a distribution on what you send.
Compute what comes out, and how much information each possible input explains about the output.
Reweight your guess toward the inputs that carried more information. Repeat until the distribution stabilizes on the best inputs.
Example 10.36 (The Z-channel). Input is always received as ; input is flipped to with probability and received correctly with probability . So , , . Logs base 2. Write ; find the capacity and verify the fixed point.
Solution. Induced output. and . Conditional output entropy: , since only injects noise and .
Mutual information. .
Optimize — what the iteration converges to. Setting gives the closed form . Note : the asymmetry pushes the optimal input off uniform, and the iteration discovers this automatically.
Capacity. With : , so bits.
Verify the KKT fixed point. At , each supported input must satisfy . For : . For : . Both equal . ✓ This equality is exactly the fixed-point condition that stops the iteration.
Sanity check: the uniform input gives bits, short of by bits — the gap the iteration closes by moving mass toward .□
10.10Convergence, Numerics, and Practical Use
That both iterations converge to the global optimum is the content of the theorem convergence of Blahut–Arimoto: each step is an exact minimization of a jointly convex function over one argument, so the objective is non-increasing and cannot stall anywhere but the optimum. Nothing further needs to be proved here. What remains is the practical side — when to stop, and how to keep the arithmetic from overflowing.
Stopping. Stop when the change in (or in ), or in the distributions themselves, falls below a tolerance. Because the objective is approached monotonically, the current value is always a valid upper bound on , so the iterate in hand is never worse than it looks.
Numerical hygiene. Compute in the log domain and subtract the row maximum before exponentiating — a log-sum-exp. With large and large distortions the raw exponentials underflow to zero and the row normalization becomes .
Beyond the basic iteration. Modern variants use accelerated methods, stochastic approximations for very large alphabets, or discretize a continuous source and combine the iteration with neural networks; the alternating "posterior then marginal" structure reappears in variational autoencoders and in learned image and video compression. The same alternating-minimisation idea also underlies the EM algorithm and expectation propagation.
Intuition. Because the problem is bowl-shaped, no matter where you start the iteration rolls downhill to the same bottom.
In code you keep updating two arrays — the conditional and the marginal — until they stop changing much; the final mutual information is your answer.
Example 10.37 (What does one point of the curve cost?). Estimate the cost of computing for a -ary source (say an 8-bit image pixel histogram) with reproduction levels and a chosen distortion matrix.
Solution. Cost per iteration. Each iteration makes two passes over the conditional array: one to update with a row normalization, one to re-induce . That is multiply-adds per iteration, touching array entries — microseconds on a laptop.
Iteration count. Convergence is linear; for small-to-moderate alphabets, driving the change below bits typically takes tens to a few hundred iterations. Say here.
Total work. operations for one point on the curve — a fraction of a second. Sweeping values of to trace the whole curve costs operations, still well under a minute.
Sanity check: verify against at each converged point by finite-differencing neighbouring pairs. Agreement confirms the iteration reached a genuine stationary point rather than stopping early. ✓□
- Getting the Lagrangian sign backwards. Minimize with ; the slope of the curve is . Optimal test channel weights carry , never — that would put more mass on worse reproductions. Writing the objective itself as with minimizes the wrong thing.
- Losing track of which of and is being quoted. They differ only in sign, but a run reported "at " and one reported "at " are the same run, and mixing the two inside one derivation is the commonest arithmetic slip in the subject.
- Forgetting to normalize the test-channel updates. The proportionality must become a true conditional pmf for each ; a missing normalization silently ruins the computed .
- Running the algorithm at a fixed instead of sweeping the multiplier. Direct fixed- variants exist, but the Lagrangian form is numerically more stable and traces the whole curve as a by-product.
- Ignoring that at the solution. After convergence the slope can be read off the final multiplier and checked against a finite difference of neighbouring points — the cheapest available test that the iteration actually converged.
- Exponentiating outside the log domain. With the weights underflow to zero; subtract the row maximum first.
- Assuming convergence from any initialization without checking. Convexity guarantees it for the exact iteration, but floating-point and approximate versions on large problems can still need several starts. Initializing with full support is not optional: a reproduction symbol given zero mass can never regain it.
- Confusing the algorithm with code construction. It gives the information-theoretic limit or ; it does not produce encoder and decoder codebooks, though it can guide quantizer design.
- Using it on continuous alphabets without discretization. The iteration is for finite alphabets; continuous problems need discretization, kernel methods, or parametric assumptions.
- Reading the achievability proof as an algorithm. It proves a good codebook exists by averaging over random codebooks; it offers no way to find one, and the encoding step it describes is a search over codewords.
- Confusing with the distortion–rate function . They are inverse functions of each other on the range where is strictly decreasing: is the least rate for a distortion budget, the least distortion for a rate budget. Quoting one where the other is meant inverts every inequality.
- Asserting for every source. It holds for discrete sources with a distortion measure vanishing only on the diagonal. For a continuous source as , and substituting the differential entropy for is wrong — can even be negative.
- Using outside . Past the true value is ; the formula goes negative and is meaningless there.
- Forgetting that depends on the distortion measure as much as on the source. Swapping squared error for absolute error or a perceptual metric changes the function entirely; a rate–distortion claim with no attached is not a claim.
- Treating the test channel as a physical channel. scores a proposed source–reproduction relationship; nothing is transmitted through it and it need not be implementable.
- Assuming the optimal reproduction alphabet equals the source alphabet. For a discrete source the optimal can be strictly smaller, and for a continuous source it is a finite set at each finite rate.
- Using the Shannon lower bound without clipping it at zero. For near or above the expression is negative, while . The bound is .
- Applying the high-rate approximation at low rate. It is an asymptotic statement as ; at moderate it can be badly off, and above it is simply wrong.
- Forward water-filling instead of reverse. Channel coding allocates power preferentially to strong sub-channels; rate–distortion allocates distortion equally down to a level and abandons everything below it. The two pictures are not the same, and confusing them inverts the bit allocation.
- Assuming a component below the water level should get "a few" bits. The optimum gives it exactly zero and reproduces it by its mean; spending bits there provably wastes them.
- Treating as a per-block quantity. It is bits per source symbol; a block of symbols needs about bits, and the correction is what finite-blocklength analysis quantifies.