lila
lila copied to clipboard
Help Lichess improve vs computer options for newer players.
We'd like to improve single player experience at the lower end of the rating spectrum.
Someone should look into the costs of using these steps to train dumber Maias. Can we get a decent one trained on players in the 800-900 range? How about 700-800? How low can Maia go?
What about other approaches? Purposefully sabotaged Stockfishes, hybrids, custom opening books, etc.
If you find/develop something we can anthropomorphize and slap a personality on, we can rate it and integrate it into the end goal - a progression ladder to give casuals wary of playing humans something to do besides puzzles.
If you find/develop something we can anthropomorphize and slap a personality on
I like this, I had a similar idea of building themed bots
Any interesting implementations (uci, bot api, logic scribbled on a napkin, etc) are welcome. We may want to compile finished code as webassembly and execute clientside, so weights should ideally be kept under 2MB per bot.
We can use a part of the lichess games, filter them for the wanted rating range and train them on maia-chess.
Yes, and we also would like a reusable, friendly way to insert algorithmic behaviors that can sometimes override the lc0 model's best move (to support some of nojoke's idiosyncrasies). I haven't got anything like that mechanism in place yet.
I have thought about this for a while recently.
I feel like the way beginners play tend to be very distinctive from how computers usually evaluate positions. (I say that being a beginner myself!)
Beginners will not evaluate all moves as thoroughly, because it is difficult to know what the opponent’s intentions are. Oftentimes, beginners will try to play for tricks, i.e. dubious moves that aren’t effective unless the opponent is careless and doesn’t realize the intention behind it. (Which sometimes works against other equivalently skilled players.)
Though, first I wanted to say: I feel like there shouldn’t be a single “this is the algorithm for adding personality to bots”. In particular, while I feel like machine learning is an interesting way to achieve all kinds of results in chess engines (from Stockfish’s “the best” to Maia’s “human style”), I feel like it would be much easier to tweak an engine based on hand crafted evaluation (HCE).
I imagine e.g. making a bot that tends to be eager with its queen by simply tweaking its manually‐tuned PST, rather than to have to spend time training a ML model for it. Since the goal is not to always find the best moves, an HCE wouldn’t impair the bot’s goal significantly, and would be much easier to tweak.
Now, one thing I can envision to tweak a search algorithm to play more like a human would is to add some kind of assymetry to the evaluation function. I.e. to make the bot evaluate moves for the opponent in a different way than moves for itself. E.g. by having different PSTs for itself and the opponent.
This could be done in a minimax/negamax framework by simply (abstractly) keeping two trees of position‐score nodes, and using one of them for the bot’s own evaluations, and the other for the opponent’s evaluation. Supposedly, the opponent’s evaluation would be slightly worse, which would encode that the bot wouldn’t be as good at thinking from the opponent’s perspective.
Another simple idea could be to, during search, maximize the bot’s evaluation based on the accumulated value from deeper nodes, but use the flat evaluation function’s value for maximizing the opponent’s moves.
Here are some thoughts on how an HCE like this might be able to succinctly encode nojoke’s example “idiosyncrasies”:
-
A bot that moves too many pawns
- In the PST for the bot’s moves, increasing the value of higher‐rank pawns.
- Lowering the value of squares past the first or second rank for non‐pawn pieces.
-
A bot that gives away its queen and then plays very strongly
- Decreasing the value of the queen in the PST for the bot’s moves.
-
A bot that won’t castle
- Specially lowering the value of castling moves (or prohibiting it altogether unless required).
- Or: Decreasing the value of the flanking squares for the king on the PST for the bot’s moves.
-
A bot that attacks or sacrifices wildly
- Decreasing the value of the bot’s pieces relative to the opponent’s.
- Making the pieces’ values closer relative to each other in the PST(s).
-
A bot that doesn’t try to put its pieces beyond the third rank
- Increasing the value of the pieces on the the second and third ranks on the PST for the bot’s moves.
Some other interesting behavioral characteristics that could be encoded:
-
A bot that plays aggressively
- Bumping the value of positions where the opponent is in check.
- Increasing the value of higher rank squares.
- Increasing the value of bot pieces near the opponent’s king.
- Bumping the value of positions where the bot has more available moves or more controlled squares.
-
A bot that plays passively/defensively
- Decreasing the values of positions where the bot is in check.
- Increasing the value of the bot’s pieces when they are near the king.
- Increasing the value of defended pieces.
- Increasing the value of bot’s pieces relative to the opponent’s.
-
A bot that frequently gets itself into draws (perhaps similar to YouWillTakeTheDraw from nojoke’s document)
- Consider wins as bad. (Avoid them!)
- Decrease the opponent’s king value. (But still defend its own king by keeping its value high.)
- Consider draws as good. (Try to seek them.)
-
A bot that is bad at end games
- Decrease the search depth in end games.
- Use a “poorly chosen” PST for end games and middle games:
- Keeping its king near the corners/edges.
- Keeping its pieces passive.
- Keeping its pawns inactive.
- Undervaluing promotions and decreasing the values of pieces in general.
I hope these all seems like sensible ideas! :smile:
Yes, playing like a human is not really the goal. We just want a range of bots that are enjoyable for beginners and present an appropriate challenge. With regard to HCE vs net, HCE is actually preferred - we may have to pack these guys into WASM and not having to download weights is a plus. But models under 2MB such as the maia ones are acceptable.
Are you interested in making Dummyette twice as dumb?
Are you interested in making Dummyette twice as dumb?
:thinking: No, not Dummyette proper! :sweat_smile: But I am definitely willing in exploring some of the ideas I just shared in a different branch to see how it goes. (And later potentially making it public on Lichess under different bot accounts or somehow else!)