Answers.Body: <p>It depends and is likely a combination of factors, decreasing Elo and also making tweaks to try to more closely match a certain players style.</p>
  <p>In general, it's difficult to limit an engine's Elo in a natural way, although with some work something decent can often be achieved. Common apporches to nerfing an engine strength involve having is choose a random or maybe the second best move every once in a while, limiting the amount of nodes it's allowed to search, or making the piece values more &quot;rough,&quot; where certain pieces are under or overvalued.</p>
  <p>As far as &quot;personality&quot; goes, it can often be just as difficult, if not more so, to try to capture precisely, but progress can be made.</p>
  <p>For example, if one were trying to create an engine with the playing style of Mikhail Tal, one tweak they might make is to crank up the importance of king safety in their static evaluation. This way, the engine would be more likely to sacrifice material for an attack on the king, even if it's not <em>necessarily</em> sound, to moreso mimick Tal's well known attacking style. Of course this needs tuning, like any personality feature added, since their wouldn't be much point in having an engine that stupidly sacrifices material for a completely unsound attack. Or maybe in the case of Carlsen, the engine developer would try to put particular emphasis on making sure the engine has very strong endgame play that tries to induce weakness, mimicking Carlsen's often robotic-seeming endgame play.</p>
  <p>As you also mentioned, in recent years neural networks are changing the way engine developers might try to mimick a certain player in the future. But as you also rightly recognized, one big hurdle right now is that a neural network generally needs large amounts of data to be trained well, more data than is often possible from a single player.</p>
  <p>As you can probably see, this sort of thing isn't really an exact science and it requires some creativity and careful design to make a &quot;Magnus Carlsen&quot; engine or &quot;Gary Kasparov&quot; engine.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-09T05:50:07.643Z
