What is reinforcement learning? Describe the agent-environment interaction loop.
Answer
Reinforcement learning is learning what to do from trial and error: an agent acts in an environment, receives a scalar reward, and adjusts its behavior to maximize expected cumulative reward. The loop: at step the agent observes state
, picks an action
from its policy
, the environment transitions to a new state and returns reward
, and the agent updates its policy or value estimates from the experience; this repeats until the episode ends. Unlike supervised learning there are no labels: the only supervision is the reward signal, which may arrive many steps late, and the agent’s own actions decide what data it sees next, which is why exploration must be built in.
(1) The MDP Tuple: states, actions, transition probabilities, a reward function, and a discount factor ; the Markov property says the state summarizes everything relevant about the history.
(2) Return and Value: the agent maximizes the expected discounted return, and value functions score states or state-action pairs so credit for delayed rewards can be assigned to earlier decisions.
(3) The Same Loop Now Trains LLMs: RLHF (InstructGPT) fits a reward model from human preference rankings and optimizes the language model against it with PPO; DeepSeek-R1’s GRPO removes the value critic and baselines each prompt against its own sampled answer group, lifting AIME pass@1 from 15.6% to 71.0% with pure RL.

Figure 1: The interaction loop: the agent’s policy turns the observed state into an action, the environment answers with the next state and a scalar reward, and the experience tuple feeds the learning update.
Mathematical Formulation:
Where:
is the discounted return from step
;
is the reward received
steps later.
is the discount factor, trading immediate reward against future reward and keeping infinite-horizon returns finite.
is the policy and the expectation runs over trajectories induced by
and the environment’s transition dynamics;
is the optimal policy.
| Feature | Reinforcement Learning | Supervised Learning |
|---|---|---|
| Supervision Signal | Scalar reward, possibly delayed many steps | A label per example |
| Data | Self-generated, non-stationary | Fixed, assumed i.i.d. |
| Objective | Maximize expected discounted return | Minimize a per-example loss |
| Feedback Timing | Credit assignment over time | Immediate and exact |
| Canonical Loop | act, observe reward and next state, update | epochs over a fixed dataset |

Figure 2: The loop specialized to LLM post-training: the policy is the language model, actions are token sequences, and a learned reward model supplies the scalar reward. PPO (InstructGPT) trains a value critic alongside; GRPO (DeepSeek-R1) replaces it with a group baseline over sampled answers.
Leave a Reply