Saraswati Stitch needle-and-thread markSaraswati Stitch®
contact@saraswatistitch.comBook a call
← Glossary

Definition

Reinforcement learning

Reinforcement learning is a type of machine learning where an agent learns by trial and error, taking actions in an environment and adjusting its behaviour to collect as much reward as possible over time.

In simple words, it is learning from consequences. Nobody shows the system the right answer. It tries something, gets a reward or a penalty, and gradually learns which actions lead to better outcomes. A dog learning tricks for treats is the usual analogy, and it holds up reasonably well.

The best known example is AlphaGo. DeepMind trained it partly by having it play thousands of games against earlier versions of itself, and in March 2016 it beat world champion Lee Sedol 4 games to 1 at Go, a game long thought too complex for computers. Other uses include robotics, game playing, recommendation systems that learn from clicks, and controlling data centre cooling.

Is ChatGPT based on reinforcement learning? Partly. Models like ChatGPT are first trained on huge amounts of text to predict the next word, then refined with reinforcement learning from human feedback, or RLHF, where human ratings of answers act as the reward. Newer reasoning models also use reinforcement learning to reward correct solutions to maths and coding problems. Compared with supervised learning, which learns from labelled examples, reinforcement learning is harder to get right: rewards have to be designed carefully, training can be unstable, and a system will happily exploit a badly written reward in ways nobody intended.

Related terms

  • RLHF (reinforcement learning from human feedback): RLHF is a training method where people rank a model’s outputs and the model is tuned toward the preferred ones, which is a big part of why modern assistants are helpful and well-behaved.
  • Supervised learning: Supervised learning is a machine learning method where a model learns from labelled examples, pairs of inputs and correct answers, so it can predict the answer for new inputs it has not seen before.
  • Machine learning: Machine learning is a branch of AI where a system learns patterns from data and improves at a task through examples, instead of being programmed with explicit rules.
  • AI agent: An AI agent is a system that uses a language model to decide which steps to take and which tools to call to finish a goal, instead of just answering a single prompt.