Chess
English

Chess › About Chess ›

Computer Chess: from Deep Blue to Stockfish and AI

How computers play chess, how Deep Blue beat Kasparov, and why today's engines are too strong for any human.

Also called:Computer chess、Chess engine、Deep Blue、Stockfish、AlphaZero

Today you can play a computer stronger than the world champion right on your phone, but a few decades ago that was still a scientist's dream. This article goes from the first paper programs to Deep Blue, Stockfish and AI, and explains where this site's computer opponents come from. Want to take on the computer first? Just play chess online for free.

It started on paper

In 1950, the American mathematician Claude Shannon published a paper that was the first serious look at how to make a computer play chess. His idea: look a few moves ahead at every possible move, give each position a score, and pick the move with the best score. That idea is still the basis of computer chess today.

Around the same time, the British mathematician Alan Turing wrote a chess program too, but no computer back then could run it. So he played it himself with pencil and paper, following the program step by step. A single move often took him half an hour.

Deep Blue beats the world champion

IBM's Deep Blue was a computer built just for chess. In 1996 it took on world champion Garry Kasparov for the first time. It won one game but lost the match 4–2. After an upgrade, it played him again in 1997 and won 3.5–2.5. It was the first time a computer beat a reigning world champion in a match under normal tournament conditions.

In the deciding sixth game, Kasparov played the Caro-Kann Defense with Black and got his move order wrong on move 7:

Black played h6 to chase the knight away, but Deep Blue simply dropped its knight on e6. The black king is stuck in the center and will never get to castle.

This knight sacrifice was already known in opening theory. Once Black mixed up the move order, White could give a knight for a long-lasting attack. Black was a knight up, but his king was under fire the whole time, and he resigned after only 19 moves:

Kasparov resigned here. White's queen, rook and bishops are all aimed at the black king, and Black's knight is about to be lost.

How computers play

Looking ahead: search

The computer lists out "I play this, my opponent answers that, I play this…", like a tree that keeps growing. A good engine cuts off the obviously bad branches early and spends its time on the promising moves, so it can look at tens of millions of positions in a second.

Keeping score: evaluation

At some depth it has to stop and give the position a score: who has more material, how safe the kings are, how good the pawn structure is, how active the pieces are. The score is usually measured in pawns. +1 means White is ahead by about a pawn.

Knowing the answer: tablebases

With seven pieces or fewer left on the board, the computer doesn't need to calculate. The result of every such position has already been worked out and stored in a database called a tablebase. The results in this site's endgame articles are confirmed with a tablebase.

AlphaZero and neural networks

In 2017, DeepMind's AlphaZero was given nothing but the rules. It played millions of games against itself and, in just a few hours, became stronger than the best engine of the time. In a 100-game match it won 28, drew 72 and didn't lose a single one.

AlphaZero played in a surprisingly human style: it was happy to sacrifice for long-term gains and loved putting its pieces on active squares. Later, the open-source Leela Chess Zero rebuilt it the same way so that everyone could use it.

Stockfish: the strongest engine today

Stockfish is a free, open-source engine, improved by volunteers all over the world. Since 2020 it has used a small neural network on top of its classic search to evaluate positions, which made it even stronger. It now wins most computer-vs-computer events, and it is far stronger than any human player.

AI that plays like a person: Maia

The strongest engines aren't much use to a beginner. They're too strong, and when they're told to go easy, they play strange moves no human would play. A research team at the University of Toronto built Maia. It was trained on a huge number of games played by real people, and its goal isn't to win but to guess "what would a player at this rating play here?" So it makes the same kinds of mistakes real people make, and it feels more natural to play against.

This site's computer opponents

The four levels on this site use exactly these two kinds of AI: Beginner, Intermediate and Advanced are played by Maia, and Master is Stockfish. They all run in your browser, with no server needed. To see roughly what rating each level matches, read ratings and titles. For help choosing a level, read computer opponents and levels.

Frequently asked questions

Can anyone still beat the strongest computers?

In a normal game, almost never. Top engines are far stronger than the world champion. Even a grandmaster does very well just to draw.

How do professional players use computers?

Mostly to prepare openings and to check their own games. Using a computer during a game in an official event is serious cheating and gets you disqualified.

What happened to Deep Blue?

After the 1997 match, IBM retired Deep Blue and it never played again. One of its cabinets later ended up in a museum.

Give it a try

Want to feel what it's like to be crushed by an engine? Play chess online and pick Master. For something more relaxed, choose Beginner or Intermediate and see what mistakes a human-like AI makes.

Practise in a game