Advanced level

Self-play game AI

Play Connect Four against an AI that searches thousands of possible futures before every move. Students then add policy and value networks and let it improve by playing against itself, the method behind AlphaZero.

Where you see it
AlphaGo, AlphaZero, and planning systems in logistics and robotics
Time to build
About 6 weeks

How it works

  1. Search: imagine thousands of future games with Monte Carlo tree search.
  2. Learn: train a network to predict good moves and who is winning.
  3. Combine: let the network guide the search.
  4. Improve: generate games by self-play, retrain, and repeat.

Your child learns

  • Monte Carlo tree search, from scratch
  • Policy and value networks in PyTorch
  • Self-play training loops
  • Measuring strength with Elo ratings

Try this

  • Play on Quick and try to win
  • Switch to Deep. Can you still beat it?
  • Watch the bars: where does it look most?
  • Let the AI start and see how it opens

The opponent on this page uses the search half of AlphaZero, so it runs instantly in your browser. Students add the neural networks and self-play training in class.

Your child can build this

This project is part of Research Tutorial. Start with a free class and we will find the right level.