Mastering Chess An overview of common chess AI

  • Slides: 18
Download presentation
Mastering Chess An overview of common chess AI Adam Veres

Mastering Chess An overview of common chess AI Adam Veres

Everybody knows chess, right?

Everybody knows chess, right?

ELO Rating System Important context on how players are rated • Arpad Elo •

ELO Rating System Important context on how players are rated • Arpad Elo • Hungarian-born, American physics professor – creator.

ELO Rating System, cont. • Numerical system for calculating relative skill level of players

ELO Rating System, cont. • Numerical system for calculating relative skill level of players • Higher number = better player • Players avoid situations that damage their ELO. • Picking events • Not just chess

USCF Rating Tiers Senior Master 2400+ Master 2200+ (This encompasses the 93 -98 th

USCF Rating Tiers Senior Master 2400+ Master 2200+ (This encompasses the 93 -98 th percentile of all rated players in America) Expert 2000+ ‘A’ Player 1800+ ‘B’ Player 1600+ ‘C’ Player 1400+ ‘D’ Player 1200+ ‘E’ Player 1000+ ‘F’ Player 800+ ‘G’ Player 600+ ‘H’ Player 400+ ‘I’ Player -400

Computer chess! Some history on computers playing chess • ~1770 • The Turk •

Computer chess! Some history on computers playing chess • ~1770 • The Turk • Fake automaton • Wolfgang von Kempelen § Hungarian inventor

Alan Turing • 1951 developed, on paper, a program capable of playing a full

Alan Turing • 1951 developed, on paper, a program capable of playing a full game of chess • Work backwards from ‘win’ conditions and accept moves that work towards that goal • Turing assumed infinite processing power and storage space • Ratio W/B

Chessmaster • 1986 - The Chessmaster 2000 • The manufacturer rated the game at

Chessmaster • 1986 - The Chessmaster 2000 • The manufacturer rated the game at 2000 Elo USCF, in reality it plays at approximately 1750 -1800 USCF. • This is “B” rated in 1986! • Best selling Chess series of all time.

Deep Blue 1997 IBM’s Deep Blue defeats Gary Kasparov after a six game match.

Deep Blue 1997 IBM’s Deep Blue defeats Gary Kasparov after a six game match. Deep Blue relied on hardware for to evaluate over 200 million moves per second

Beyond Deep Blue • Deep Fritz version 10 ran on a machine running two

Beyond Deep Blue • Deep Fritz version 10 ran on a machine running two Intel Core 2 Duo processors. • 8 million moves per second • Average depth search of 17 -18 using heuristics to evaluate choices • About 6 billion possible positions observed before actually making a move • Vladimir Krammik loses 2 -4 to Deep Fritz • 5 piece tablebase allowed for end-game, 6 piece widely available

Computer chess ratings • SSDF – Swedish Chess Computer Association • Tests computer chess

Computer chess ratings • SSDF – Swedish Chess Computer Association • Tests computer chess programs and produces a rating • 2012 “Deep Rybka 4 x 64” 3221 rating • Tested on x 64 2 GB Q 6600 2, 4 GHz

Algorithmic Considerations Board Representation • List of all pieces • 8 x 8 2

Algorithmic Considerations Board Representation • List of all pieces • 8 x 8 2 D array • 0 x 88 § 2 boards next to each other. Makes move-legality checks a simple AND with the hex number 0 x 88 • Bitboard § 64 bit sequence of bits. Series of bitboards. • Stream based • Huffman Encoding § More common chess positions (pawns/empties) stored with less bits

Main Search Types • Type A § Brute Force. Checks bad and trivial moves

Main Search Types • Type A § Brute Force. Checks bad and trivial moves unnecessarily. • Type B § Quiescent Search – evaluate minimax game trees § Only a few moves are evaluated

Type B • Alpha-beta pruning widely used to reduce search space • Negascout –

Type B • Alpha-beta pruning widely used to reduce search space • Negascout – directional search algorithm to find minimax value of a node in a tree

“Tablebases” • Nalimov endgame tablebase. 5 or fewer pieces is solved. § USSR born

“Tablebases” • Nalimov endgame tablebase. 5 or fewer pieces is solved. § USSR born programmer • 6 pieces is solved except some trivial cases such as 5 pieces versus 1 king • 7 pieces have been somewhat analyzed • All of these make certain assumptions to prune the branching possibilities. § Eg: Castling is no longer possible

Last Thoughts One last interesting note: It is estimated that doubling the computer’s speed

Last Thoughts One last interesting note: It is estimated that doubling the computer’s speed adds only 50 -70 ELO to a given chess algorithm Heuristics are much better than brute force!

References • Digital computers applied to games'. n. d. AMT's contribution to 'Faster than

References • Digital computers applied to games'. n. d. AMT's contribution to 'Faster than thought', ed. B. V. Bowden, London 1953. Published by Pitman Publishing. TS with MS corrections. R. S. 1953 b • “Deep Blue”. IBM. http: //www-03. ibm. com/ibm/history/ibm 100/us/en/icons/deepblue/ • “The Last Man vs Machine? ”. Chess News. http: //en. chessbase. com/home/Tab. Id/211/Post. Id/4003504 • “Important Official Rules of the Kramnik versus Fritz match”. Chess Daily News and Information. http: //susanpolgar. blogspot. com/2006/11/important-official-rules-ofkramnik. html • Levy, David; Newborn, Monty (1991), How Computers Play Chess, Computer Science Press, ISBN 0 -7167 -8121 -2

References • Searching for Solutions in Games and Artificial Intelligence (1994) by Victor L.

References • Searching for Solutions in Games and Artificial Intelligence (1994) by Victor L. Allis • SSDF. Swedish Chess Computer Association. http: //ssdf. bosjo. net/ • Some images from Wikimedia Foundation • “Did a Computer Bug Help Deep Blue beat Kasparov”. Wired. com. http: //www. wired. com/playbook/2012/09/deep-blue-computer-bug/