Answers.Body: <p>You can take a look at the <a href="https://github.com/CSSLab/maia-chess" rel="noreferrer">Maia Chess project</a>. What they've done is that they've built a customized version of Leela Chess wherein instead of the policy value looking for the best move, it looks for the most likely human move. The github has 9 weight files for lc0 from 1100 to 1900 elo.</p>
  <p>It claims to better predict the moves of players compared to Stockfish and Leela Chess. You can also play these bots at <a href="https://lichess.org/team/maia-bots" rel="noreferrer">Lichess</a>.</p>
  <p><a href="https://i.sstatic.net/aHkFC.png" rel="noreferrer"><img src="https://i.sstatic.net/aHkFC.png" alt="prediction accuracy of Maia versus Stockfish and Leela" /></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-12T02:48:16.830Z
Answers.LastActivityDate: 2020-11-13T00:14:52.677Z
Answers.LastEditDate: 2020-11-13T00:14:52.677Z
Answers.UserDisplayName: Kenn Costales
Answers.Body: <p>In theory, chess is a Markovian game -- the current state says it all, how you reach the current state, ie all the previous moves, doesn't matter. This is how computers play chess.</p>
  <p>For humans, previous moves matter a lot. On one hand, people think in plans, so could easily forgo better moves if it is not consistent with their plan. On the other hand, human mood swing also has a great effect. Reaching an endgame after a crazy tactical middle game or reaching the same endgame after many boring exchanges can lead to different moves onwards.</p>
  <p>So at least on this aspect, computers cannot play like humans.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-15T22:47:46.017Z
