Chess AI is not machine learning as in "it watched thousand of games and extracted some patterns to be good".
It basically explores all possible moves and all possible countermoves and selects the best one. Of course it is extremely well engineered and optimized, but this is the main concept.
As a consequence, it does not to be "trained" on a dataset with odds to play without a piece.
... Sort of. Yes, you're right to bring up minimax/alpha-beta pruning, but things like the correct values for piece square tables and the opening book are chosen based on data that is analogous to ML model training (sometimes these are directly chosen using ML models).
Removing a piece may mess up the values chosen for the piece square tables and certainly messes up with the opening book - but on the other hand, it makes it sooner for the engine to end up using it's tablebases in the end game!
It uses alpha-beta pruning[0], which requires an evaluation function. Stockfish traditionally used a man-made evaluation function, but added a small type of NN called an NNUE[1] for better results. The actual search method is still the same, though.
Right. It's not intelligent. It just brute forces down a decision tree of possible moves / outcomes and picks the best next move that is most likely to result in victory. With a super computer (e.g., IBM's Watson) the program is able to go deeper down the tree and explore more branches in less time.
Brute force alone is not very good for chess: you need some means of evaluating a position to prune your tree, otherwise you will not be able to plan very far ahead at all. The evaluation function is in large part what makes one chess engine better or worse than another, and nowadays that includes some neural nets for the top engines (stockfish, which is still the best AFAIK, uses a relatively small net and still evaluates some 100s of millions of positions, while Alphazero has a relatively larger net and evaluates about a thousand or so positions, and is also far better than any humans)
Brute force is good enough, at any given moment the # of possible moves is finite. The limiting factor is how much hardware you have and how quick you need the next move.
Sure, but unless you wanna wait a few thousand years on a pretty large cluster you're not going to get a chess engine that's gonna beat the best humans. The number of moves is finite but very, very large.
Comments
Chess AI is not machine learning as in "it watched thousand of games and extracted some patterns to be good".
It basically explores all possible moves and all possible countermoves and selects the best one. Of course it is extremely well engineered and optimized, but this is the main concept.
As a consequence, it does not to be "trained" on a dataset with odds to play without a piece.
... Sort of. Yes, you're right to bring up minimax/alpha-beta pruning, but things like the correct values for piece square tables and the opening book are chosen based on data that is analogous to ML model training (sometimes these are directly chosen using ML models).
Removing a piece may mess up the values chosen for the piece square tables and certainly messes up with the opening book - but on the other hand, it makes it sooner for the engine to end up using it's tablebases in the end game!
I thought it does need to be trained (via self-play) to recognize patterns bc the game space is too large to exhaustively visit
Looks like it used to be brute force, as you say, but has since incorporated an NN after ita loss to AlphaZero
https://www.chess.com/terms/stockfish-chess-engine
It uses alpha-beta pruning[0], which requires an evaluation function. Stockfish traditionally used a man-made evaluation function, but added a small type of NN called an NNUE[1] for better results. The actual search method is still the same, though.
[0]https://en.wikipedia.org/wiki/Alpha%E2%80%93beta_pruning
[1]https://www.chessprogramming.org/NNUE
w00t, much better. thanks!
Good names in there :)
Right. It's not intelligent. It just brute forces down a decision tree of possible moves / outcomes and picks the best next move that is most likely to result in victory. With a super computer (e.g., IBM's Watson) the program is able to go deeper down the tree and explore more branches in less time.
Nothing fancy. Just pure brute force.
Brute force alone is not very good for chess: you need some means of evaluating a position to prune your tree, otherwise you will not be able to plan very far ahead at all. The evaluation function is in large part what makes one chess engine better or worse than another, and nowadays that includes some neural nets for the top engines (stockfish, which is still the best AFAIK, uses a relatively small net and still evaluates some 100s of millions of positions, while Alphazero has a relatively larger net and evaluates about a thousand or so positions, and is also far better than any humans)
Gotta nitpick :)
Brute force is good enough, at any given moment the # of possible moves is finite. The limiting factor is how much hardware you have and how quick you need the next move.
Sure, but unless you wanna wait a few thousand years on a pretty large cluster you're not going to get a chess engine that's gonna beat the best humans. The number of moves is finite but very, very large.
Opening books definitely play a significant part of chess AI. The early game is where the game tree is largest while the variation is lowest.