AlphaZero on Connect-4 from Scratch

A self-taught Connect-4 AI: no human games, just self-play.

Play against it

Loading the trained network…

On each turn the AI runs a Monte Carlo Tree Search: it plays out hundreds of possible futures, letting its neural network suggest promising moves (the policy) and judge who's winning (the value). The bars show where that search spent its time; it plays the most-visited column. Everything runs in your browser. Harder levels just search more.

Model results

Head-to-head

Each row is 20 games, alternating who moves first. "Network only" plays the policy network's top move with no search; the other rows add Monte Carlo Tree Search at the site's difficulty levels.

OpponentAI settingW–L–DResult
windrawloss

Both the AI and the minimax bot play almost deterministically, so the same few game lines tend to repeat; treat differences of a few games between rows as noise.

Training curve