Deriving Distributional Bellman Updates: Targets, Transforms, and Projection
The scalar Bellman backup hands you a number. The distributional backup has to hand you a shape — and then bend that shape back onto a finite set of atoms.

Key topics
The scalar Bellman backup hands you a number. The distributional backup has to hand you a shape — and then bend that shape back onto a finite set of atoms.
If you already know how and are derived from the one-step return decomposition, you have the right foundation for this article. What changes here is the object being updated. Instead of tracking a single expected return, we track the entire distribution of returns, and the update rule has to move that distribution correctly through a transition and a reward.
Why the Scalar Target Loses the Information You Need
The ordinary Bellman backup for a policy is:
The right-hand side is a single number. It collapses three separate sources of randomness into one expectation: the reward , the next state-action pair , and the return from that next pair. Once collapsed, you cannot recover the shape of the outcome profile.
Two very different situations can share the same mean. A policy that returns every time and a policy that returns half the time and the other half both have expected return . If your decision depends only on the mean, they are indistinguishable. If your decision depends on variance, tail risk, or multi-modality, they are not.
The distributional view keeps the shape. The price is that the update target is no longer a point — it is a distribution, and it has to be constructed from the next-state distribution through the same transition and reward that the scalar backup uses.
Bridge: This article assumes you have the one-step return decomposition and the Bellman expectation and optimality relationships. We will not re-derive those. We will derive what happens when is treated as a random variable rather than a scalar.
Knowledge check
Check your understanding
Answer this question before you continue.
Notation: Return Distributions and the Transition Operator
Let be a random variable whose law is the return distribution for state-action pair under policy . Its expectation is the ordinary action value:
Capital letters mark random variables. Lowercase letters mark realizations. We write for the random next state, for the random next action, and for the random reward. The standing assumptions are the usual ones: a discounted MDP with discount factor , bounded rewards, and independence of and given .
The transition operator maps a return-distribution function to the distribution of the next-state return:
The symbol means equality in distribution. This is the key move: does not produce a number. It produces a distribution — the mixture of next-state return distributions weighted by the transition probabilities and the policy.
Knowledge check
Check your understanding
Answer this question before you continue.
Deriving the Distributional Bellman Operator
Start from the random-variable recursion:
This is an equality in distribution, not an equality of samples. The left side and the right side are two random variables with the same law. Now substitute the transition operator:
This is the distributional Bellman operator. Read it as three composed operations on a distribution:
- Mix. averages the next-state return distributions over all possible pairs, weighted by their probabilities.
- Scale. Multiply by , shrinking the distribution toward zero.
- Shift. Add , translating the distribution along the real line.
The operator is a push-forward: it takes a distribution and pushes it through the affine map . Push-forwards compose linearly, which is why mixing, scaling, and translation combine cleanly into a single operator rather than requiring separate bookkeeping.
Contrast this with the scalar operator. The scalar version collapses randomness at every step. The distributional version propagates it. Same structural shape, fundamentally different object.
For the optimality variant, the greedy action selection replaces the policy expectation. But there is a subtlety: is not the same as a max over distributions. The distributional optimality operator selects the action with the highest expected value, then propagates that action's full distribution. You cannot take a pointwise max of distributions and expect it to correspond to anything meaningful.
Worked Example: One Transition, Three Operations
Consider a two-state MDP. From state , action transitions deterministically to with reward . From , the policy selects an action whose return distribution is:
Let . We compute the target distribution step by step.
Step 1: Mix. Since the transition is deterministic, . The distribution is unchanged: atoms at 2 and 4, each with probability 0.5.
Step 2: Scale. Multiply each atom by : atoms at and , each with probability 0.5.
Step 3: Shift. Add : atoms at and , each with probability 0.5.
The target distribution has support with equal probability. Its mean is . The scalar backup gives . The means agree — as they must, since expectation is linear and the distributional operator is a strict refinement.
Geometrically: discounting is a contraction toward the origin, the reward is a translation, and the mixture is a weighted average of shapes. If the transition were stochastic, step 1 would produce a mixture of two or more distributions before scaling and shifting.
Knowledge check
Check your understanding
Answer this question before you continue.
Why the Target Usually Lands Off the Support
A categorical representation fixes a finite set of atoms , typically evenly spaced on . The transformed target generally falls between atoms. In the example above, if the support were , the target atoms at and do not coincide with any grid point.
The target is therefore a distribution the current parameterization cannot represent exactly. This is not a numerical precision issue. It is a representational mismatch — the same problem as fitting a continuous density with a discrete histogram. The histogram can approximate the density, but it cannot equal it.
Common mistake: Skipping projection and regressing directly on the raw transformed atoms. This silently biases the learned distribution because the network is being asked to place probability mass at locations its output layer cannot express. The loss may decrease, but the distribution drifts.
Projection: Bending the Target Back Onto the Support
Projection maps an arbitrary distribution onto the fixed support by distributing each atom's probability to its immediate neighbors, weighted by inverse distance. If a transformed atom falls between and , its probability is split:
where . The allocation is piecewise linear and mass-preserving: total probability is conserved, but the support is not. The projected distribution lives on the original grid.
Let's continue the example. Suppose the support is , so . The first target atom is . It falls between and . Its probability splits as:
- To :
- To :
The second target atom is . It falls between and . Its probability splits as:
- To :
- To :
The projected distribution on the grid is:
| Atom | Probability |
|---|---|
| 0 | 0.00 |
| 1 | 0.00 |
| 2 | 0.35 |
| 3 | 0.15 |
| 4 | 0.45 |
| 5 | 0.05 |
Check the mass: . Check the mean: . The projected mean matches the unprojected mean exactly. That is not a coincidence — piecewise linear interpolation preserves the first moment when the target atoms fall inside the support. It does not preserve higher moments, and it does not preserve the mean when mass is clipped at the boundaries.
The projected operator is a contraction in an appropriate metric (the Cramér distance, for the categorical case), so the fixed-point reasoning from the scalar case carries over with a caveat: the fixed point is now a fixed point of the projected operator, not of the original one.
What projection loses: fine structure between atoms, and exactness when the target's support lies far outside . Boundary behavior matters. Mass pushed past the support edges is clipped onto the nearest atom, which is a real source of bias in practice. If your returns routinely exceed , the learned distribution will pile probability at the boundary and understate tail risk.
Knowledge check
Check your understanding
Answer this question before you continue.
From Projected Target to Update Rule
The update minimizes a divergence between the projected target distribution and the current predicted distribution. In the categorical case, this is a cross-entropy term:
This turns the Bellman update into a classification problem over atoms. That is why the loss looks like multiclass cross-entropy rather than squared error. The next-state distribution is treated as fixed — parameterized by a target network or a frozen copy of — so the update is a stable regression toward a moving target.
Contrast with the scalar case: squared error on a point estimate versus a distributional divergence on a histogram. The scalar update asks "how far is my number from the target number?" The distributional update asks "how far is my histogram from the projected target histogram?"
What the Distributional View Changes, and What It Does Not
The expectation of the learned distribution still recovers the ordinary value. The distributional view is a strict refinement, not a replacement. It earns its cost when outcome variability is decision-relevant: risk-sensitive control, multi-modal returns, or diagnosing why a policy is unstable despite a reasonable mean.
But here is the boundary that trips people up: predicting a return distribution does not, by itself, make the policy risk-sensitive. The standard expectation-greedy update described in this article still selects actions by the highest mean. If you want to act on the tail, the variance, or a specific quantile, you need an additional decision rule that reads the distribution and chooses accordingly. The distribution is information; the risk criterion is a separate choice about how to use that information. Conflating the two leads to the mistaken belief that switching from DQN to C51 automatically produces risk-aware behavior. It does not.
It also does not fix exploration, credit assignment, or function-approximation instability. Those are separate problems. And the clean contraction story assumes a fixed support and a tabular or well-behaved parameterization. Deep function approximation reintroduces the usual convergence caveats.
The cost is real: more parameters, a projection step per update, and sensitivity to support bounds and atom count. If you only need the expected return, keep the scalar backup. If the shape of the return changes your decision, carry the distribution and accept projection as the price of a finite representation.
Next Step
Build the three operations by hand. Take the two-state example above, write a short script that represents as a list of atoms and probabilities, applies mix, scale, and shift, then projects onto a fixed grid. Verify that the projected target's mean matches the scalar backup. Then push one target atom past and watch the mean drift — that is the boundary bias in action, and it is the failure mode most worth internalizing before you tune a real agent. When the numbers agree, you have confirmed the derivation against output rather than trusting it. When they disagree, you have found either a projection bug or a boundary case worth understanding.
Knowledge check
Final check
Finish the article by checking the ideas you just learned.
References
Build a stronger RL mental model
Use structured resources to connect equations, algorithms, and observable agent behavior.


