In today’s day and age, computers are obviously way better at chess than humans, and even the best players in the world have a hard time holding a candle to engines like Stockfish, etc. However, what I don’t understand is how is it possible to have them in different levels of strength. For example, on Chess.com, there are dozens of bots that you can play against depending on your own level. But for the weakest ones, how does this work? One would think that an engine either knows how to play chess efficiently, or it doesn’t. How can you “dumb down” a computer to the level of an intermediate player or even a beginner? Thanks!
In: 15
Chess bots work by looking forward a certain number of moves to calculate the possible outcomes and selecting the move that gives them the best “score” based on pieces captured andvboard positioning. They pick the move that gives them the most future opportunities to capture pieces, avoid being captured, and dominate board space.
It’s enormously demanding to look forward more than a few moves so typically they don’t calculate out very far, but it is still very effective.
To make the bot dumber you just have it select the 3rd best move instead of the best move sometimes. Or the 10th best move.
You change the weighting so it plays less optimally, but will still go for overwhelmingly obvious moves so it doesn’t look purposefully dumb.
The same way a person holds back. A person might know the best move in a particular situation. But that doesn’t mean they need to *make* that move.
So you just have a computer do that: not do the best move. There are different ways to do that, like randomly selecting a move or trying to rank the moves and having the computer pick from somewhere on that rank (e.i. intermediate might pick from the middle of the list, beginner picks from the bottom). Or follow a simple(ish) algorithm that people know to not be a very good one and just switch up the algorithm based on the difficulty level.
The easiest ways to dumb down a chess engine are to limit the amount of time it has to select a move, limit the “depth” (number of moves in the future) it can analyze, or to have it pick randomly from a set of possible moves.
Chess computers, like humans, take time to find the right answer, and they can’t instantly see a mate in 10. Of course, give a computer a few minutes (or, usually, a few seconds), and they’ll see farther and more accurately than even the best humans. So limit those options, and it all of a sudden becomes much weaker.
But the engines that play against lower-level players, they’re set to more-or-less randomly pick between their possible candidate moves. A top-tier chess engine will almost instantly eliminate a move that loses its queen in 5 moves – unless it can gain something from that sacrifice. A medium-strength chess engine might eliminate the moves that lose a queen, but not the moves that lose a pawn or a bishop, and choose from there. And a chess engine for beginners might not eliminate any moves – it will leave pieces undefended so that beginning players can discover tactics and win games, while they work on their skills and level up to harder bots.
The easiest option is to every so often, randomly pick a bad move. But this isn’t realistic, that’s not how bad humans play.
There are certain moves that bad human players don’t see, like bishops on the other side of the board, discovered attacks, pins and skewers. But to a computer, losing a piece is all the same, no matter the type of attack.
So you need to reprogram the chess engine to ignore attacks that are the type of attack a bad player wouldn’t see. This way the human player will actually learn chess strategy.
Maia is a chess engine designed to play poorly. The authors downloaded 10 million games played on lichess.com by human players that aren’t that good. The engine was trained on those games, so it looks for similar situations and does what a human would do.
But, if you want to get better at chess, you really need to play against humans.
Just to clarify, top players can’t come close to stockfish.
If the best players in the world are ranked 2800, stockfish plays at a 3500+ level. Considering a 200 point difference basically means it’s impossible to win human to human, beating stockfish is actually humanly impossible.
That said, it’s not hard to have a computer pick a weaker choice. It solves the best X moves. And you just have it pick the weaker choices. The engine is SO good by this point, it’s good enough to choose how good it is.
Last thing to consider. It’s not a level of computing power. Any computer can run the stockfish model. It’s already trained. Computational power does help speed it up a bit but honestly, it’s basically a math equation for computers at this point. AI is orders of magnitude better at solving problems than raw computation. You’ll see soon as graphics card developers have said we’re about to see an actual 1000x improvement in graphics. We can render things that took hours in seconds because AI can predict close by pixels instead of calculating them.
Moore’s Law says computational power increases about double every two years. And it’s been slowing down a bit lately, but we’re about to jump massively. Remember the graphics you see today. You won’t recognize it in 5 years. It’s the equivalent of pong to COD. What took 50 years to do, we’re about to do that leap again but in 5.
It’s a good question. Creating any sort of a weak bot is simple. Just make it make a move that will obviously put it at a disadvantage (lose a piece, give up an important position, …)
However, it is impossible to make a weak bot that will mimic a weak human.
If you played Chess.com bots, you’ll see that they play in a very weird way. A weak bot will do a couple of decent moves, followed by a totally nonsensical move, for example, moving the king on the third move.
You can limit the depth of calculation (for example, cap it at 2 moves deep) or limit it’s breadth of calculation (for example, only calculate 1 or 2 variations per move deep). You may also have it find inaccurate moves and play them with a certain probability.
AI is being used in engines these days, so I’m not sure how they’re able to control for that when it comes to difficulty level. I do know there are AI bots trained to specifically play at certain ratings, say a 1600, by analyzing games at that rating level and then learning to predict the next move accurately.
Outside of that, it all depends on the engine in question. The best engines in the world are optimized in their calculation and trained on extensive libraries of games, as well as implementing machine learning with complex neural nets. By comparison, a homebrew chess engine built for fun is unlikely to achieve anywhere near the same results and may struggle to achieve better than a master performance.
Latest Answers