Rewards, Returns, and Discounting

A reward is local feedback: what happened after one transition. A return is the accumulated consequence of a trajectory. The distinction matters because good behavior often requires looking beyond the next reward. A delivery robot might spend a few extra steps reaching an elevator, then complete the delivery much faster than if it chased the nearest hallway at every turn.

Rewards are often delayed. Working early on a project may feel unrewarding in the moment and later prevent an all-nighter. In a gridworld, each step might cost 0.01-0.01 while the goal gives +1+1 at the end. The agent needs a way to connect present actions to future consequences.

The discounted return from time tt is Gt=Rt+1+γRt+2+γ2Rt+3+G_t=R_{t+1}+\gamma R_{t+2}+\gamma^2R_{t+3}+\cdots The exponent grows with delay: one-step-later rewards are multiplied by γ\gamma, two-step-later rewards by γ2\gamma^2, and so on.

Discount factor

How much does the future count?

One reward is available now. A larger reward arrives four steps later. Move gamma to see when the delayed reward starts to matter.

0.50
delayed value=γ43=0.19\text{delayed value}=\gamma^4\cdot 3=0.19

Immediate option

Take a reward of 1 now.

1.00

Delayed option

Wait four steps for a reward of 3.

0.19

At gamma = 0.50, the agent behaves more like a myopic short-term thinker.
Gamma near 0 creates a short-term thinker. Gamma near 1 creates an agent that preserves more value for delayed outcomes.

γ\gamma controls how much we discount the future. When γ0\gamma\approx 0, the agent is myopic: it mostly cares about immediate reward. When γ1\gamma\approx 1, the agent is farsighted: delayed rewards still have substantial weight.

Discounting changes comparisons. A short path to a small reward becomes more attractive when future rewards are heavily discounted. A delayed larger reward becomes more attractive when γ\gamma is high enough for the future to still matter.

Equation Walkthrough

For rewards [0.04,0.04,1][-0.04,-0.04,1] and γ=0.9\gamma=0.9, the return is G0=0.04+0.9(0.04)+0.92(1)=0.734G_0=-0.04+0.9(-0.04)+0.9^2(1)=0.734. The exponent counts how delayed each reward is.

Checkpoint

What happens to a reward received five steps from now as γ\gamma moves from 0.20.2 toward 0.990.99?