Answers.Text: It would be interesting to see "style transfer" machine learning algorithms translated into chess NN weights. Basically tweak the NN weights and reward it if it makes a move similar to ones Magnus made.
Answers.UserDisplayName: qwr
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-09T07:02:23.180Z
Answers.Text: Style transfer algorithms can work with very little data. Even some trained on just a single image.
Answers.UserDisplayName: qwr
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-09T23:27:00.777Z
Answers.Text: @qwr Really? I didn't realize that. My experience with neural networks is a bit limited, as I haven't yet incorporated them into my engine yet. Interesting...
Answers.UserDisplayName: Chris
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-12T04:15:13.847Z
Answers.Text: Look up one-shot learning techniques for trying to learn from little data
Answers.UserDisplayName: qwr
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-09T05:31:36.297Z
Answers.LastActivityDate: 2022-08-09T05:31:36.297Z
Answers.UserDisplayName: Chris
Answers.Body: <p>I suspect those engine variants are neural network-based implementations, like Leela lc0 or perhaps NNUE on Stockfish (but I'm not familiar with their approach). A neural net engine requires millions of games and/or self play to train up to a strong ELO, so it's not practical to train one of these instances to a reliable strength based only on a specific player's recorded games.</p>
  <p>However, they could ingest the player's recorded games as part of the training dataset and I think you could make the case that this captures a bit of the player's 'style' in the engine. Whether or not this truly represents the player's style is such a subjective thing that I think they could brand the engine without deceit, but in practice it's hard to prove it plays in anyone's particular style given the nature of the game.</p>
  <p>This approach also makes it simple to implement something like &quot;Play Magnus at 13&quot; -- it's just a simple date filter on the player's games to ingest into the training set. This is just my guess as someone who works in AI, but that's definitely what my mind immediately jumps to when considering the problem.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-13T16:10:34.890Z
Answers.LastActivityDate: 2022-08-13T16:10:34.890Z
Answers.UserDisplayName: lepapillon
Body: <p>I've seen a &quot;play Kasparov&quot; on flights, and during those recent chess tournaments, they had a &quot;Play Magnus at 13 (or some young age)&quot; segment where some players in the tournament and some analysists played some engine.</p>
  <p>I'd be interested in knowing what chess programmers do when they brand their engine that way. Is it just a tuning of ELO, so it's just an engine about at his old playing strength? Do they do something like Chessmaster where there are 10+ sliders to control style (stuff like preferring knights or bishops, aggression, defense, etc.)? Do they use a custom opening book using that player's old games?</p>
  <p>I'm guessing they can't do much in the way of training generalized playing algorithms based on historical games like how Maia Chess was tuned to play like certain Lichess ELO ranges, because there might not be enough data. However, I could see there being an automated way to tune &quot;sliders&quot; based on only 100s or 1000s of games.</p>
  
Tags: <engines>
Title: What algorithm is used when an engine is branded by a certain player?
ThreadText: # What algorithm is used when an engine is branded by a certain player?
  
  (Asked by: username_0 on 2022-08-08)
  
  I've seen a "play Kasparov" on flights, and during those recent chess tournaments, they had a "Play Magnus at 13 (or some young age)" segment where some players in the tournament and some analysists played some engine.
  
  I'd be interested in knowing what chess programmers do when they brand their engine that way. Is it just a tuning of ELO, so it's just an engine about at his old playing strength? Do they do something like Chessmaster where there are 10+ sliders to control style (stuff like preferring knights or bishops, aggression, defense, etc.)? Do they use a custom opening book using that player's old games?
  
  I'm guessing they can't do much in the way of training generalized playing algorithms based on historical games like how Maia Chess was tuned to play like certain Lichess ELO ranges, because there might not be enough data. However, I could see there being an automated way to tune "sliders" based on only 100s or 1000s of games.
  
  **Tags:** engines
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2022-08-09. Score: 2 | Accepted answer
  
  It depends and is likely a combination of factors, decreasing Elo and also making tweaks to try to more closely match a certain players style.
  
  In general, it's difficult to limit an engine's Elo in a natural way, although with some work something decent can often be achieved. Common apporches to nerfing an engine strength involve having is choose a random or maybe the second best move every once in a while, limiting the amount of nodes it's allowed to search, or making the piece values more "rough," where certain pieces are under or overvalued.
  
  As far as "personality" goes, it can often be just as difficult, if not more so, to try to capture precisely, but progress can be made.
  
  For example, if one were trying to create an engine with the playing style of Mikhail Tal, one tweak they might make is to crank up the importance of king safety in their static evaluation. This way, the engine would be more likely to sacrifice material for an attack on the king, even if it's not *necessarily* sound, to moreso mimick Tal's well known attacking style. Of course this needs tuning, like any personality feature added, since their wouldn't be much point in having an engine that stupidly sacrifices material for a completely unsound attack. Or maybe in the case of Carlsen, the engine developer would try to put particular emphasis on making sure the engine has very strong endgame play that tries to induce weakness, mimicking Carlsen's often robotic-seeming endgame play.
  
  As you also mentioned, in recent years neural networks are changing the way engine developers might try to mimick a certain player in the future. But as you also rightly recognized, one big hurdle right now is that a neural network generally needs large amounts of data to be trained well, more data than is often possible from a single player.
  
  As you can probably see, this sort of thing isn't really an exact science and it requires some creativity and careful design to make a "Magnus Carlsen" engine or "Gary Kasparov" engine.
  
  > **Comments:**
  > **username_2**: It would be interesting to see "style transfer" machine learning algorithms translated into chess NN weights. Basically tweak the NN weights and reward it if it makes a move similar to ones Magnus made.  
  > **username_2**: Style transfer algorithms can work with very little data. Even some trained on just a single image.  
  > **username_1**: @username_2 Really? I didn't realize that. My experience with neural networks is a bit limited, as I haven't yet incorporated them into my engine yet. Interesting...  
  > **username_2**: Look up one-shot learning techniques for trying to learn from little data  
  
  ---
  
  ### Answer by username_3 on 2022-08-13. Score: 1
  
  I suspect those engine variants are neural network-based implementations, like Leela lc0 or perhaps NNUE on Stockfish (but I'm not familiar with their approach). A neural net engine requires millions of games and/or self play to train up to a strong ELO, so it's not practical to train one of these instances to a reliable strength based only on a specific player's recorded games.
  
  However, they could ingest the player's recorded games as part of the training dataset and I think you could make the case that this captures a bit of the player's 'style' in the engine. Whether or not this truly represents the player's style is such a subjective thing that I think they could brand the engine without deceit, but in practice it's hard to prove it plays in anyone's particular style given the nature of the game.
  
  This approach also makes it simple to implement something like "Play Magnus at 13" -- it's just a simple date filter on the player's games to ingest into the training set. This is just my guess as someone who works in AI, but that's definitely what my mind immediately jumps to when considering the problem.
  
  
  ---
  
  