Answers.Body: <p><strong>Not really</strong></p>
  <p>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.</p>
  <p>It's still only &quot;not really&quot; however, because there was at one point an attempt to train a neural network to beat Stockfish. You can read more about so-called &quot;Antifish&quot; on its <a href="https://github.com/Cscuile/AntiFish-MERGED-With-BetaOne" rel="noreferrer">Github page</a>. 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.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-20T08:18:51.780Z
Answers.Text: 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.
Answers.UserDisplayName: Andrei Petrenko
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-20T08:22:03.240Z
Answers.Text: @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 https://chess.stackexchange.com/questions/40979/why-dont-chess-engines-take-into-account-the-time-left-by-each-player/40988#40988 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'".
Answers.UserDisplayName: Allure
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-20T10:36:51.783Z
Answers.Text: 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.
Answers.UserDisplayName: Andrei Petrenko
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-20T05:13:22.030Z
Answers.LastActivityDate: 2023-04-20T05:13:22.030Z
Answers.UserDisplayName: Allure
Answers.Body: <p>To the best of my knowledge, the closest thing to this that some mainstream chess programs <em>used</em> to do was <a href="https://www.chessprogramming.org/Book_Learning" rel="nofollow noreferrer">book learning</a>. 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.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-20T06:16:15.027Z
Answers.LastActivityDate: 2023-04-20T06:16:15.027Z
Answers.UserDisplayName: Polytropos
Body: <p>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.</p>
  <p>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?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-04-20T07:20:29.583Z
Comments.Text: It'd be an interesting idea, but it's hard to make an accurate profile of an opponent in a single game
Comments.UserDisplayName: David
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-04-20T08:10:29.863Z
Comments.Text: @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.
Comments.UserDisplayName: Andrei Petrenko
Tags: <engines><programming>
Title: Is there a chess program that profiles its opponent?
ThreadText: # Is there a chess program that profiles its opponent?
  
  (Asked by: username_0 on 2023-04-19)
  
  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?
  
  **Tags:** engines, programming
  
  > **Comments:**
  > **username_1**: It'd be an interesting idea, but it's hard to make an accurate profile of an opponent in a single game  
  > **username_0**: @username_1, 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.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2023-04-20. Score: 5
  
  **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](https://github.com/Cscuile/AntiFish-MERGED-With-BetaOne). 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.
  
  > **Comments:**
  > **username_0**: 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.  
  > **username_2**: @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 https://chess.stackexchange.com/questions/40979/why-dont-chess-engines-take-into-account-the-time-left-by-each-player/40988#40988 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'".  
  > **username_0**: 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.  
  
  ---
  
  ### Answer by username_3 on 2023-04-20. Score: 2
  
  To the best of my knowledge, the closest thing to this that some mainstream chess programs *used* to do was [book learning](https://www.chessprogramming.org/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.
  
  
  ---
  
  