Reinforcement Learning: States, Actions, Rewards, and Policies
About 42 min
Goal
By the end of this lesson, you can explain the reinforcement-learning interaction loop using agent, environment, state or observation, action, reward, policy, return, and exploration versus exploitation.
Imagine a game in which you repeatedly choose between two buttons. After each choice, the game gives you a number. One button often gives a small reward. The other sometimes gives a larger reward but sometimes gives nothing.
You are not given the best action as a label for every round. You act, observe what happens, receive a reward, and use experience to improve future choices.
That repeated feedback loop is the core of reinforcement learning (RL).
The basic interaction loop
The pieces are:
- agent — the learner or decision-maker;
- environment — the world the agent interacts with;
- state/observation — information available before a decision;
- action — a choice the agent makes;
- reward — a feedback number after the action;
- policy — the rule or model that chooses actions.
The loop repeats:
observe state
-> choose action from policy
-> environment changes
-> receive reward and next observation
-> repeat
In a simple bandit there may be no changing state; the important uncertainty is which action tends to produce better reward. In other tasks, the state changes after every action.
Reward is feedback, not a complete description of the world
A reward tells the agent what the training process values numerically. It does not automatically capture everything we care about.
If a delivery robot receives +1 only for moving quickly, it may learn behavior that is fast but unsafe unless the reward or constraints represent safety too.
That distinction will matter again in RLHF: optimizing a measured reward does not prove truth, safety, or general quality.
Longer-term consequences need return
Some actions produce a small immediate reward but a better future. RL therefore often reasons about return: accumulated reward over several steps, sometimes giving less weight to rewards far in the future.
For example, suppose three rewards are 1, 0, 5 and the discount factor is 0.9. A discounted return from the first step is:
1 + 0.9 × 0 + 0.9² × 5 = 5.05
The immediate reward was only 1, but the later reward still matters. You do not need the Bellman equation here. The intuitive question is enough: does this action only look good now, or does it lead to better outcomes over the rest of the interaction?