Answers.Text: "So at least on this aspect, computers cannot play like humans."  That is not necessarily true.  It is just that the computer would need to take this into account.
Answers.UserDisplayName: Evorlor
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-19T16:43:20.810Z
Answers.Text: A game's current board state isn't always sufficient to play the next move. The right to castle and the right to take en passant both depend on the move history.
Answers.UserDisplayName: HTTP 410
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-24T04:26:52.983Z
Answers.LastActivityDate: 2020-09-24T04:26:52.983Z
Answers.UserDisplayName: jf328
Answers.Body: <h2>Use a number of weak engines.  Make them vote.</h2>
  <p>Suppose you take any number of relatively weak engines - some with deep searches but poor evaluation heuristics, some with shallow searches, some using neural networks but with limited training, some with random factors added to make them blunder a bit - and at each turn you have them vote for the best move.  The result will be quite human-like - a fact that should not be too flattering for us humans!</p>
  <p>For the most part, the composite engine would play decently - some significant amount better than any individual engine.  It would rarely blunder blatantly, but it would miss deep tactics and subtle strategic moves.  In particular, it would rarely (if ever) make the &quot;computer move&quot;.  Most engines, when given a position where there is an obvious very good move and a completely opaque move that is infinitesimally better, have the search depth necessary to find the latter move and make it - thus revealing their inhumanity.  But most of our engines will either fail to find the weird move or their heuristic won't be fine enough to recognize its superiority.  The vote will usually go to the more obvious move.</p>
  <p>Engines also reveal their inhumanity in the precision of their defensive play and opening book.  Our composite engine would lack the search depth necessary for precise defense - even if a few of the constituent engines had the depth, they would be outvoted on occasion (and it takes just one mistake to seem human).  In the opening, the composite will stay on book for a while - although it will be hard to guess just which lines it will prefer.  But it won't be long before the book-less or book-light engines win a vote and make an &quot;imprecise&quot; move.  The quickest way to get the composite engine &quot;out of book&quot; would be to offer a sacrifice - the composite will surely be a sucker for opening gambits . . . just like most humans.</p>
  <p>To improve the effect, the length of time displayed between moves should be proportional to the amount of agreement between the engines.  If a move is unanimous to the engines, it likely would be obvious to a human, as well (if not simply forced).  If there is a lot of disagreement among the engines, than the position is likely a bit tricky and the sort which would cause a human mind to linger.  (Some adjustment would be required in the opening phase, in which the engines would surely have lots of disagreements simply because there isn't a lot going on in the position yet.)</p>
  <h2>Someone really needs to do this.</h2>
  <p>When I came across this question, I was a little surprised that no one knows of anyone who has tried this.  The Maia engine has a bit of this idea cooked in.  By trying to predict what an 1100-rated player will do, Maia achieves are rating of about 1500.  But Maia isn't a composite of a bunch of 1100-rated engines, like I propose.  Creating the composite that I describe doesn't seem like a difficult task.  If anyone knows of an attempt, I would love to hear about it.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-14T23:59:36.107Z
Answers.LastActivityDate: 2020-11-14T23:59:36.107Z
Answers.UserDisplayName: pokep
Answers.Body: <p>As far as I know, every chess playing program combines a depth-limited search of the game tree with a heuristic algorithm to estimate the favorability of each position. There's a tradeoff between using a cheaper heuristic allowing more positions to be evaluated and using a sophisticated heuristic on fewer positions.</p>
  <p>Humans play in more or less the same way, but evaluate far fewer positions using a far more sophisticated heuristic.</p>
  <p>I'd expect that the most human-like computer players would be the ones that evaluate the fewest positions per unit time using more sophisticated heuristics. <a href="https://en.wikipedia.org/wiki/AlphaZero" rel="nofollow noreferrer">AlphaZero</a>, for instance, evaluates about 0.1% as many positions as Stockfish (though still many orders of magnitude more than a human), and I'd expect it to be somewhat more human-like than Stockfish as a result. I have no actual experience to back that up, though.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-16T23:36:42.680Z
Answers.Text: I think this hyper bullet game: https://lichess.org/jCcbfpB8#1, where Leela blunders her queen in a human like fashion supports your reasoning.
Answers.UserDisplayName: Akavall
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-16T21:44:37.120Z
Answers.LastActivityDate: 2020-09-16T23:06:20.480Z
Answers.LastEditDate: 2020-09-16T23:06:20.480Z
Answers.UserDisplayName: benrg
Answers.Body: <blockquote>
  <p>Can someone either point me to an existing engine which plays like a human based on your level or recommend me some guidelines as how we can make it using AI ?</p>
  </blockquote>
  <p>There is simply no such thing. AlphaZero, Stockfish, LC0, Komodo, everything else don't play like a human. In my experience, chess engines are either very strong, very weak or artificially tuned down to play bad chess.</p>
  <p>You will need train a network on it. To my knowledge, nobody has done it successfully. You will need to feed a good amateur chess game database. The games will need to come with filtering.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-23T21:58:49.713Z
Answers.LastActivityDate: 2020-09-23T21:58:49.713Z
Answers.UserDisplayName: SmallChess
Answers.Body: <p>By programming it using human concepts and thinking instead of just pure raw brute-force calculation (like a computer). There was an old engine [Wchess], used in the Power Chess 98 and Majestic Chess games on PC, which applies concepts like tropism (e.g. king safety for the AI is described as how many pieces are surrounding it). So some logical human-like heuristics thrown in with an occasional mistake or two, made it the most human-like chess engine to date.</p>
  <p>Humans all succumb to tactical mistakes eventually, it should be possible for an engine to simulate such behavior although this would be a niche interest and take a very different approach from those &quot;industrial-grade&quot; engines.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-24T06:48:20.373Z
Answers.LastActivityDate: 2020-09-24T06:48:20.373Z
Answers.UserDisplayName: prusswan
Answers.Body: <p>Some of them make random errors to simulate a human. Others limit the number of moves they look ahead to do it. None of them play like a human, but that is the state of the art as of now for faking it.</p>
  <p>The best approach would be to train the AI program by playing against actual humans of the given strength level being simulated, but that would be impractical as it would take too long and the players being used would likely change rating (hopefully upwards as they learn too) as they play.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-16T18:32:45.080Z
Answers.LastActivityDate: 2020-09-16T18:47:14.950Z
Answers.LastEditDate: 2020-09-16T18:47:14.950Z
Answers.UserDisplayName: user24723
Answers.Body: <p>I say: Take a normal, strong AI, and have it play P-R3 at random.</p>
  <p>Bad players play P-R3 whenever they can't think of anything to do. They think if an enemy unit lands on N5, then P-R3 is a great attacking move. Or maybe they play P-R3 to <em>prevent</em> an enemy piece from coming to N5. Either way, win! And it's such a small positional concession, what harm could P-R3 do?</p>
  <p>Bad players waste more time on useless P-R3 moves than any other, so a computer that plays P-R3 willy-nilly would approximate crappy chess play in that fashion.</p>
  <p>Chessplayers: NM Dan Heisman's &quot;Guide to P-R3&quot; is such a valuable read, available at chesscafe.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-16T11:27:01.327Z
Answers.Text: An engine playing a rook pawn forward one square randomly is not enough (on average) for any human being to be able to even draw the engine, the concession is normally too small to even make a difference.
Answers.UserDisplayName: Scounged
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-16T11:52:23.257Z
Answers.Text: It would only make a difference if it's truly "at random" - pushing a pawn while your queen hangs is hard to recover from even for an engine. But then again, that's exactly the kind of "random blunder" from the question that sticks out as artificial.
Answers.UserDisplayName: Annatar
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-09-16T08:51:44.627Z
Answers.LastActivityDate: 2020-09-16T08:51:44.627Z
Answers.UserDisplayName: friscodelrosario
Body: <p>We have lot of sophisticated chess engines, but I always prefer playing with a human online, because they make genuine mistakes / blunders which adds a human touch. Playing with computer at a high level is boring as it is too difficult to crack and at low levels it makes a random blunder which practically a human will never do.</p>
  <p>Can someone either point me to an existing engine which plays like a human based on your level or recommend me some guidelines as how we can make it using AI?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-09-16T08:04:30.057Z
Comments.Text: Maybe training a NN with a huge database of games played by such humans, so that the NN tries to predict the move the humans made based on the position? But it might well be that the existing databases are ridiculously small, given the large number of possible positions in chess...
Comments.UserDisplayName: wimi
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-09-25T16:22:12.630Z
Comments.Text: human or non-human play is an illusion that's further fortified by beliefs.
Comments.UserDisplayName: Sopel
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-18T14:35:53.187Z
Comments.Text: I am no chess player and I have no experience from computer chess but I find the topic interesting. From my logic (for what it's worth given my lack of experience) a chess computer used for support and training for a human chess player should evaluate a move based on a tree search that looks at the moves that are likely to be played by humans (you and your opponent) rather than theoretical "best" moves which gives a better positions after a series of moves that no humans would ever play (because the evaluation needed in order to find or conclude tgagbthese are really the best moves is beyond h
Comments.UserDisplayName: Joakim Quensel
Tags: <engines><human-versus-machine>
Title: How to make an AI chess engine which can play like a human of similar rating?
ThreadText: # How to make an AI chess engine which can play like a human of similar rating?
  
  (Asked by: username_0 on 2020-09-16)
  
  We have lot of sophisticated chess engines, but I always prefer playing with a human online, because they make genuine mistakes / blunders which adds a human touch. Playing with computer at a high level is boring as it is too difficult to crack and at low levels it makes a random blunder which practically a human will never do.
  
  Can someone either point me to an existing engine which plays like a human based on your level or recommend me some guidelines as how we can make it using AI?
  
  **Tags:** engines, human-versus-machine
  
  > **Comments:**
  > **username_1**: Maybe training a NN with a huge database of games played by such humans, so that the NN tries to predict the move the humans made based on the position? But it might well be that the existing databases are ridiculously small, given the large number of possible positions in chess...  
  > **username_2**: human or non-human play is an illusion that's further fortified by beliefs.  
  > **username_3**: I am no chess player and I have no experience from computer chess but I find the topic interesting. From my logic (for what it's worth given my lack of experience) a chess computer used for support and training for a human chess player should evaluate a move based on a tree search that looks at the moves that are likely to be played by humans (you and your opponent) rather than theoretical "best" moves which gives a better positions after a series of moves that no humans would ever play (because the evaluation needed in order to find or conclude tgagbthese are really the best moves is beyond h  
  
  ---
  
  ## 8 answers
  
  ### Answer by username_4 on 2020-11-12. Score: 11
  
  You can take a look at the [Maia Chess project](https://github.com/CSSLab/maia-chess). What they've done is that they've built a customized version of Leela Chess wherein instead of the policy value looking for the best move, it looks for the most likely human move. The github has 9 weight files for lc0 from 1100 to 1900 elo.
  
  It claims to better predict the moves of players compared to Stockfish and Leela Chess. You can also play these bots at [Lichess](https://lichess.org/team/maia-bots).
  
  [![prediction accuracy of Maia versus Stockfish and Leela](https://i.sstatic.net/aHkFC.png)](https://i.sstatic.net/aHkFC.png)
  
  
  ---
  
  ### Answer by username_5 on 2020-09-24. Score: 4
  
  In theory, chess is a Markovian game -- the current state says it all, how you reach the current state, ie all the previous moves, doesn't matter. This is how computers play chess.
  
  For humans, previous moves matter a lot. On one hand, people think in plans, so could easily forgo better moves if it is not consistent with their plan. On the other hand, human mood swing also has a great effect. Reaching an endgame after a crazy tactical middle game or reaching the same endgame after many boring exchanges can lead to different moves onwards.
  
  So at least on this aspect, computers cannot play like humans.
  
  > **Comments:**
  > **username_6**: "So at least on this aspect, computers cannot play like humans."  That is not necessarily true.  It is just that the computer would need to take this into account.  
  > **username_7**: A game's current board state isn't always sufficient to play the next move. The right to castle and the right to take en passant both depend on the move history.  
  
  ---
  
  ### Answer by username_8 on 2020-11-14. Score: 4
  
  ## Use a number of weak engines. Make them vote.
  
  Suppose you take any number of relatively weak engines - some with deep searches but poor evaluation heuristics, some with shallow searches, some using neural networks but with limited training, some with random factors added to make them blunder a bit - and at each turn you have them vote for the best move. The result will be quite human-like - a fact that should not be too flattering for us humans!
  
  For the most part, the composite engine would play decently - some significant amount better than any individual engine. It would rarely blunder blatantly, but it would miss deep tactics and subtle strategic moves. In particular, it would rarely (if ever) make the "computer move". Most engines, when given a position where there is an obvious very good move and a completely opaque move that is infinitesimally better, have the search depth necessary to find the latter move and make it - thus revealing their inhumanity. But most of our engines will either fail to find the weird move or their heuristic won't be fine enough to recognize its superiority. The vote will usually go to the more obvious move.
  
  Engines also reveal their inhumanity in the precision of their defensive play and opening book. Our composite engine would lack the search depth necessary for precise defense - even if a few of the constituent engines had the depth, they would be outvoted on occasion (and it takes just one mistake to seem human). In the opening, the composite will stay on book for a while - although it will be hard to guess just which lines it will prefer. But it won't be long before the book-less or book-light engines win a vote and make an "imprecise" move. The quickest way to get the composite engine "out of book" would be to offer a sacrifice - the composite will surely be a sucker for opening gambits . . . just like most humans.
  
  To improve the effect, the length of time displayed between moves should be proportional to the amount of agreement between the engines. If a move is unanimous to the engines, it likely would be obvious to a human, as well (if not simply forced). If there is a lot of disagreement among the engines, than the position is likely a bit tricky and the sort which would cause a human mind to linger. (Some adjustment would be required in the opening phase, in which the engines would surely have lots of disagreements simply because there isn't a lot going on in the position yet.)
  
  ## Someone really needs to do this.
  
  When I came across this question, I was a little surprised that no one knows of anyone who has tried this. The Maia engine has a bit of this idea cooked in. By trying to predict what an 1100-rated player will do, Maia achieves are rating of about 1500. But Maia isn't a composite of a bunch of 1100-rated engines, like I propose. Creating the composite that I describe doesn't seem like a difficult task. If anyone knows of an attempt, I would love to hear about it.
  
  
  ---
  
  ### Answer by username_9 on 2020-09-16. Score: 4
  
  As far as I know, every chess playing program combines a depth-limited search of the game tree with a heuristic algorithm to estimate the favorability of each position. There's a tradeoff between using a cheaper heuristic allowing more positions to be evaluated and using a sophisticated heuristic on fewer positions.
  
  Humans play in more or less the same way, but evaluate far fewer positions using a far more sophisticated heuristic.
  
  I'd expect that the most human-like computer players would be the ones that evaluate the fewest positions per unit time using more sophisticated heuristics. [AlphaZero](https://en.wikipedia.org/wiki/AlphaZero), for instance, evaluates about 0.1% as many positions as Stockfish (though still many orders of magnitude more than a human), and I'd expect it to be somewhat more human-like than Stockfish as a result. I have no actual experience to back that up, though.
  
  > **Comments:**
  > **username_10**: I think this hyper bullet game: https://lichess.org/jCcbfpB8#1, where Leela blunders her queen in a human like fashion supports your reasoning.  
  
  ---
  
  ### Answer by username_11 on 2020-09-23. Score: 3
  
  > Can someone either point me to an existing engine which plays like a human based on your level or recommend me some guidelines as how we can make it using AI ?
  
  There is simply no such thing. AlphaZero, Stockfish, LC0, Komodo, everything else don't play like a human. In my experience, chess engines are either very strong, very weak or artificially tuned down to play bad chess.
  
  You will need train a network on it. To my knowledge, nobody has done it successfully. You will need to feed a good amateur chess game database. The games will need to come with filtering.
  
  
  ---
  
  ### Answer by username_12 on 2020-09-24. Score: 2
  
  By programming it using human concepts and thinking instead of just pure raw brute-force calculation (like a computer). There was an old engine [Wchess], used in the Power Chess 98 and Majestic Chess games on PC, which applies concepts like tropism (e.g. king safety for the AI is described as how many pieces are surrounding it). So some logical human-like heuristics thrown in with an occasional mistake or two, made it the most human-like chess engine to date.
  
  Humans all succumb to tactical mistakes eventually, it should be possible for an engine to simulate such behavior although this would be a niche interest and take a very different approach from those "industrial-grade" engines.
  
  
  ---
  
  ### Answer by username_13 on 2020-09-16. Score: 0
  
  Some of them make random errors to simulate a human. Others limit the number of moves they look ahead to do it. None of them play like a human, but that is the state of the art as of now for faking it.
  
  The best approach would be to train the AI program by playing against actual humans of the given strength level being simulated, but that would be impractical as it would take too long and the players being used would likely change rating (hopefully upwards as they learn too) as they play.
  
  
  ---
  
  ### Answer by username_14 on 2020-09-16. Score: -6
  
  I say: Take a normal, strong AI, and have it play P-R3 at random.
  
  Bad players play P-R3 whenever they can't think of anything to do. They think if an enemy unit lands on N5, then P-R3 is a great attacking move. Or maybe they play P-R3 to *prevent* an enemy piece from coming to N5. Either way, win! And it's such a small positional concession, what harm could P-R3 do?
  
  Bad players waste more time on useless P-R3 moves than any other, so a computer that plays P-R3 willy-nilly would approximate crappy chess play in that fashion.
  
  Chessplayers: NM Dan Heisman's "Guide to P-R3" is such a valuable read, available at chesscafe.
  
  > **Comments:**
  > **username_15**: An engine playing a rook pawn forward one square randomly is not enough (on average) for any human being to be able to even draw the engine, the concession is normally too small to even make a difference.  
  > **username_16**: It would only make a difference if it's truly "at random" - pushing a pawn while your queen hangs is hard to recover from even for an engine. But then again, that's exactly the kind of "random blunder" from the question that sticks out as artificial.  
  
  ---
  
  