Why AI Chess Bots Are Virtually Unbeatable ft GothamChess WIRED

judicious
3 followers
AI Generated·May contain errors
Video Summary
AI GeneratedLevi Rosman explores the mechanics of Stockfish 16, the world's strongest chess engine, through a discussion with software engineer Gary Linscott. The video explains how Stockfish utilizes massive computational power, neural networks, and specialized search techniques to surpass human capabilities and redefine chess strategy.
Comments are disabled for this video.
I'm about to play Stockfish 16,
the strongest chess computer in the world,
and we are going to see how long I can survive.
What?
What the f*** is that?
Yeah, I'm fine.
I'm not fine.
Queen takes bishop, checkmate.
That was horrible.
I never want to do that again.
I got checkmated in 34 moves.
The most important thing is I had a lot of fun.
No, I didn't.
My name is Levi Rosman.
I want to find out a little bit more
about how Stockfish thinks
so I can use its tricks to beat other humans.
Today, we'll talk to Gary Linscott,
software engineer who has worked in computer chess
for over 20 years.
So Gary, you worked on Stockfish.
What exactly makes it so good?
Stockfish really takes advantage
of super powerful computers.
It searches tens of millions of positions per second.
So if you give it 30 seconds,
it's going to be searching upwards of a billion positions.
And that's more positions
than a human will see in their entire lifetime.
I could live a hundred lifetimes.
I would not be able to win this game.
Not only that, the evaluation function it uses,
it's a way of assessing the board
by itself is probably stronger
than almost all the chess players in the world.
Your chess ELO is basically a number
that quantifies your skill level.
The highest ever ELO achieved by a human
is by Magnus Carlsen.
My ELO right now is 2,322.
What exactly is Stockfish's ELO right now?
It's probably greater than 3,500.
I never had a chance.
To understand how Stockfish actually thinks,
we should start at the very beginning of the game.
Most chess openings are subjective for humans.
A human will choose an opening
because they get more fun out of it.
You might like something because it gives you a big center
or very active pieces.
That's how most players choose their openings.
In my game against Stockfish, I played Pawn to D4.
Let's see which opening Stockfish plays.
And it responded, Knight to F6.
Gary, so the way humans learn chess openings,
we read books, we create chess files,
and we try to memorize them
because we can't access them during tournament games.
That would be like cheating on a school test.
An opening book in chess is a gigantic chess database.
Does Stockfish have a chess opening opinion
as early as the second or even first move?
The way that it thinks about the opening
is really different than a human.
It is not using chess theory.
It very rarely assesses an opening position.
What it's assessing is the resulting structures
that might evolve from that opening,
but way, way down the game tree.
It's already assessing the end game right from the get-go.
So on its second move, Stockfish played D5,
which is a very popular move.
And here I made a decision to capture this Knight.
Humans might see doubled Pawns and feel unpleasant.
They might see a weakness in their position.
Does Stockfish have these little buzzwords like weakness
or inactive piece?
What actually goes into that?
The evaluation function is trained
off of a huge library of chess games that have been played.
And so it kind of absorbs that knowledge.
It's just all going into a giant neural net,
and then you can train your evaluation function
to learn what's good and what's bad.
And then that network runs when Stockfish
is searching the position
and then uses it to navigate the opening.
So to succeed in our quest of understanding Stockfish
a little bit better, let's dive into middle games.
Most middle games begin around move 10 to 15.
It's the stage right after the opening
when you've gotten all your pieces out.
You can think of the middle game in chess
as a gigantic ocean, this massive tree of possibility.
So in my middle game against Stockfish,
pawn to C4 is what I played.
Stockfish played a move that I don't think
any human being would play here against me.
The absurd pawn to G5, which made me audibly gasp.
Oh, what is that?
Oh my God, is that actually the best move in the position?
That move violates most human chess principles
that we have been brought up with.
You shouldn't push pawns in front of your king.
You should not weaken an area of the board
where you can't claim any advantage.
How does Stockfish break these age-old principles?
In this case, it might just be that the move
is too far past kind of the human frontier
to be a reasonable one.
It's gonna assess every possible move
and it's gonna rank them.
It all comes down to a single number,
which is what's the likelihood
that I'm gonna win from this position?
Stockfish doesn't have emotions and opinions.
It will just play the best move that it thinks exists.
Yes, Stockfish definitely does not emotionally consider it.
It is assessing with like grandmaster level quality,
but it then searches 50 moves, 60 moves into the future
to evaluate what is the best possible move.
I'm curious, like as an incredibly strong human,
how many moves do you search into the future?
I didn't realize this was the roast of Levi Rosman.
Sometimes I can go 10 moves.
If it's an end game position
and I can kind of identify the forcing moves for both sides.
Sometimes I'm stuck in a middle game
and I'm already indecisive.
It's like being at a restaurant
and you have three good options.
They're all very difficult to evaluate
and I'll flip a coin,
but that doesn't work against Stockfish.
I counted in this position, Black has 41 legal moves.
How does Stockfish know which of those to scrub
and ultimately decide on one
if three or four look really, really good?
It builds a game tree
and that game tree is gonna have all the legal moves.
It's gonna rank all of those moves.
It takes one step forward at a time.
It'll search two moves ahead,
then three moves ahead, then four moves ahead.
Three or four moves speak to me in about five seconds
and that's probably why I'm a good speed chess player,
but deciding on the best move,
sometimes I need to spend five minutes, 10 minutes
uncovering the truth about one of those moves.
Chess computers actually do a similar sort of process.
Stockfish actually only looks
at about two moves per position.
That's what's called the alpha beta search technique,
which is what Stockfish
and most other engines are built on top of.
Alpha beta allows the engine to eliminate
many, many moves from a position
because it knows that they are worse
than the best move that it's found so far.
And that allows alpha beta to prune
a huge amount of the search trees.
For example, if it was White's move,
one of the legal moves is Knight to E4,
which is really, really stupid
because the pawn would take the Knight
and White would be at a catastrophically worse position.
Some computers will just be able to discard this right away
and humans will too.
Alpha beta by itself can take those 35 moves
that you have to look at on average
down to about 15 or so, which is a huge reduction.
The last stage of chess is the end game.
Is there any difference in the way
that Stockfish approaches the end game
versus the middle game or the opening?
Yes.
Once the number of pieces goes below a certain amount,
seven, then Stockfish can actually solve the game perfectly.
Chess is solved if there are seven pieces
remaining on a chess board or less.
Exactly, yeah.
There's what are called end game table bases.
And by solved, we mean literally
every combination of moves possible.
If the Bishop goes here and the Knight goes here,
or if the Bishop goes to that square originally
and the Knight goes there or there or there
or any of these combinations, all of that is solved.
Literally, Stockfish just has to look up
the position in its database
and it knows exactly what the answer is.
Even for seven pieces,
it's only about 10 to 20 terabytes of data,
which is a lot, but manageable.
There is no more evaluating.
A best move is the best move
and a position is either winning, a draw, or losing,
and that's it.
It's completely non-negotiable.
Exactly.
Now, the chess computers are capable of playing
without the table bases as well,
and they will still play incredibly strong chess there,
but they could make a mistake.
Gary, I lost to Stockfish.
I got checkmated in 34 moves.
We didn't make it into an end game.
All right.
But that's just as well.
Stockfish always knows how to close out a game
in the least amount of moves,
even when the world's greatest players don't.
I have a game here,
Magnus Carlsen versus Fabiano Caruana
from the 2018 World Chess Championship.
Magnus was in an end game where he was down a piece,
but neither one of them found the right technique.
Fabiano has a bishop and a knight,
and Magnus only has a bishop.
Fabiano could not convert despite his extra material
because it looked like Magnus had a defensive fortress.
The game ended in a draw.
While the players were playing
and the entire world was watching,
Stockfish was screaming at them
from the digital cyberspace going,
you idiots forced checkmate in 35 moves.
That is ridiculous.
Like how could it have possibly known
that if both sides made a move for 35 moves,
Black would win?
What Stockfish can do is look forward into the table bases
and every path to the table bases,
the best that you can possibly do is that mate in 35.
If Stockfish was playing Black here instead of Fabiano,
it would have played bishop to H4.
Then bring its knight here
and then trap its own knight on the edge of the board.
So the knight now cannot escape anywhere
because White's bishop would take it.
No human being would play chess like this.
You cannot trap your knight on the edge of the board,
but apparently White actually runs out of moves first
and slowly but surely, Black would have won that end game.
Stockfish saw that from a distance.
No human on the planet saw that.
So Stockfish is a very, very specialized AI.
How does it compare to some other AIs?
Autonomous cars or something else?
Stockfish is only good at one thing
and it's super good at that one thing,
which is playing chess.
Chess engines have now borrowed the state-of-the-art research
in artificial intelligence, which is deep learning.
However, they're still fundamentally limited
to the domain of chess.
Chess has, I think, been opened up in a way by AI.
People can leverage the chess engines
to improve their own skills.
And that's kind of like the ideal use case
for AI technologies is that they help humans
do things better.
I agree with Gary.
I think AI has been a net benefit for chess.
I think it's helping people improve at a rate
like we've never experienced.
We do obviously have to tackle the issue
of potential cheating,
but I'm gonna stay positive and optimistic.
Anyway, now that I know a little bit more about Stockfish,
I'm gonna go have my rematch.
