Study Atlas › Computer Science › Artificial intelligence

Reinforcement learning

An agent learns to act by trial and error to maximise cumulative reward.

Edited by Alex C, EduAlx · Sources cited below

Explanation

Formalised as Markov decision processes. Q-learning (Watkins, 1989) learns action values; policy gradient methods learn policies directly. Deep RL (DQN playing Atari, 2015; AlphaGo, 2016) combined it with neural networks. Barto and Sutton received the 2024 Turing Award. RL from human feedback aligns language models.

Example

AlphaZero learned chess from scratch by self-play in hours.

Code

# Q-learning update
Q[s][a] += alpha * (r + gamma * max(Q[s2]) - Q[s][a])

How it works, step by step

  1. Observe state s
  2. Choose action a (explore or exploit)
  3. Receive reward r and next state s′
  4. Update value estimates
  5. Repeat over many episodes

Open the interactive page with diagrams →

People behind it

References

  1. V. Mnih et al., Nature 2015, 518, 529–533.
  2. R. S. Sutton, A. G. Barto, Reinforcement Learning: An Introduction, 2nd ed., MIT Press, 2018.

Textbooks

Related topics

Machine learningNatural language processingNeural networks and backpropagationComputer vision and convolutional neural networksTransformers and large language modelsArtificial intelligence: search and the Turing testDecision trees and ensemble methodsClustering and unsupervised learningPython programming essentialsSearch engines and PageRank