8

I'm particularly thinking of Stockfish here, since that is the one I use most, but it seems to happen with other engines.

Sometimes you have a position and the recommended move for white might be +1.7 say. So you make the move and then for black the best move is suggested as being +0.6.

Is this because:

A) The engine is not perfect, so if it can search 19 moves ahead, then after the move it can search one ply further into the game, and that reveals something that dramatically changes the score. If so, what does this tell us about the position?

Or

B) Does the engine take into account the possibility that the opponent won't play optimally. E.g. does the engine assign any value to traps that are avoidable. For example, Given a choice between going directly to a position, or transposing to that position via offering a trap you should clearly try the trap first. Would the engine agree? Is the score only reflecting the "best" line, or some average of possible lines?

1
  • B is doubtful, because popular engines assume best play in their evaluation. The answer definitely deals with imperfections in the algorithm that come from practical considerations like finite resources. The problem shouldn't be present as often if you let the engine explore a position to a decent depth. For example, you might get +1.6 after 3 hours on one position, but it started off +2.1 or +0.8 when it didn't look as far. When you make a move, the depth is low once again, but after reaching a good depth, the number should be similar to +1.6. Evals will slowly drift even with engine moves.
    – user904963
    Aug 8, 2022 at 20:01

4 Answers 4

6

I assume you used Stockfish with a GUI because the sign of the score would have been different if you didn't.

First of all, Stockfish is well known for its instability. The strongest chess engine isn't the best engine for analysis. This is like your local chess instructor might be a better coach than Kasparov for you.

A is obviously correct. Furthermore, the search algorithm could change as the hash-table gets filled up. The more that the engine "knows" about a particular position, the better it can analyse for the next position.

9
  • 1
    How can you tell what the sign is supposed to be - I just made some numbers up. It could either be 0.6 in white's favour (what I meant) or 0.6 in black's favour and it still works :-)
    – Corvus
    May 6, 2015 at 10:23
  • 5
    What engine would you recommend for analysis?
    – Corvus
    May 6, 2015 at 10:24
  • Stockfish is not bad, it is one amongst the strongest engines, you can continue using it to analyze. Also other recommended engines are - Deep Fritz and Houdini May 6, 2015 at 11:38
  • 5
    How is instability related to being a good engine for analysis? I'd rather use an engine which honestly tells me if it is unsure of its analysis than an engine which confidently gives a possibly wrong score.
    – JiK
    May 6, 2015 at 12:44
  • 1
    @StudentT As I said, I think it is good if the heuristic moves like a roller-coaster if there is something in the position which makes the engine "unsure" about the value.
    – JiK
    May 6, 2015 at 20:57
4

Stockfish 9 and 10 had contempt set to 20 or so by default, so that the engine would avoid draws when playing against weaker opponents (i.e. most other engines and all humans). If you change the contempt to 0 when analyzing, that should bring the evaluations with white or black to move closer to the same number.

1
  • Your answer is technically correct, but it's not what the question asked for.
    – SmallChess
    Feb 13, 2019 at 11:15
2

Yes, it's A). The engine is not perfect and can only search so far in a given time. When you make a move for White, the engine doesn't have to waste time considering White's other options anymore. It can focus on only searching down the sub-tree rooted at the move you just made for White.

It's hard to say what this means about the positions that Stockfish is calculating. You might be tempted to say that the positions are tense and very sharp. However, using quiescence search, Stockfish tends to avoid evaluating such positions and waits until the game calms down. So it's hard to infer what the positions are like.

1

Engines like Stockfish use something called the Minimax Algorithm, which in short means that the engine always assumes best play by the opponent.

That means it will not go for any traps if it sees a refutation that is beneficial to the opponent.

The algorithm basically works so that it looks at as many positions as possible, and applying an evaluation function to them. Stockfish is extremly fast at calculating positions and thus looking pretty far ahead, but its evaluation function isn't as precise as that of Komodo, for example.

As a consequence, the evaluation can vary quite a bit, depending on how many positions it had time to calculate. Playing a move obviously limits the search space, so the engine can give a better analysis of that specific position, so it's more likely to find something that has a major impact on the evaluation.

TL;DR: Answer A is correct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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