Distributional Bellman Operators
Wasserstein contraction for evaluation, its failure for control, and Cramér projections.
The distributional evaluation operator contracts, but only in the right metric: Wasserstein and Cramér yes, total variation and KL no. The control operator contracts in no metric at all, can lack a fixed point, and its iterates need not settle, although their means behave perfectly. Bellman closedness says which statistics dynamic programming can learn exactly, and the answer is essentially only moments. And why learning a distribution helps an agent that acts on its mean is still debated. This lesson proves the first three facts and lays out the evidence on the fourth.
What you’ll learn
- Prove that the distributional evaluation operator is a -contraction for any translation-invariant, -homogeneous, -convex probability metric, apply it to the Wasserstein and Cramér distances, and show why total variation, KL and the Kolmogorov distance fail.
- Construct an example in which the distributional control operator is not a contraction, and state what is known about convergence in control.
- Define Bellman closedness, prove that moments are Bellman closed, and state the theorem that among expectations of functions essentially only moments are.
- Weigh the theoretical and empirical evidence on why distributional RL helps, including expectation-equivalence in tabular and linear settings.
Which metric? Contraction from three properties
Let be a return distribution for each state–action pair. The evaluation operator replaces by the law of with : a mixture, over the possible , of copies of pushed through . For a probability metric , write . Whether contracts in depends on how treats shifts, scalings and mixtures, and nothing else.
Fix . Write both images as mixtures with the same weights (reward distributions with finitely many values for simplicity; integrals replace sums in general), where and pushes a distribution through :
By -convexity, then translation invariance and homogeneity for each component:
Take the -th root and the supremum over .
Wasserstein. is translation-invariant, homogeneous of order 1, and -convex (glue optimal couplings component by component), so is a -contraction in for every , and in by the same argument with a maximum over components: Bellemare, Dabney and Munos's (2017) Lemma 3. Iterating converges to , with all moments converging too. Cramér. Substituting in gives , so is homogeneous of order ; the CDF of a mixture is the mixture of CDFs, and the squared norm is convex, so is 2-convex. Hence a -contraction in , the rate behind categorical TD's convergence.
Where it fails. Total variation, KL divergence and the Kolmogorov distance are unchanged by rescaling: homogeneous of order , so the theorem gives nothing, and indeed nothing holds. Take a single absorbing state with reward 0, where maps to . Starting from and , after backups the two estimates are and : at total-variation and Kolmogorov distance 1 and infinite KL forever, though both converge to the true in Wasserstein distance, .
With , by what factor does one application of shrink the maximal Cramér distance, at worst?
Show the answer
0.9
The Cramér distance is homogeneous of order , so the modulus is , slower than the factor 0.81 in any Wasserstein distance. Squared distances shrink by itself, which is why bounds in this geometry are stated for .
Control: no contraction, possibly no fixed point
For control, Bellemare, Dabney and Munos (2017) call distributional Bellman optimality operator any in which is greedy with respect to the means of , ties broken by some rule. The means behave exactly as in ordinary value iteration; the distributions do not.
State moves to with reward 0. In , action ends the episode with reward 0, and ends it with reward (each with probability ), . The optimal distributions are and . Perturb one entry: let except .
Under , the means at are for and for , so the greedy choice flips to and the backup at propagates a point mass at 0, while :
A perturbation of size produces a change of size after one backup, so for the operator expands distances: it is not a contraction. Nor is it continuous. In the same MDP, compare two estimates that differ only at , one with and one with : they are apart for any small , yet their backups at , a point mass at 0 and , stay apart. The means are fine: in the first comparison they moved by , as Lemma 4 promises. What jumps is which whole distribution the greedy choice propagates.
In the example, the perturbed differs from by at a single state–action pair. What makes the effect after one backup so much larger?
- The reward at is random
- The discount amplifies small differences
- The Wasserstein distance overstates differences between point masses
- The greedy action at flips from to once the mean of drops below 0, so a whole different distribution is propagated to
Show the answer
D. The greedy action at flips from to once the mean of drops below 0, so a whole different distribution is propagated to
The backup at copies the distribution of whichever action is greedy at , and the greedy choice is a discontinuous function of the means. An arbitrarily small change near a tie swaps for a point mass at 0, which are -distance about 1 apart.
The same mechanism produces Prop. 2's missing fixed point. Set in the example, so both actions at have mean 0, and break the tie toward when is the point mass at 0 and toward otherwise: the iterates at alternate between the two actions' distributions forever. With function approximation, ties are rare but near-ties are common. Bellemare et al. link this instability to the policy chattering that Gordon (1995) described, and suggest that C51's gradient updates mitigate it by averaging the distributions they propagate. Distributional control works in practice because the means drive the policy, but it has no convergence guarantee of the kind evaluation enjoys.
What can dynamic programming learn exactly?
An agent stores finitely many numbers per state–action pair. When can it run dynamic programming on those numbers alone and get them exactly right? Rowland et al. (2019) make the question precise.
Let . Expand by the binomial theorem, where given the next return is independent of with moments :
The -th moment at needs only moments of order at most at the next pairs: the first moments are Bellman closed for every (Sobel, 1982; Lattimore & Hutter, 2012; Rowland et al., 2019, Lemma 4.2). For , combined with the equation for , this is the variance equation of Distributional RL:
Think first Show that the median is not Bellman closed. Hint: a state leads to one of two next states with probability ½ each, with reward 0 and ; keep the two next states' medians fixed and change the rest of their distributions.
Case A: is 0 or 5 with probabilities 0.6 and 0.4 (median 0); is 1 or 5, same probabilities (median 1). The mixture puts 0.3 on 0, 0.3 on 1 and 0.4 on 5, so its median is 1. Case B: replace the 5s by s. The next-state medians are still 0 and 1, but the mixture now puts 0.4 on , 0.3 on 0 and 0.3 on 1, so its median is 0. Same reward, same next-state medians, different medians at : no formula in the medians alone can exist.
So even tabular, exact distributional DP on categorical or quantile statistics generally does not recover the true statistics, only the fixed point of a projected operator: the course's lottery shows both biases (a categorical of 0.72 instead of 0.9, a 21-quantile mean of 1.852 instead of 1.9). The reassurance is approximate closedness: for categorical statistics with evenly spaced atoms spanning all possible returns, and for quantiles at the midpoint levels, Rowland et al. bound the error and show that it vanishes as grows (Thms. 4.6 and 4.7). Expectile methods sidestep the problem by imputation: back up samples from a distribution consistent with the statistics, not the statistics themselves.
Why does distributional RL help?
A distributional agent that acts on the mean optimizes the same objective as DQN. Where can its advantage come from? Lyle, Bellemare and Castro (2019) showed where it cannot come from. With tabular representations updated by mixing toward the projected target (categorical TD), and with representations linear in the CDF updated by semi-gradients of the CDF, a distributional agent and an expected-value agent given the same samples and matching initializations (plus mild conditions on the support) produce exactly the same mean estimates at every step: they are expectation-equivalent. Gradient steps taken on the probabilities rather than on the CDF break the equivalence even in the tabular case, and so can nonlinear parameterizations such as C51's softmax; the differences need not help.
| Evidence | What it shows |
|---|---|
| Expectation-equivalence (Lyle, Bellemare & Castro, 2019) | Tabular and linear-CDF distributional learning cannot improve the means; any benefit needs something else |
| Their experiments with Fourier-basis linear features on CartPole and Acrobot | The expected-value agent learned faster, and distributional agents suffered more when features were few |
| Their experiments with a small ReLU network | C51 learned faster than DQN (with the same final score), while S51, a linear-CDF agent, lagged and failed on Acrobot: gains appeared only with nonlinear approximation, and there only for C51 |
| Small-scale Rainbow replications (Obando-Ceron & Castro, 2021) | Added alone to DQN, distributional learning sometimes hurt |
| Classification losses (Farebrother et al., 2024) | A cross-entropy loss on a smoothed histogram of the scalar target, modelling no return distribution, beat C51 on 60 Atari games |
| Small-loss bounds (Wang, Zhou, Wu, Kallus & Sun, 2023) | Distributional confidence sets give regret and PAC bounds that shrink with the optimal achievable cost, in contextual bandits, low-rank MDPs and offline RL |
Three explanations compete, and they are not exclusive. Representation: predicting a whole distribution is a rich auxiliary task that shapes the features of a deep network, one view the C51 paper itself proposed, which the equivalence results support, since among updates of the CDF only nonlinear approximation breaks equivalence. Optimization: categorical cross-entropy is a better-behaved loss than squared error under noisy, moving targets, which the classification-loss results and the plasticity findings support. Statistics: learning the distribution can give provably faster rates when the best achievable cost is small, a theoretical advantage established so far for specific algorithms built on maximum-likelihood confidence sets rather than for C51-style agents.
Key takeaways
- contracts with modulus in any translation-invariant, -homogeneous, -convex probability metric: in every , in the Cramér distance; total variation, KL and Kolmogorov are scale-invariant, and does not contract in them.
- The distributional control operator is not a contraction, not even continuous, and may lack a fixed point; its means still converge to , and its iterates approach the set of nonstationary optimal value distributions.
- Moments are Bellman closed, and among expectations of functions essentially only moments are; categorical and quantile statistics are not, so even exact tabular DP learns biased statistics, with an error that vanishes as the number of atoms or quantiles grows.
- Tabular and linear-CDF distributional learning is expectation-equivalent to expected learning; the gains appear with nonlinear networks, and representation, optimization and statistical explanations compete.
Check yourself
In the interactive lesson these are scored with your confidence, and what you miss comes back for review.
Why is the distributional evaluation operator not a contraction in total variation?
- Total variation is not a metric on distributions
- Scaling two distributions by does not change their total variation distance, so two distinct point masses stay at distance 1 forever, even though both converge to the same limit
- Total variation is only defined for continuous distributions
- It is a contraction, but with modulus
Show the answer
B. Scaling two distributions by does not change their total variation distance, so two distinct point masses stay at distance 1 forever, even though both converge to the same limit
Contraction needs the metric to shrink when both distributions are compressed by ; total variation is invariant under any bijection of the line, rescaling included. In the absorbing-state example, and remain at distance 1 while converging to in Wasserstein distance.
Which statement about the distributional Bellman optimality operator is correct?
- It is a -contraction in the maximal Wasserstein metric, like the evaluation operator
- Its iterates' distributions always converge to the return distribution of an optimal policy
- Its iterates' means converge geometrically to , but the distributions need not converge, and the operator may have no fixed point
- It does not even get the means right
Show the answer
C. Its iterates' means converge geometrically to , but the distributions need not converge, and the operator may have no fixed point
Taking expectations commutes with the backup, so the means follow ordinary value iteration. The distribution that gets propagated depends on a greedy choice that is discontinuous in the distributions, which breaks contraction, existence of fixed points and convergence; only convergence to the set of nonstationary optimal value distributions survives.
Which of these sets of statistics is Bellman closed?
- The mean and the second moment
- The probabilities on a fixed grid of atoms, as learned by C51
- The quantiles at fixed levels, as learned by QR-DQN
- The median
Show the answer
A. The mean and the second moment
By the binomial expansion, the -th moment at depends only on the reward and on moments of order at most at the next pairs. By Rowland et al.'s theorem, among expectations of functions only moment families have this property, and categorical and quantile statistics do not.
A tabular categorical-TD agent (mixture updates toward the projected target) and a tabular expected-value TD agent receive the same samples, with the same step sizes, and start from matching estimates. What did Lyle, Bellemare and Castro (2019) show about their mean estimates?
- The distributional agent's means converge faster
- The distributional agent's means are biased
- They differ only by sampling noise
- They are exactly equal at every step, so any advantage of distributional RL must come from somewhere else, such as nonlinear function approximation
Show the answer
D. They are exactly equal at every step, so any advantage of distributional RL must come from somewhere else, such as nonlinear function approximation
Taking expectations of a tabular distributional update (or of a linear-CDF semi-gradient update) gives exactly the expected-value update, step by step. Their experiments then found the benefits only with nonlinear networks, which is why representation and optimization explanations dominate the debate.
Further reading
- M. G. Bellemare, W. Dabney & R. Munos, "A distributional perspective on reinforcement learning", ICML (2017).
- M. Rowland, M. G. Bellemare, W. Dabney, R. Munos & Y. W. Teh, "An analysis of categorical distributional reinforcement learning", AISTATS (2018).
- M. Rowland, R. Dadashi, S. Kumar, R. Munos, M. G. Bellemare & W. Dabney, "Statistics and samples in distributional reinforcement learning", ICML (2019).
- C. Lyle, M. G. Bellemare & P. S. Castro, "A comparative analysis of expected and distributional reinforcement learning", AAAI (2019).
- M. G. Bellemare, W. Dabney & M. Rowland, Distributional Reinforcement Learning (MIT Press, 2023).