• last year
"I got checkmated in 34 moves." Levy Rozman a.k.a. GothamChess plays chess against Stockfish 16, the strongest chess computer in the world, and analyzes the way it thinks in order to apply it to his own gameplay. With help from computer chess software engineer Gary Linscott, these chess pros identify why Stockfish is virtually unbeatable by a human, from opening move to endgame.The charts depicting minimax with alpha-beta pruning was created by Wikipedia user Maschelos and is licensed under the Creative Commons Attribution-Share Alike 3.0 license.Director: Lisandro Perez-ReyDirector of Photography: Francis BernalEditor: Paul IsaksonTalent: Gary Linscott; Levy RozmanLine Producer: Joseph BuscemiAssociate Producer: Paul Gulyas; Brandon WhiteProduction Manager: D. Eric MartinezProduction Coordinator: Fernando DavilaCamera Operator: Brittany BergerGaffer: Mar AlfonsoSound Mixer: Michael GugginoProduction Assistant: Albie SmithPost Production Supervisor: Alexa DeutschPost Production Coordinator: Ian BryantSupervising Editor: Doug LarsenAssistant Editor: Andy Morell
Transcript
00:00 I'm about to play Stockfish 16,
00:01 the strongest chess computer in the world,
00:03 and we are going to see how long I can survive.
00:06 What?
00:06 What the (beep) is that?
00:08 Yeah, I'm fine.
00:09 I'm not fine.
00:10 Queen takes bishop, checkmate.
00:12 That was horrible.
00:13 I never want to do that again.
00:14 I got checkmated in 34 moves.
00:16 The most important thing is I had a lot of fun.
00:18 No, I didn't.
00:19 My name is Levi Rosman.
00:20 I want to find out a little bit more
00:21 about how Stockfish thinks
00:22 so I can use its tricks to beat other humans.
00:26 Today, we'll talk to Gary Linscott,
00:28 a software engineer who has worked in computer chess
00:30 for over 20 years.
00:31 So Gary, you worked on Stockfish.
00:33 What exactly makes it so good?
00:34 Stockfish really takes advantage
00:37 of super powerful computers.
00:38 It searches tens of millions of positions per second.
00:42 So if you give it 30 seconds,
00:44 it's going to be searching upwards of a billion positions.
00:47 And that's more positions than a human will see
00:49 in their entire lifetime.
00:50 I could live a hundred lifetimes.
00:51 I would not be able to win this game.
00:52 Not only that, the evaluation function it uses,
00:55 it's a way of assessing the board by itself
00:57 is probably stronger than almost all the chess players
01:01 in the world.
01:01 Your chess elo is basically a number
01:03 that quantifies your skill level.
01:05 The highest ever elo achieved by a human
01:07 is by Magnus Carlsen.
01:08 My elo right now is 2,322.
01:11 What exactly is Stockfish's elo right now?
01:14 It's probably greater than 3,500.
01:17 I never had a chance.
01:18 To understand how Stockfish actually thinks,
01:20 we should start at the very beginning of the game.
01:23 Most chess openings are subjective for humans.
01:26 A human will choose an opening
01:27 because they get more fun out of it.
01:29 You might like something because it gives you a big center
01:32 or very active pieces.
01:34 That's how most players choose their openings.
01:36 In my game against Stockfish, I played Pawn to D4.
01:39 Let's see which opening Stockfish plays.
01:41 And it responded, Knight to F6.
01:44 Gary, so the way humans learn chess openings,
01:46 we read books, we create chess files,
01:48 and we try to memorize them
01:49 'cause we can't access them during tournament games.
01:52 That would be like cheating on a school test.
01:53 An opening book in chess is a gigantic chess database.
01:57 Does Stockfish have a chess opening opinion
01:59 as early as the second or even first move?
02:02 The way that it thinks about the opening
02:03 is really different than a human.
02:05 It is not using chess theory.
02:07 It very rarely assesses an opening position.
02:09 What it's assessing is the resulting structures
02:13 that might evolve from that opening,
02:14 but way, way down the game tree.
02:17 It's already assessing the end game right from the get-go.
02:20 So on its second move, Stockfish played D5,
02:23 which is a very popular move.
02:24 And here I made a decision to capture this Knight.
02:27 Humans might see double pawns and feel unpleasant.
02:31 They might see a weakness in their position.
02:34 Does Stockfish have these little buzzwords
02:35 like weakness or inactive piece?
02:38 What actually goes into that?
02:40 The evaluation function is trained off of a huge library
02:44 of chess games that have been played.
02:46 And so it kind of absorbs that knowledge.
02:48 It's just all going into a giant neural net,
02:50 and then you can train your evaluation function
02:53 to learn what's good and what's bad.
02:55 And then that network runs
02:57 when Stockfish is searching the position
02:59 and then uses it to navigate the opening.
03:01 - So to succeed in our quest
03:03 of understanding Stockfish a little bit better,
03:05 let's dive into middle games.
03:07 Most middle games begin around move 10 to 15.
03:09 It's the stage right after the opening,
03:11 when you've gotten all your pieces out.
03:13 You can think of the middle game in chess
03:14 as a gigantic ocean, this massive tree of possibility.
03:18 So in my middle game against Stockfish,
03:20 pawn to C4 is what I played.
03:21 Stockfish played a move that I don't think
03:23 any human being would play here against me,
03:25 the absurd pawn to G5, which made me audibly gasp.
03:29 Ho, ho, ho, ho, what is that?
03:31 Oh my God, is that actually the best move in the position?
03:33 That move violates most human chess principles
03:37 that we have been brought up with.
03:38 You shouldn't push pawns in front of your king.
03:40 You should not weaken an area of the board
03:43 where you can't claim any advantage.
03:45 How does Stockfish break these age-old principles?
03:48 - In this case, it might just be
03:50 that the move is too far past kind of the human frontier
03:55 to be a reasonable one.
03:56 It's gonna assess every possible move
03:59 and it's gonna rank them.
04:00 It all comes down to a single number,
04:02 which is what's the likelihood
04:03 that I'm gonna win from this position?
04:05 - Stockfish doesn't have emotions and opinions.
04:08 It will just play the best move that it thinks exists.
04:11 - Yes, Stockfish definitely does not
04:13 emotionally consider it.
04:14 It is assessing with like grandmaster level quality,
04:18 but it then searches 50 moves, 60 moves into the future
04:21 to evaluate what is the best possible move.
04:24 I'm curious, like as an incredibly strong human,
04:26 how many moves do you search into the future?
04:29 - I didn't realize this was the roast of Levi Rosman.
04:31 Sometimes I can go 10 moves.
04:34 If it's an end game position
04:35 and I can kind of identify the forcing moves for both sides.
04:39 Sometimes I'm stuck in a middle game
04:40 and I'm already indecisive.
04:42 It's like being at a restaurant
04:43 and you have three good options.
04:44 They're all very difficult to evaluate and I'll flip a coin,
04:47 but that doesn't work against Stockfish.
04:49 I counted in this position, Black has 41 legal moves.
04:53 How does Stockfish know which of those to scrub
04:56 and ultimately decide on one
04:57 if three or four look really, really good?
05:00 - It builds a game tree
05:01 and that game tree is gonna have all the legal moves.
05:04 It's gonna rank all of those moves.
05:06 It takes one step forward at a time.
05:08 It'll search two moves ahead, then three moves ahead,
05:10 then four moves ahead.
05:11 - Three or four moves speak to me in about five seconds
05:15 and that's probably why I'm a good speed chess player,
05:18 but deciding on the best move,
05:20 sometimes I need to spend five minutes, 10 minutes
05:22 uncovering the truth about one of those moves.
05:24 - Chess computers actually do a similar sort of process.
05:26 Stockfish actually only looks
05:28 at about two moves per position.
05:30 And that's what's called the alpha beta search technique,
05:32 which is what Stockfish and most other engines
05:35 are built on top of.
05:36 Alpha beta allows the engine to eliminate many, many moves
05:40 from a position because it knows that they are worse
05:43 than the best move that it's found so far.
05:45 And that allows alpha beta to prune a huge amount
05:47 of the search trees.
05:48 - For example, if it was White's move,
05:50 one of the legal moves is knight to E4,
05:53 which is really, really stupid
05:55 because the pawn would take the knight
05:57 and White would be at a catastrophically worse position.
06:00 Some computers will just be able to discard this right away
06:04 and humans will too.
06:05 - Alpha beta by itself can take those 35 moves
06:08 that you have to look at on average down to about 15 or so,
06:12 which is a huge reduction.
06:13 - The last stage of chess is the end game.
06:16 Is there any difference in the way that Stockfish
06:19 approaches the end game
06:20 versus the middle game or the opening?
06:22 - Yes.
06:23 Once the number of pieces goes below a certain amount, seven,
06:26 then Stockfish can actually solve the game perfectly.
06:29 - Chess is solved if there are seven pieces
06:33 remaining on a chess board or less.
06:35 - Exactly, yeah.
06:36 There's what are called end game table bases.
06:38 - And by solved, we mean literally every combination
06:42 of moves possible.
06:43 If the bishop goes here and the knight goes here,
06:45 or if the bishop goes to that square originally
06:47 and the knight goes there or there or there
06:49 or any of these combinations, all of that is solved.
06:53 - Literally Stockfish just has to look up the position
06:56 in its database and knows exactly what the answer is.
06:59 Even for seven pieces,
07:00 it's only about 10 to 20 terabytes of data,
07:03 which is a lot, but manageable.
07:05 - There is no more evaluating.
07:06 A best move is the best move
07:08 and a position is either winning a draw or losing
07:12 and that's it.
07:13 It's completely non-negotiable.
07:14 - Exactly.
07:15 Now, the chess computers are capable of playing
07:18 without the table bases as well
07:20 and they will still play incredibly strong chess there,
07:23 but they could make a mistake.
07:25 - Gary, I lost to Stockfish.
07:26 I got checkmated in 34 moves.
07:28 We didn't make it into an end game.
07:30 All right.
07:31 - But that's just as well.
07:32 Stockfish always knows how to close out a game
07:34 in the least amount of moves,
07:35 even when the world's greatest players don't.
07:37 - I have a game here,
07:38 Magnus Carlsen versus Fabiano Caruana
07:40 from the 2018 World Chess Championship.
07:42 Magnus was in an end game where he was down a piece,
07:45 but neither one of them found the right technique.
07:48 Fabiano has a bishop and a knight
07:50 and Magnus only has a bishop.
07:51 Fabiano could not convert despite his extra material
07:54 because it looked like Magnus had a defensive fortress.
07:57 The game ended in a draw.
07:58 While the players were playing
08:00 and the entire world was watching,
08:01 Stockfish was screaming at them
08:03 from the digital cyberspace going,
08:04 you idiots forced checkmate in 35 moves.
08:08 That is ridiculous.
08:09 Like how could it have possibly known
08:11 that if both sides made a move for 35 moves,
08:13 black would win?
08:14 - What Stockfish can do is look forward
08:18 into the table bases and every path to the table bases,
08:22 the best that you can possibly do is that mate in 35.
08:24 - If Stockfish was playing black here instead of Fabiano,
08:27 it would have played bishop to H4.
08:29 Then bring its knight here
08:32 and then trap its own knight on the edge of the board.
08:35 So the knight now cannot escape anywhere
08:37 because white's bishop would take it.
08:39 No human being would play chess like this.
08:41 You can not trap your knight on the edge of the board,
08:44 but apparently white actually runs out of moves first
08:47 and slowly but surely black would have won that end game.
08:50 Stockfish saw that from a distance.
08:52 No human on the planet saw that.
08:54 So Stockfish is a very, very specialized AI.
08:58 How does it compare to some other AIs?
09:00 Autonomous cars or something else?
09:02 - Stockfish is only good at one thing
09:05 and it's super good at that one thing,
09:07 which is playing chess.
09:08 Chess engines have now borrowed the state of the art research
09:11 in artificial intelligence, which is deep learning.
09:13 However, they're still fundamentally limited
09:15 to the domain of chess.
09:17 Chess has, I think, been opened up in a way by AI.
09:22 People can leverage the chess engines
09:24 to improve their own skills.
09:26 And that's kind of like the ideal use case
09:28 for AI technologies is that they help humans,
09:32 you know, do things better.
09:33 - I agree with Gary.
09:34 I think AI has been a net benefit for chess.
09:37 I think it's helping people improve at a rate
09:39 like we've never experienced.
09:40 We do obviously have to tackle the issue
09:42 of potential cheating,
09:43 but I'm gonna stay positive and optimistic.
09:45 Anyway, now that I know a little bit more about Stockfish,
09:47 I'm gonna go have my rematch.
09:49 (electronic music)
09:52 [BLANK_AUDIO]

Recommended