CSSLab / maia-chess

Maia is a human-like neural network chess engine trained on millions of human games.
https://maiachess.com
GNU General Public License v3.0
959 stars 121 forks source link

Move time simulation #2

Open link0007 opened 3 years ago

link0007 commented 3 years ago

This is about the implementation of Maia in Lichess: Could Maia learn to take time before it moves? Ideally based on the complexity of the situation and the difficulty of finding the correct move.

Right now its moves are very human-like, but its move time is very frustrating to play against, and obviously unrealistic.

reidmcy commented 3 years ago

We've implement something like that, currently it looks at the time remaining, number of legal moves and move number to try and predict how long a human would take on the move. Then we add a large noise factor. I'll be looking into a better model this coming week as the current one is a simple linear model

link0007 commented 3 years ago

Yes I noticed! Makes playing much more enjoyable.

One thing I've noticed, but perhaps this is tricky to model, is that for instance a stepladder checkmate sequence is a time when a human moves very quickly even though the number of legal moves is quite large. Whereas other endgame checkmate sequences are really tricky to figure out, and even grandmasters struggle to find them.

From an academic standpoint it's really interesting to think how to model this realistically. Of course, purely practically, even a simple implementation like you did now is enough to make it much more playable. If you could predict not only what moves a human player would make, but also how long it would take them to find it, that would be an amazing accomplishment.

dllu commented 3 years ago

Yes, it is quite demoralizing to be winning against Maia and then lose on time because the bot starts playing moves super fast when it is low on time whereas a human inevitably makes more mistakes under time pressure or runs out of time. e.g. https://lichess.org/F9ztfa8g/white#61

CallOn84 commented 8 months ago

The Lichess Bot API has a setting within its config files that forces the bot to "think" before making a move; It's called fake_think_time.

Have you tried this setting @reidmcy?

reidmcy commented 8 months ago

@CallOn84 The API does not have that. The official bot client has an option to add a delay using a simple linear model. We have a different linear model, at under five seconds there's a failsafe that disables the delay. There's still a some delay so the bots regularly time out, it's just the transition is usually very obvious to the opponent so feels artificial.