Reinforcement learning studies agents that learn by trial and error to collect rewards: game-playing programs, robots, and language models fine-tuned on feedback. The first question is what the agent is trying to maximize: not one reward, but the whole stream of future rewards.
We will add up the return, work backward, value rewards forever, and finish with the horizon.
Step 1: The return
An agent collects rewards r₀, r₁, r₂, … over time. Its return adds them up, discounting each later step by a factor γ between 0 and 1:
A reward t steps from now is weighted by γᵗ. With γ = 0.5, rewards 0, 2, 4 give 0 + 1 + 1 = 2. With γ = 0 the return is just the immediate reward; raising γ toward 1 makes the agent care more about distant rewards.
Step 2: Working backward
The return is also recursive: the return from step t is the reward now plus γ times the return from the next step on, Gₜ = rₜ + γGt+1. Working backward through rewards 0, 2, 4 with γ = 0.5 gives G₂ = 4, G₁ = 2 + 0.5 × 4 = 4 and G₀ = 0 + 0.5 × 4 = 2, the same as the direct sum.
Step 3: Rewards forever
Many tasks have no end, and an undiscounted sum of rewards forever would be infinite. With γ < 1 a constant reward r forever is a geometric series with a finite total:
A reward of 1 per step with γ = 0.5 is worth 2. The return is linear in the rewards, so doubling a constant reward doubles its return. Keeping infinite sums finite is one reason many formulations use γ < 1.
Step 4: The horizon
Discounting also expresses a preference for sooner rewards, and it sets how far ahead the agent effectively looks: rewards much more than about 1/(1 − γ) steps away count little. γ = 0.5 looks about 2 steps ahead, γ = 0.9 about 10, γ = 0.99 about 100 and γ = 0.999 about 1,000. Choosing γ is choosing how patient the agent is.