Reinforcement learning (RL) shows up in alignment because human preference is rich. People care about tone, nuance, safety, and usefulness at once. A simple supervised label like “correct answer” often misses what makes one response better than another.
SFT says “copy this ideal answer.” That is great when you have a gold demo. It is weaker when the better answer is a matter of judgment: kinder, safer, clearer, less sycophantic.
Supervised fine-tuning says: “copy this ideal answer.” RL says: “try answers, get a score for how good they were, and become more likely to do the better ones.”
That score can come from humans indirectly (through a reward model), not only from exact gold text.
Classroom picture:
| Concept | In RL | In an LLM |
|---|---|---|
| Agent | Chooses actions | The language model choosing the next token |
| Environment | Gives feedback | The task / dialogue context |
| State | Current situation | Prompt + text generated so far |
| Action | One choice | The next token |
| Reward | Numeric feedback | A score for how good the completion was |
| Trajectory | Path of states/actions | Token-by-token generation of one response |
Simple example:
Walk that example one step at a time:
"Where is Kolkata?"Kolkata"Where is Kolkata? Kolkata"isTiny sketch of “action = next token” (concept only):
state = "Where is Kolkata?"
action = model.generate_next_token(state) # one token = one action
new_state = state + action
# repeat until the answer ends
# reward arrives for the full trajectory, not each token
reward = score_finished_answer(new_state)
score_finished_answer might later be a human, or a reward model. This lesson is only the framing.
Once generation is a sequence of actions with a final reward, we can train the model to maximize expected reward — not only to imitate one demo.
That is why alignment talks about policy, advantage, and PPO in the next lessons: they are tools for “make high-reward answers more likely.”
In LLM alignment, RL treats answering as a sequence of token choices that earn a reward for the whole response.