Skip to content
advanced

Bellman Error With Function Approximation: Why Low Training Loss Can Mislead

Your value network's loss curve flattens to something that looks like zero. The run looks healthy. Then you watch the greedy policy walk straight into a…

Published 2026-10-02Updated 2026-10-0410 min read
A breathtaking view of a tropical sunset with vibrant colors reflecting on the calm sea.
A breathtaking view of a tropical sunset with vibrant colors reflecting on the calm sea. Photo by Asad Photo Maldives on Pexels.

Your value network's loss curve flattens to something that looks like zero. The run looks healthy. Then you watch the greedy policy walk straight into a wall it has visited a hundred times.

The relief is understandable, and it is also the trap. A low training loss tells you the optimizer is fitting targets on the states it saw. It does not tell you the value function is correct. Those are different claims, and the gap between them is where most quiet value-function bugs live.

By the end of this article you will be able to read any Bellman-error number and say which of three errors it does and does not contain: approximation error, optimization error, and sampling error. Only the first is a property of the function class itself. The other two are properties of your training run.

The Loss Curve Is Not a Value Report

Here is the weak model I want to replace: low loss means the values are right.

A loss is a fit to targets on a data distribution. Value accuracy is a property of the function over the entire state space. Those two things coincide only under conditions most practitioners never check.

Three error sources hide inside that gap:

  • Approximation error — the distance between the Bellman backup and the closest function your class can represent. This is a property of the architecture and features, not of training.
  • Optimization error — the distance between that closest representable function and the parameters your optimizer actually reached.
  • Sampling error — the gap between the empirical loss on sampled transitions and the expected loss under the state distribution.

Fixing one does nothing for the others. That is the whole point. A perfect optimizer on a restricted class still leaves approximation error on the table, and a rich class trained on poor coverage still leaves sampling error.

I will assume you already have the Bellman expectation and optimality relationships from the prerequisite derivation. The only thing I need here is the one-step backup in local notation.

Knowledge check

Check your understanding

Answer this question before you continue.

A value learner reaches very low loss on its training transitions. What conclusion is warranted?
Misconception Check

Focus: Distinguish fitting sampled Bellman targets from establishing value accuracy over the state space.

Notation and the Assumptions We Are Standing On

Let the MDP be (S,A,P,R,γ)(S, A, P, R, \gamma) with discount factor γ∈[0,1)\gamma \in [0, 1). Fix an evaluation policy π\pi. The state value is

Vπ(s)=Eπ[∑t=0∞γtRt+1∣S0=s].V^\pi(s) = \mathbb{E}_\pi\left[\sum_{t=0}^{\infty} \gamma^t R_{t+1} \mid S_0 = s\right].

The Bellman operator TT maps a value function to its one-step backup:

(TV)(s)=Ea∼π[R(s,a)+γ Es′∼P(⋅∣s,a)V(s′)].(TV)(s) = \mathbb{E}_{a \sim \pi}\left[R(s,a) + \gamma\, \mathbb{E}_{s' \sim P(\cdot \mid s,a)} V(s')\right].

The true value VπV^\pi is the unique fixed point: TVπ=VπTV^\pi = V^\pi.

Now restrict to a function class F\mathcal{F} — linear features, a small MLP, whatever you actually train. Define the projection Π\Pi that returns the closest representable function in F\mathcal{F} under your chosen norm. The projected Bellman operator is ΠT\Pi T.

Three assumptions carry the whole argument:

  1. Fixed evaluation policy. We are evaluating π\pi, not improving it. This keeps the operator linear and the target stationary.
  2. Stationary transition and reward model. PP and RR do not drift while we train.
  3. The true value need not lie in F\mathcal{F}. This is the load-bearing one. If Vπ∈FV^\pi \in \mathcal{F}, approximation error is zero and the story collapses to optimization and sampling.

The Bellman residual of a function VV is the pointwise difference TV−VTV - V. It is zero everywhere only at the fixed point. Everywhere else it is a map of where your function disagrees with its own backup.

Knowledge check

Check your understanding

Answer this question before you continue.

Which stated assumption is load-bearing for the possibility of approximation error?
Single Choice

Focus: Identify the assumption that permits nonzero approximation error in the stated setup.

Where the Error Actually Comes From

Start from the gap between your current function VθV_\theta and the true value VπV^\pi. Insert the projection and the optimizer's stopping point:

