Chess as a window onto cognition

Chess offers us an interesting window into cognition. Millions of chess games are available for free. Games come labeled with the rough level of expertise (available from rank novices through super-grandmasters) and also the available amount of time (ranging from just three minutes for all moves in bullet chess through a leisurely week or longer per move in correspondence chess). Furthermore, given the strong chess engines today that are magnitudes better than the best human players, it is possible to automatically label blunders (although we cannot accurately identify small mistakes).

In this post, I dwell on one aspect of chess thinking that is relevant to general cognition. In the next post, I look at patterns directing thought in chess. The post after that will discuss how the same ideas show up in language comprehension.

Chess Thinking

Chess thinking isn’t merely the mechanical calculation of a tree of possible moves and their replies. A lot is going on in the mind of the chess player. One particular aspect of this domain makes it a good subject for studying thinking: Chess thinking is a peculiar combination of vastness and limitedness: vastness from the myriad things to keep in mind when making a move, and limitedness from the finitely many possibilities at each step.

The complexity of thinking in chess arises from the many pressures pulling on a player. There is pressure to develop pieces, pressure to defend and avoid weaknesses, pressure to attack and pounce upon possible mistakes. A move that may confer some safety to your King may simultaneously be too passive, letting the opponent develop their pieces. A pawn move that helps protect against an imminent attack may at the same time irrevocably weaken the pawn chain and open up tempting outposts for the enemy Knight. Swinging the rook over to the Queenside to occupy an alluring open file may strengthen that area and yet dangerously weaken the kingside. A move may be short-term awesome and yet long-term dubious.

The things to think about are limitless, but the time to do that thinking is most definitely limited. A chess player must decide where to focus attention, which pressures to yield to, which of the many squeaking wheels to oil.

The point of studying this is that the lessons apply well beyond the chess board. The chaos of pressures pulling every which way is shared with all thinking, from everyday mundane conversations (even one as simple as deciding where to order food from) all the way to writing a book and beyond.

Chess Blunders

The notion that errors can help us see behind the cognitive scenes is beautifully argued by Douglas Hofstadter and David Moser in the paper “To err is human; to study error-making is cognitive science”. They look at verbal errors (malapropisms, spoonerisms, mixed metaphors and such), and if you enjoy wordplay, or enjoy cognitive science, you should read it.

Studying error-making in chess has one benefit over studying error-making in language. People sometimes make verbal “errors” on purpose. For example, several errors that Hofstadter and Moser describe may well have been in jest (and thus not errors): “The proposal is now cast in concrete. The only question is, will it fly?” and “I have a lot of irons in the fire but I am holding them close to my chest”. By contrast, if the chess blunder occurred in a world-championship match with the chess crown at stake, we can be sure that it was not intentional.

Alekhine’s Blunder

The moves that work are indicated by arrows below: move the Queen to h8. Black will be forced to capture it with the King (so far in this variation, White has lost his Queen without gaining anything). Now, however, the Knight can capture the pawn on f7 and fork the Black Queen and King, thereby winning back the lost Queen and an additional pawn.

It is amazing that Alekhine failed to see this simple sequence and moved his Bishop instead. Euwe also failed to see this on his turn: supporting his Queen with the Bishop avoids this sequence. When Alekhine made his next move, he still did not see this sequence. Finally, Euwe supported his Queen and made the sequence ineffective. The game meandered to a draw.

This raises a pair of related questions: “How does a potential move sequence get evoked in our minds?” and “What could have led to Alekhine’s and Euwe’s failure to see this fairly simple and routine sequence?”

Elimination vs. Generation

Elimination is the strategy followed by computers: make a list of all legal moves. For each, consider the possible replies, and for those, consider the possible replies, and on and on, until time permits, creating a virtual tree with the current position as the root and the many pathways the game could take as branches. An evaluation function tells the computer how good a position is.

This is not a very efficient strategy but can be dramatically speeded up by the notion of pruning: if a branch seems unpromising based on the evaluation function, we need not consider it further. Only the potentially good branches are explored deeper, making it possible for chess engines running on a cheap laptop to look dozens of steps ahead.

I call this strategy elimination since each possible move in considered, if only to be discarded quickly. If this is how people played chess, it would be a skill that cannot be ported to thinking in general. The limitedness of chess makes this strategy possible, since the universe of possible next moves is tiny and can be trivially listed. In real life, we have no such exhaustive catalogue of possible moves.

Generation, by contrast, comes up with a list of candidate moves suggested by the board. An open file or an unsupported enemy piece may suggest particular courses of action. Learning chess involves learning to spot patterns that can suggest specific actions. Consider this position with Black to play.

Any chess player immediately sees the winning move in the position above without spending even a nano second thinking about the five legal King moves or the eleven other Rook moves. The pattern of back-row checkmate is so ingrained even for relative novices that the move forces itself into consideration. Human players generate moves (often just one or two), and when they think about what the response might be, they again generate moves rather than thinking through all legal possibilities (except, perhaps, when they sense they are close to a forcing mate or when solving a puzzle; in those cases, the weirdest corner cases can matter, but in most situations in actual play, exploring all legal moves is a luxury too expensive to indulge). Indeed, many blunders involve thinking that the opponent would respond a certain way (“I am threatening their Queen, so they will obviously protect it”) but the opponent chooses a different course of action.

What about Grandmasters? Generation or Elimination? To my mind, the Alekhine-Euwe position offers a clear case of not having considered the best move (a miss-take that wouldn’t happen with elimination). If Alekhine had considered this position (shown below), there is no way he wouldn’t see that it is a great position. The Knight fork would scream at him just as surely as the back row mate screamed at you in the trivial position above. The only explanation here is that he did not generate this move at all, did not consider it for even a nano-second.

The position after one move by White and the only legal move by Black

So how might generation work?

I do unsupervised concept discovery at Pinterest (and previously at Google). Twitter: @amahabal