Skip to content

Beginning of the lesson

Reinforcement Learning Basics

The third great way machines learn: not from a book of right answers, but from trying things, seeing what happens, and chasing rewards — exactly the way you learned to ride a bike or a puppy learns to sit.

The big idea

So far in this course you have met two families of machine learning:

  • Supervised learning — you show the model thousands of examples that are already labelled with the correct answer (this photo is a cat, that house sold for 90,000 som), and it learns to copy those answers.
  • Unsupervised learning — you give the model data with no labels at all and it finds hidden groups or patterns on its own (clustering shoppers into types).

Reinforcement learning (RL) is the third family, and it is different from both. There is no dataset of correct answers. Instead an agent lives inside an environment, takes actions, and every so often receives a numerical reward (a point score) telling it how well it is doing. The agent's whole job is to figure out, purely from these rewards, which actions lead to the most reward over time. It learns by trial and error.

What you will learn
  1. Why RL is a completely different kind of learning from supervised and unsupervised.
  2. The seven core words of RL — agent, environment, state, action, reward, policy, episode — each explained with one running example: a robot in a maze.
  3. The RL loop: observe the state, choose an action, collect the reward and the new state, then update behaviour — repeat.
  4. The exploration vs exploitation dilemma and the simple epsilon-greedy trick that handles it.
  5. How to design rewards, and the danger of reward hacking.
  6. The intuition behind Q-learning — a table of "how good is this action here" numbers — walked through with real numbers.
  7. Where RL shines (games, robots, recommendations, and the RLHF that polished chatbots) and why it is hard.

Continue this lesson on YourAIZone

The full lesson has the complete explanation, worked examples, common mistakes, tests with instant checking and an AI tutor. Start right away as a guest, or create an account to keep your progress.

In the full lesson

  • The complete explanation
  • Worked examples
  • Common mistakes and how to avoid them
  • Test questions: 15
  • AI tutor that answers questions about the topic
  • Progress tracking for students, parents and teachers