∥Vθ−Vπ∥  ≤  ∥Vθ−ΠTVθ∥⏟optimization  +  ∥ΠTVθ−TVθ∥⏟approximation  +  ∥TVθ−Vπ∥⏟contraction of the rest.\|V_\theta - V^\pi\| \;\le\; \underbrace{\|V_\theta - \Pi T V_\theta\|}_{\text{optimization}} \;+\; \underbrace{\|\Pi T V_\theta - T V_\theta\|}_{\text{approximation}} \;+\; \underbrace{\|T V_\theta - V^\pi\|}_{\text{contraction of the rest}}.

Read each term as a distinct failure:

  • Approximation error is ∥ΠTVθ−TVθ∥\|\Pi T V_\theta - T V_\theta\|. It measures how far the backup lands from the closest function in F\mathcal{F}. This is the inherent Bellman error of the class — the part no amount of training removes.
  • Optimization error is ∥Vθ−ΠTVθ∥\|V_\theta - \Pi T V_\theta\|. It shrinks as your optimizer gets closer to the projected target. More steps, better learning rates, better conditioning.
  • Sampling error lives inside the empirical estimate of the loss. It shrinks with better coverage of the state distribution the loss is computed under.

The three are not interchangeable. Approximation error is a property of F\mathcal{F}. Optimization error shrinks with better training. Sampling error shrinks with better coverage. Fixing one does nothing for the others.

There is a second mechanism worth naming: amplification. Repeated application of the Bellman operator can compound a per-step approximation error rather than cancel it. A small per-step gap is not automatically safe, because the operator keeps re-injecting it at every backup.

Knowledge check

Check your understanding

Answer this question before you continue.

A backup TVθ remains far from the closest function representable in F even after the optimizer reaches that closest function. Which error remains?
Comparison Reasoning

Focus: Differentiate approximation error from optimization error in the projected-backup decomposition.

A Worked Example: A Function Class That Cannot Fit the Backup

A four-row comparison for states s1 through s4. The backup values are 1, 1, 1, and 0. The constant-class projection is 0.75 in every row, while the tabular-class fit matches each backup value exactly.
The constant class leaves state-dependent residuals; the tabular class can fit this backup exactly.

Let me make this concrete with a chain small enough to check by hand.

Four states in a line: s1→s2→s3→s4s_1 \to s_2 \to s_3 \to s_4. Fixed policy moves right. Reward is +1+1 on every transition except the terminal step from s4s_4, which gives 00. Discount γ=0.9\gamma = 0.9.

The true values are a geometric sum:

StateVπ(s)V^\pi(s)
s1s_10.9+0.81+0.729=2.4390.9 + 0.81 + 0.729 = 2.439
s2s_20.9+0.81=1.7100.9 + 0.81 = 1.710
s3s_30.90.9
s4s_400

Now restrict F\mathcal{F} to constant functions: Vθ(s)=θV_\theta(s) = \theta for all ss. One parameter. This is the smallest possible restricted class, and it is exactly the kind of restriction a poorly chosen feature set creates in practice.

Start from θ=0\theta = 0. The Bellman backup is

(TVθ)(s)=R(s)+γθ.(TV_\theta)(s) = R(s) + \gamma \theta.

With θ=0\theta = 0, the backup is [1,1,1,0][1, 1, 1, 0] across the four states. That vector is not constant. The backup lands outside F\mathcal{F}.

Project onto the constant class by least squares. The mean of [1,1,1,0][1, 1, 1, 0] is 0.750.75, so ΠTVθ=0.75\Pi T V_\theta = 0.75 everywhere. The residual TVθ−VθTV_\theta - V_\theta is

StateBackupVθV_\thetaResidual
s1s_11.01.00.750.75+0.25+0.25
s2s_21.01.00.750.75+0.25+0.25
s3s_31.01.00.750.75+0.25+0.25
s4s_40.00.00.750.75−0.75-0.75

The residual is nonzero at every state, and it has opposite signs. Positive errors at s1s_1 through s3s_3 and a negative error at s4s_4. If you average the squared residual, the signed errors partially cancel in the mean and the scalar loss looks smaller than the worst-case error. The pattern is exactly what a single number hides.

Contrast with tabular representation. With one parameter per state, the backup [1,1,1,0][1, 1, 1, 0] is representable exactly. The residual can be driven to zero everywhere. The restricted class cannot do that, no matter how long you train.

Note: The residual map is the diagnostic. A scalar loss is a summary; the per-state residual is the shape of the failure.

Knowledge check

Check your understanding

Answer this question before you continue.

Starting from θ = 0, the backup across the four states is [1, 1, 1, 0]. Under the article's least-squares projection onto constant functions, what constant value is projected?
Output Prediction

Focus: Compute the least-squares projection of the example backup onto constant functions.

