Value Function

How Good Is This Situation?

The value function estimates the expected cumulative reward the agent can collect from a state (or state-action pair), following its current policy. It enables the agent to reason about long-term consequences — the backbone of solving the credit assignment problem.

Two Types of Value Function

State Value V(s)

Expected cumulative reward starting from state s following policy π. High V(s) = good state to be in. Used to evaluate states without enumerating future trajectories.

Action Value Q(s, a)

Expected cumulative reward for taking action a in state s, then following policy π. Q-values directly drive action selection: choose the action with the highest Q-value. What Q-learning and DQN learn.

The Bellman Equation

Self-consistent value estimates

The value of a state = immediate reward + discounted value of next state. This recursive relationship is what RL algorithms use to iteratively improve value estimates. DQN minimizes the Bellman error — the gap between the predicted Q-value and the Bellman target (r + γ·max Q(s', a')).

The Advantage Function

How much better was this action than average?

A(s, a) = Q(s, a) − V(s). Removes the baseline effect of being in a good or bad state. Focuses purely on whether the specific action was a good choice. Widely used in actor-critic methods to reduce variance in policy gradient updates.

Need Help?

Ask the AI assistant about value functions, the Bellman equation, the Q-function, or what the advantage function is used for.