To my knowledge, most modern chess programs use some kind of minimax algorithm, effectively choosing the best moves for both sides. So, no matter how poorly I play, at every new move Stockfish expects me to make the strongest possible one. This approach guarantees the strongest, if more conservative, game and makes total sense.

Is there a program that would instead try to build a model of its opponent, assuming the most probable move (based on prior games and knowledge) instead of the strongest possible move?

  • 1
    It'd be an interesting idea, but it's hard to make an accurate profile of an opponent in a single game
    – David
    Commented Apr 20, 2023 at 7:20
  • @David, it doesn't have to be a single game. And it doesn't have to be an accurate profile either. For starters, maybe, just try to estimate the opponent's rating within 200 points or something like that. Commented Apr 20, 2023 at 8:10

2 Answers 2


Not really

Because these days, every engine developer tests their engine against itself. The process is to write a patch, then test the patched engine against the original. If the patched engine is superior, then retain the patched engine; otherwise keep the original. This necessarily does not involve profiling its opponent, although there can be a self-elo effect.

It's still only "not really" however, because there was at one point an attempt to train a neural network to beat Stockfish. You can read more about so-called "Antifish" on its Github page. The project has since been abandoned, because it 1) didn't beat Stockfish convincingly and 2) was clearly weaker than the engine it was derived from.

  • I understand why engines are built the way they are. But, in tennis terms, say, a program plays an overweight guy in his forties and he plays exactly like an overweight guy in his forties. But the program refuses to play a drop-shot against him, because it expects him to turn into young Rafael Nadal at any moment, instead of taking full advantage of his lack of stamina and speed. Commented Apr 20, 2023 at 8:18
  • @AndreiPetrenko yes, but - if your opponent does turn into Rafael Nadal and thereby wins the point because you hit a drop shot at a bad time, you are still the loser. See chess.stackexchange.com/questions/40979/… which is based on the similar concept of "if opponent has less time, let's make moves to which the best responses are 'hard to find'".
    – Allure
    Commented Apr 20, 2023 at 8:22
  • This approach makes more sense for the games with incomplete information (in chess you don't get bonuses for a quicker or "cooler" win) and I asked this question because computer chess has tons of research done already, and not because I'm trying to add a gimmick to Stockfish. But it still might be useful in chess as a gamble to try to get out of a potentially doomed position. Commented Apr 20, 2023 at 10:36

To the best of my knowledge, the closest thing to this that some mainstream chess programs used to do was book learning. I suppose that book learning might, over time, in principle learn to exploit killer variations that work against a particular opponent. Its main practical use, however, was to make sure opponents could not exploit killer variations in the engine's own repertoire too often. It is my impression that this is not done any more, probably mainly because the main computer chess tournaments use rigged openings nowadays to avoid draw death. In the same vein, killer variations are generally not considered much of an issue nowadays, because engines are good enough to deal reasonably with anything with either no book or a shallow solid book anyway.

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.