Why a Low Training Loss Can Hide a Wrong Value Function

Now connect the decomposition back to the symptom.

The loss is an average over the sampled distribution. States that are rarely visited contribute almost nothing. Their errors are effectively invisible. In the chain example, if s4s_4 is visited once per episode and s1s_1 through s3s_3 are visited constantly, the loss is dominated by the three states where the residual is small.

Averaging cancels signed residuals. Large positive and negative errors at different states can sum to a small mean squared residual. The chain example shows this directly: +0.25+0.25 three times and −0.75-0.75 once averages to zero.

The target moves. The target is a function of the current parameters. The loss can be small at a point that is not the fixed point of the projected Bellman operator. You are chasing a target that is chasing you.

Distribution shift turns a small training loss into a large generalization gap. The data the loss is computed on and the states the policy actually visits are not the same distribution. A small training loss on one distribution says nothing about the other.

A low loss is still useful evidence that the optimizer is working and the targets are being fit. It is just not evidence about approximation error or coverage. Those are separate questions with separate answers.

Reading a Bellman-Error Number Without Being Fooled

Here is the routine I use. Ask three questions in order.

First: which distribution was the error measured under? If it does not match the states the policy visits, the number is describing the wrong problem.

Second: is the class expressive enough? If the residual is concentrated in a few states and does not shrink with more training, the class cannot represent the backup there. A richer class is the fix.

Third: did the optimizer converge? If the residual is spread evenly and shrinks with more training, you have optimization error. More steps, better learning rates, better conditioning.

Fourth: is the data covering the relevant states? If the residual is concentrated in rarely visited states, more data is the fix.

SymptomLikely causeFix
Residual concentrated in a few states, stable across trainingApproximation errorRicher class or better features
Residual spread evenly, shrinking with trainingOptimization errorMore steps, better optimizer
Residual concentrated in rarely visited statesSampling errorBetter coverage
Residual small on training states, large on policy statesDistribution shiftAlign data collection with policy

When not to reach for this analysis: if the class contains the true value function and coverage is adequate, the approximation term is zero and the remaining work is ordinary supervised regression. Do not over-engineer a problem that is already well-posed.

What This Means for the Algorithms You Will Meet Next

Projected backups are the reason target networks, replay buffers, and residual-based objectives exist. They are attempts to control specific terms in the decomposition, not generic stabilizers. A target network slows the moving-target problem. Replay improves coverage and reduces correlation. Neither fixes approximation error.

Actor-critic critics inherit the same limits. A critic's low loss does not certify the advantage estimates the actor is trained on. The critic is a function approximator with a stated domain of validity, and that domain has to be checked against where the policy actually operates.

Treat the value function as a model with a stated domain of validity. Check that domain against where the policy operates. That is the durable habit.

Here is the concrete next step. Instrument one small value-prediction run to log the residual per state group, not just the aggregate loss. Group states by visit frequency and by region of the state space. Compare that residual map against the states the policy actually visits. If the map is flat and small everywhere the policy goes, you have earned some confidence. If it is small on average but large where the policy lives, you have found the bug the loss curve was hiding.

Knowledge check

Final check

Finish the article by checking the ideas you just learned.

A residual map is small on frequently sampled states but large on rarely visited states relevant to the policy. Which diagnosis and response best match the article?
Question 1 of 2Scenario Interpretation

Focus: Use the residual pattern and visit frequency to distinguish a coverage problem from other error sources.

A team uses a target network and replay buffer but still suspects its value class cannot represent the Bellman backup. Which interpretation follows the article?
Question 2 of 2Comparison Reasoning

Focus: Explain which error sources target networks and replay buffers address and which they do not.

References

  1. Learning Near Optimal Policies with Low Inherent Bellman Errorproceedings.mlr.press
Practical resource

Build a stronger RL mental model

Use structured resources to connect equations, algorithms, and observable agent behavior.

Browse resources
Related sites

Continue across related AI foundations

Use LearnPyFast for Python foundations and LearnLLMFast for practical language-model and agent application concepts.

Python tutorialstutorial

LearnPyFast

Beginner-friendly Python tutorials, examples, and learning paths for practical programming foundations.

PythonProgrammingBeginners
Visit LearnPyFast
LLM tutorialstutorial

LearnLLMFast

Practical LLM tutorials for builders who want to understand prompting, workflows, agents, and AI applications.

LLMAIBuilders
Visit LearnLLMFast

Keep learning

Related reinforcement learning tutorials

Continue with nearby RL concepts, algorithms, and experiments that build on the same decision process.