Concepts / Value Function Updates

Value Function Updates

The reinforcement signal is the number that most directly guides changes in a policy or value function.

  • Programming

The Number That Directs Learning

An agent does not change its policy or value function merely because a situation occurred. A numerical reinforcement signal guides the size and direction of that change. It may be positive, negative, or zero, and it acts as a multiplicative factor in a parameter update.

The simplest reinforcement signal is the reward itself, Rₜ. Temporal-difference learning uses a richer signal: the TD error. This combines the immediate reward with a change in predicted value, so learning can be directed by both what happened immediately and how the value estimate changed.

Breaking Down a TD Error

Formula, step by step
  1. 1
    Rₜ is the primary reinforcement contribution: the reward received at time t.
  2. 2
    γV(Sₜ) − V(Sₜ₋₁) is the secondary reinforcement contribution: the temporal-difference contribution from comparing the successor value with the previous value.
  3. 3
    δₜ is the complete reinforcement signal used for the TD state-value update.
Rₜprimary reinforcementδₜone reinforcement signalγV(Sₜ) − V(Sₜ₋₁)secondary reinforcementaddadd
How do the immediate reward and the difference between successor and current values combine to produce one reinforcement signal?

The two terms should be understood as contributions to one signal, not as two independent learning signals. If both terms are present, the TD error is a mixture. If one term is zero, the remaining term determines the signal.

Reading the Bellman Equation

Formula, step by step
  1. 1
    Start with the state-action pair (s, a).
  2. 2
    Include the reward received when action a is taken in state s.
  3. 3
    Include the action values of the successor state-action pairs, discounted by γ.
  4. 4
    The policy π determines how successor actions contribute after the transition.

An action value is backed up from what can happen after a particular state-action pair. Taking action a in state s can lead to possible successor states s′ and rewards r. The action value qπ(s, a) therefore depends on the transition reward and on the action values available from the successor state. The policy π determines how the next action a′ is selected at s′.

(s, a)current pairrtransition rewardqπ(s′, a′)successor action valueqπ(s, a)backed-up action value(s′, a′)successor pair under πproducesleads tohascombined withdiscounted and combined
How does qπ(s, a) depend on the immediate reward and successor state-action values?

Checking One State

Bellman verification is performed state by state. To check a proposed state-value equation at one state, substitute that state, list its neighboring outcomes, combine the relevant rewards with the values of the states reached from it, and compare the result with the proposed value. A successful check establishes consistency at that state; it does not establish the equation everywhere.

Worked example

A local Bellman check

A proposed value function assigns a value to state s. The state has possible neighboring outcomes with known rewards and state values. Verify the equation at s.

  1. 1
    Identify the current state

    Select the particular state whose proposed value is being checked.

  2. 2
    List neighboring outcomes

    Record the rewards and successor-state values associated with the outcomes reachable from that state.

  3. 3
    Combine the outcomes

    Use the Bellman equation to combine the relevant rewards and successor values.

  4. 4
    Compare

    If the computed result equals the proposed value for s, the equation holds for this state.

Result

The verification is local: it tests the Bellman relationship at the selected state, not automatically at every state.

sstate being checkeds₁reward r₁ and value V(s₁)Bellman resultcompare with V(s)s₂reward r₂ and value V(s₂)possible outcomepossible outcomereward and valuereward and value
How can the value of one state be checked by combining rewards and values from the states reached from it?

Shifting Every Reward

Suppose the same constant c is added to every reward. The value of every state then increases by one common amount, written vᶜ. The values shift, but their relative ordering under a policy does not change. A state that was valued above another remains valued above it after the common shift.

State Alower valueState Avalue + vᶜState Bhigher valueState Bvalue + vᶜlower thanlower than
What changes in the value function when the same constant is added to every reward, and what remains unchanged?

Common Reasoning Errors

  • Common mistake

    Treating the reward as the only possible reinforcement signal.

    What it looks like

    Assuming δₜ must equal Rₜ.

    Why it fails

    A TD error also contains the secondary contribution γV(Sₜ) − V(Sₜ₋₁).

    Do this instead

    Write the complete TD-error expression before deciding which contributions are present.

  • Common mistake

    Calling primary and secondary reinforcement two separate learning signals.

    What it looks like

    Updating once with Rₜ and again with γV(Sₜ) − V(Sₜ₋₁) as if they were independent signals.

    Why it fails

    They are conceptual parts of one TD-error reinforcement signal.

    Do this instead

    Add the two contributions to obtain δₜ.

  • Common mistake

    Calling a TD error pure primary when the reward is nonzero but the value-difference term is also nonzero.

    What it looks like
    Ignoring γV(Sₜ) − V(Sₜ₋₁) because Rₜ is present.
    Why it fails

    Both nonzero terms make the signal a mixture.

    Do this instead

    Classify the signal by checking whether each term is zero or nonzero.

  • Common mistake

    Assuming one successful Bellman check proves the value function everywhere.

    What it looks like

    Verifying state s and declaring all states verified.

    Why it fails

    Bellman verification is performed state by state.

    Do this instead

    Repeat the check for every state that must satisfy the equation.

  • Common mistake

    Assuming a common reward shift preserves the numerical values.

    What it looks like

    Saying that adding c to every reward leaves each state value unchanged.

    Why it fails

    Every state value increases by a common amount vᶜ.

    Do this instead

    Distinguish the changed absolute values from the unchanged relative ordering.

Apply the Checks

MEDIUM

For each situation, identify the reinforcement pattern or value-function consequence. First, Rₜ is zero while γV(Sₜ) − V(Sₜ₋₁) is nonzero. Second, both terms in δₜ are nonzero. Third, every reward is increased by the same constant c. Fourth, a proposed Bellman equation matches at one state but has not been checked elsewhere.

Hints
  • A zero reward removes the primary contribution but does not remove a nonzero secondary contribution.
  • Two nonzero TD-error terms form a mixture.
  • A common reward shift changes every state value by the same amount and preserves relative ordering.
  • A check at one state establishes only a local verification.
  1. 1
    A reinforcement signal is the number that most directly guides a policy or value-function update. In TD learning, δₜ combines primary reinforcement Rₜ with secondary reinforcement γV(Sₜ) − V(Sₜ₋₁). Action values are backed up from transition rewards and successor action values, with the policy determining successor actions. Bellman equations must be checked state by state. Adding the same constant to every reward shifts every state value by a common amount while preserving the relative ordering of states.

Key Takeaways

  • The reinforcement signal controls the size and direction of a policy or value-function update.
  • A TD error combines primary reinforcement from the reward with secondary reinforcement from the temporal-difference value change.
  • The action value qπ(s, a) is backed up from the reward and successor action values selected according to policy π.
  • Bellman verification is local unless the equation is checked for every state.
  • Adding a common constant to all rewards shifts all state values equally without changing their relative ordering.

Related concepts

More concepts starting with V