Language Models
How ChatGPT & Claude Learn to Write Better
Language models start by learning patterns from text on the internet, but they need refinement to be genuinely helpful. The method is called Reinforcement Learning from Human Feedback (RLHF), and it's the evaluate-improve loop in disguise.
The model generates responses to thousands of prompts. Human raters read pairs of responses and pick the better one. That's evaluation. Then the model is updated to produce more responses like the preferred ones. That's improvement. One common algorithm for this update is PPO(Proximal Policy Optimization), which makes small, careful changes to avoid breaking what already works, like adjusting a recipe one ingredient at a time. The cycle repeats until the model's responses consistently score well.
| Grid World | Language Model |
|---|---|
| Rooms (A, B, C) | Possible conversations |
| Which direction to go | Which word to write next |
| −1 per extra move | Human preference score |
| Direction for each room | How the model generates text |
| Score for each room | Predicted response quality |