7

Consider a chess position like this one:

[FEN "K7/4k1p1/8/8/3B4/8/8/8 w - - 0 1"]

1. Ka7 (1. Bxg7) 1... g5 2. Ka6 Kd6 3. Ka5 Kd5 4. Ba7 Kc4 5. Bb6 Kc3 6. Bc5 Kb2 7. Ka4 Ka1 8. Kb3 g4 9. Kc2 g3 10. Bb4 g2 11. Bc5 g1=N (11... g1=Q 12. Bxg1) 12. Bb4 Ne2 13. Bc5 Nc1 14. Ba3 Na2 15. Bb2#

No forced mate is possible there. But a helpmate is possible, so if Black runs out of time, or just plays exceptionally terribly, then White will win. Given that, why does Stockfish pick Bxg7 there, which immediately ends the game in a draw, rather than picking basically any other move (except for the losing Bf6+) to at least have some hope of winning?

13
  • 15
    You left out "or die from a heart attack" which is much better odds than the helpmate.
    – bof
    Jun 27 at 21:28
  • 7
    Engines are made to help us find "objective truth" about a posiiton. They're meant to be analysis tools, not competitive players
    – David
    Jun 27 at 22:11
  • 2
    If you're hoping b might run out of time or blunders and let you have a win instead of a draw, why aren't you worried that you might run out of time or blunder and take a loss instead of an easy draw? Jun 28 at 15:15
  • 2
    I'm going to give an unusual answer. Another answer said: > Engines don't play "hope chess" So I ask back: Why not? I think it would definitely be possible to construct an engine that plays hope chess successfully. It would be an engine constructed to play specifically against humans. I understand that engines are often built and calibrated by playing against themselves or against other engines. Doing that optimizes playing strength when fighting an engine. You could make an engine that fights humans specifically. Humans do this all the time. Many GM-level games are fought with some componen
    – usr
    Jun 29 at 10:55
  • 2
    @JosephSible-ReinstateMonica Indeed. Most of these answers sell themselves short of the point because your question doesn't indicate that 1) you know engines assume optimal followup as best they can, 2) you know contempt exists. The real answer to your question is twofold: firstly, contempt settings do not exist to this degree (i.e. to be able to expect a helpmate, or even random play); secondly, even if they did, and were turned on, Stockfish is just not built to solve helpmate puzzles (so it just will not see the path to the helpmating position you mention). Jun 29 at 21:41
14

Unlike playing with people, an engine will make the best move it can find, assuming perfect play on the part of the opponent. Engines don't play "hope chess" - they don't assume (or hope) that the opponent will make a mistake.

10
  • 2
    Isn't the concept of contempt in chess engines exactly that they don't assume their opponent is perfect? Jun 28 at 0:45
  • 14
    @JosephSible-ReinstateMonica You'd need a lot of contempt for your opponent to think they might helpmate with an underpromotion. Jun 28 at 1:53
  • 3
    @eyeballfrog it's a miniscule chance, but non-zero. Surely an engine would see almost zero as preferable to zero
    – Darren H
    Jun 28 at 9:35
  • 4
    Isn't the point about the possibility of a helpmate not that there's any realistic chance that black will help white deliver mate but rather that because mate is still possible in principle, if black runs out of time then the result will be a W win rather than a draw? Jun 28 at 11:31
  • 2
    @DarrenH Engines like Stockfish don't “comprehend” of that as a possibility.
    – wizzwizz4
    Jun 28 at 13:25
9

Engines are usually coded with the assumption that their opponent will play the best moves that they can imagine, as pointed out by Pat Barron above. This is called a minimax decision rule.

Just to explain why this rule is used - it is a simplifying assumption. If you code or train the engine any other way, you will need two models - one for the opponent, and one for the engine. Using minimax, you only need one model - the engine effectively assumes it is playing itself and acts accordingly.

The idea of exploiting opponents based on a reading of their ability is a very interesting one, but it would be a wholly different challenge to just learning to play chess as well as you can. The problem with an engine that assumes its opponent is weak, is that (for example) you can hustle it by pretending to be weak, and springing a trap. AI algorithms tend to be extremely fragile to exploitative attacks like this, and have limited ability to learn between games to prevent it happening over and over again.

2
  • very interesting but I've never heard of AI (neural networks at least) being used for contempt. Can you expand your idea - how exactly could the engine build up 'a model' of the opponent, playing any differently to the moves the engine considers optimal? Jun 29 at 19:26
  • 1
    @Mobeus Zoom By AI I meant the old sense - any algorithm, not necessarily a sophisticated model. A very simple way would be to adjust contempt linearly depending on the estimated quality of the opponent's moves. This may or may not work. Another method would be to try to infer the opponent's next move, given their previous moves - so rather than train their model to win, train it to imitate opponents based on real play data. Here's some research on this
    – dilaudid
    Jun 29 at 20:37
1

The situation above is that if white makes any move other than Bxg7.

Then black goes g1=Q and has the advantage with the possibility of a win if black can take the bishop.

The table has a list of draws, they all assume that white plays a lot better than ignoring taking a pawn that is about to be promoted.

1
  • After g1=Q, the next move would be Bxg1, which is a draw. And it's easy to make sure the bishop doesn't get taken. Jun 28 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.