Latest news about Bitcoin and all cryptocurrencies. Your daily crypto news habit.
Machines That Play series has been broken into 6 parts. This is Part 2 of the series. It will cover 1) why we wanted to build chess machines, 2) high level strategies to building chess machines and 3) progress in this field from 1940s-1990s.
Part 1: Machines That Play (Overview)
Part 2: Machines That Play (Building Chess Machines)âââthis one
Part 3: Machines that Play (Chess)
Part 4: Machines That Play (Deep Blue)
Part 5: Machines That Play (Checkers)
Part 6: Machines That Play (Backgammon)
Why chess?
Why would anyone want to teach a machine how to follow some arbitrary man-made rules to move a bunch of wooden pieces on checkerboard, with the sole aim of cornering one special wooden piece? Itâs so human to attack and capture pawns, knights, bishops and the queen to finally corner the king into an inescapable position. Those are our actions, that is our goal and we balance strategy and tactics to suit those. Then why teach machines to play chess?
Chess is an old game. It is believed to have originated in Eastern India (280â550). It reached Western Europe and Russia in the 9th century and by the year 1000, it had spread throughout Europe. It became popular and writings about chess theory (of how to play chess) began to appear in the 15th century.
Throughout history, many people have said many different things about chess and its connection to our intelligence and our mind.
- During the Age of Enlightenment, chess was viewed as a means of self-improvement. Benjamin Franklin (1750) said, The Game of Chess is not merely an idle amusement; several very valuable qualities of the mind, useful in the course of human life, are to be acquired and strengthened by it, so as to become habits ready on all occasions; for life is a kind of Chess, in which we have often points to gain, and competitors or adversaries to contend with, and in which there is a vast variety of good and ill events, that are, in some degree, the effect of prudence, or the want of it. By playing at Chess then, we may learn: I. Foresight, which looks a little into futurity, and considers the consequences that may attend an action [âŠ], II. Circumspection, which surveys the whole Chess-board, or scene of action:âââthe relation of the several Pieces, and their situations [âŠ], III. Caution, not to make our moves too hastily [âŠ]
- âChess is the touchstone of intellect.ââââJohann Wolfgang von Goethe (1749â1832)
- âThe public must come to see that chess is a violent sport. Chess is mental torture.ââââGarry Kasparov (1990s)
- âAs a chess player one has to be able to control oneâs feelings, one has to be as cold as a machine.ââââLevon Aronian (2008) (interview)
Chess has long been regarded as the game of intellect. And many people argued that a machine that could successfully play chess would prove that thinking can be modeled/understood or that machines can be built to think. And that is exactly why people wanted to build a machine that could follow some arbitrary rules of our game and become so good at it that it could one day beat us at our own game.
Norbert Wiener in 1948 book Cybernetics said (regarding computer chess), âWhether it is possible to construct a chess-playing machine, and whether this sort of ability represents an essential difference between the potentialities of the machine and the mind.â
We would build a successful chess machine in 1997, but it wonât necessarily help us understand our mindâââits way of playing would range from being human to being almost alien to us and it would surely challenge our conception of what to call intelligence.
Playing the game
Chess is a two-player zero sum game (i.e. if one player wins, then the other player loses) with perfect information (i.e. in which players know at each time all moves that have taken place at any given point).
How do we usually play this game? We do the following:
- Consider all the legal moves that a player can make
- Compute the new position resulting from each move
- Evaluate to determine the next best move
- Make that (best)Â move
- Wait for opponent to make a move
- Respond by repeating above steps
From this perspective, almost all chess-playing programs must deal with these fundamental steps. In doing that, a chess computer would have to address the following key problems:
- Representing the âboardâ
- Generating all legal next states
- Evaluating a position
Letâs look at each in detail:
Representing the âboardâ: A chess computer would need to represent the chessboard and the pieces that occupy squares on the board, i.e., it would need to represent a single position in data structures. There are several ways of doing thisâââsee here.
Before we talk about the next two steps, letâs understand why building a chess computer is hard. A chess computer would receive a given chess position as input and it would need to calculate the next best move. A lot of difficulty is here because of the complexity of chess.
- Each player has 16 pieces to play with and 20 possible moves.
- Suppose White starts the gameâââit has 20 possible moves. (Black also has the same optionsâââ20 possible moves.)
- Total Number of Moves For White =Â 20
- Moves for Pawns = 8 + 8 = 16 (one step) (2Â steps)
- Moves for Knights = 2 + 2 =Â 4
- Total =Â 20
- Then at Level 1: 20 possible moves for White.
- At Level 2: 20 * 20 = 400 possible moves for Black, depending on what White does.
- Level 3: 400 * 20 = 8,000 for White.
- Level 4 : 8,000 * 20 = 160,000 for BlackâŠâŠ
- For all possible positions, the computer would need to evaluate 10^120possible moves! (Side note: Go has ~ 10^700Â moves!!)
In other words,
The problem space for chess can represented by a game tree, where nodes represent board positions and edges represent legal moves. The complete game tree for a game is the game tree starting at the initial position (start of the game), containing all possible moves from each position, and ending at terminal position (end of the game: win/lose/draw). But chess has about 10^120moves (and about10^40 nodes)! So the best way to think about a game tree is as a theoretical constructâââit cannot be realized in the real world, itâs just too massive. But a player (human or computer) still needs to find a good move. This means a chess computer still needs to search a tree which is not too massive, but still has enough (relevant) nodes that can be examined to allow it to determine a next âgoodâ move.
Games, including chess, are difficult because the search trees become astronomically large.
What, then, does a chess computer have to do in order to beat the world champion?
Good game programs must: 1) prune irrelevant branches of the game tree, 2) use good evaluation functions, and 3) look ahead as many moves as possible (as fast a possible).
A chess computer would need to search game positions and evaluate the best move to make. But clearly evaluating every possible position is impossible. So chess computers would need to do the following well:
Generating all legal next states: A chess computer would need to know how to identify possible moves and select the most promising moves for further analysis (i.e. prune out bad moves and keep good moves). Since it is impractical to consider every possible move, a computer must make choices by its use of search techniquesâââthese are algorithms to select the best move. This is where a lot of the earlier artificial intelligence innovations took place. For example, a chess computer can evaluate 2 or 5 or 10 or 20 moves ahead in advance. And the depth of the tree it can generate depends on the speed of the computerâââthe faster the computer generates the moves, the better the performance.
Evaluating a position: Once a chess computer generates the tree it needs to evaluate the positions. When the search space is too large, the game tree can be created to a certain depth only. Usually, a computer cannot look ahead to all possible terminal positions. It must, instead, look ahead a few plies (half moves) and compare the possible positions, i.e. it must correctly evaluate the value of a board position, given no further search will be done at that position. This is done via the evaluation function, which assigns real number scores to these board positions. This evaluation function (and the algorithms) are often vastly different between different chess programs. It is extremely complex to tell how good a position is. For example, Deep Blue examined 200 million positions per second and used very sophisticated evaluationâââit had over 8000 features as part of its function.
Many chess computers also added endgame databases. These are databases of pre-calculated position evaluation of hundreds (or thousands or millions) of past games from top players. These endgame databases would mainly be used for openings and endgames.
There were two main philosophical approaches to developing chess computers: emulation vs. engineeringâââshould computers emulate human knowledge and decision-making or should computers improve search via brute force? Those focusing on the first approach would build programs that had a lot of chess knowledge and a relatively smaller focus on search. Those focusing on the engineering approach would focus on computational power, by using special-purpose hardware, and search innovations. Weâll see that the best chess computers used the second approach, but even they ended up using a lot of chess knowledge and sophisticated evaluation heuristics.
Keep this framework in mind while reading through the remaining parts.
Optional: Below is a brief summary of progress in this direction. Key events. Key people. Key discoveries. Key machines. Details in other parts.
1950s: Playing at a very basic level
Computing power was limited in the 1950s, so machines could only play at a very basic level. In this period researchers developed the fundamental techniques for evaluating chess positions and searching best possible moves, considering opponentâs possible counter-moves. These ideas are still in use today.
- In 1949â1950, Claude Shannon wrote the first article on computer chess titled âProgramming a computer to play chessâ. He described how to program a machine to play chess by scoring positions and selecting the next move. His work provided a framework for all future research in computer chess playing.
- In 1950, Alan Turing wrote the first computer chess program. And he wrote it before computers even existed! He knew computers were coming and once they were powerful enough, they would be able to play chess. The same year he proposed the Turing Test. In 1951, Turing tried to implement his program âTurochampâ on the Ferranti Mark 1 computer. He never finished.
- In 1952, Alick Glennie, who wrote the first computer compiler, defeated Alan Turingâs chess program. He was the first person to beat a computer program at chess.
- In 1956, Mark Wells wrote a program to simulate âLos Alamos Chess,â a bishop-less, 6âx6â version of chess. In doing so, MANIAC became the first computer to run a chess program. It took 12 minutes to search a four moves depth (adding the two bishops would take three hours to search at the same depth).
- In 1957, mathematician Alex Bernstein, an employee at IBM, created the first complete chess program for an IBM 704. The program took 8 minutes to search a four moves depth and could play a full chess game.
- Search innovation (1950): Minimax search (Shannon, Turing)
- Search innovation (1956): Alpha-beta pruning (McCarthy)
1960s: Drosophila of AI
In the 1960s, AI pioneers Herbert Simon and John McCarthy referred to chess as âthe Drosophila of AIâ, which meant that chess, like the common fruit fly, represented a relatively simple system that could also be used to explore larger, more complex real-world phenomena.
By the end of the 1960s, computer chess programs were good enough to occasionally beat against club-level or amateur players.
- In 1962, Alan Kotok, assisted by John McCarthy, developed the Massachusetts Institute of Technologyâs (MIT) first chess program, now known as the Kotok-McCarthy program. The program ran on an IBM 7090 and it took about 5 to 20 minutes per move, depending on the complexity of the situation. The program could beat amateur chess players. During the Cold War, Kotok-McCarthy played (and lost to) the best Russian chess program.
- In 1965, researchers from the Institute for Theoretical and Experimental Physics developed a chess program in Moscow. In 1966, this Russian program began a match with Kotok-McCarthy. The match lasted nine months and was won by the Russian program (3â1).
- In 1967, Mac Hack Six, by Richard Greenblatt (introduced transposition tables) and became the the first program to defeat a person in tournament play. In 1965, Hubert Dreyfus said, âNo chess program could play even amateur chess.â In 1967, Mac Hack VI beats Dreyfus.
- In 1968, McCarthy and Mitchie bet David Levy (International Master) $1,000 that a computer would defeat him by 1978.
- Search innovation (1966): Alpha-beta pruning (Kotok, McCarthy)
- Search Innovation (1967): Transposition tables (MacHack)
1970s-1980s: Now weâre talking
In the 1950s and 1960s, early pioneers focused on chess heuristics (rules of thumb) to choose the best next moves. Programs in 1970 also used heuristics, however, there was a much stronger focus was on software improvements and faster and more specialized hardware. Main chess programs used transposition tables (or hash tables) which stored information about positions the program had already searched. So, if the same position is reached on the board, the program wouldnât need to search again; it would use the previously generated information. This customized hardware and software allowed programs to conduct much deeper searches of game trees (involving millions of chess positions), something humans did not do (because they could not)Â .
The 1980s brought an era of low cost chess computers. First microprocessor-based chess programs started becoming available. Because of the availability of home computers and these programs, anyone could now play chess (and improve their game) against a machine. By the mid-1980s, the sophistication of microprocessor-based chess software had improved so much they began winning tournamentsâââboth against supercomputer based chess programs and some top-ranked human players.
Additionally, several search innovations were introduced: iterative deepening (searched down to a certain level of the game tree), opening books (included rules or sequences of moves, which experts knew to be good, to start a game), and endgame databases (contained sequences of moves that were good for ending a game).
- In 1970, the Association for Computing Machinery (ACM) organized the first North American Computer Chess Championship. Six chess programs took part in this event. The ACM chess events were cancelled in 1995 because Deep Blue was preparing for the face-off against the world chess champion Garry Kasparov.
- In 1974, the World Computer Chess Championships (WCCC) began. Thirteen chess programs participated in the first tournament, which was held in Stockholm, Sweden.
- In 1977, Chess 4.6 became the first chess computer to be successful at a major chess tournament.
- In 1977, the International Computer Chess Association (ICCA) was founded by computer chess programmers. That year, Grandmaster Michael Stean became the first grandmaster to lose with a chess program in a blitz game (chess games with five minutes for each player). It was much easier for a computer to beat chess Grandmasters in a blitz game. It would take another 11 years before a computer would finally beat a Grandmaster in a regulation game.
- 1978: No machine has been able to beat Levy (Levy defeated Chess 4.7 by 4.5â1.5). Levy wins the bet, but a machine does win the first ever game against him.
- In 1981, Cray Blitz won the Mississippi State Championship with a perfect 5â0 score and a performance rating of 2258. In round 4 it defeated Joe Sentef (2262) to become the first computer to beat a master in tournament play and the first computer to gain a master rating.
- In 1982, Ken Thompsonâs hardware chess player Belle earned a US master title and a performance rating of 2250. (Side note: Ken Thompson is the creator of UNIX operating system).
- 1983, 1986: Cray Blitz (software by Robert Hyatt) won consecutive World Computer Chess Championships.
- In 1985, Chiptest is built by Feng-hsiung Hsu ,Thomas Anantharaman, and Murray Campbell. It used a special VLSI move generator chip and could execute 50,000 moves per second
- In 1987, Chiptest-M is builtâââthe Chiptest team removed bugs in the chip. It could now execute 500,000 moves per second.
- 1988: HiTech by Hans Berliner of CMU defeated grandmaster Arnold Denker in a match.
- In 1988, Deep Thought by Hsu and Campbell of CMU shared first place with Tony Miles in the Software Toolworks Championship, ahead of several grandmasters including. It also defeated grandmaster Bent Larsen in a tournament game, making it the first computer to beat a grandmaster in a tournament. It could execute 700,000 moves per second. It obtained the performance rating of 2745, the highest rating obtained by a computer player. IBM took over the project and hired the people behind it.
- In 1989 Deep Thought lost two exhibition games to Garry Kasparov.
- Search innovation (1975): Iterative-deepening (Chess 3.0+)
- Search innovation (1978): Special hardware (Belle)
- Search innovation (1983): Parallel search (Cray Blitz)
- Search innovation (1985): Parallel evaluation (HiTech)
- Speed progress (1980s): In the 1980s a microcomputer could execute a little over 2 million instructions per second.
1990s: Beginning of the end?
In 1990s, chess programs began challenging International Chess masters and later Grandmasters. These programs relied much more on memory and brute force rather than strategic insight , and they consistently started to beat the best humans. Some dramatic moments in computer chess occurred in 1989âââtwo widely-respected Grandmasters were defeated by CMUâs Hitech and Deep Thought. Researchers felt machines could finally beat a World Chess Champion. This got IBM interested so they began working on this challenge in 1989 and built a specialized chess machine, named Deep Blue. It would end up beating Garry Kasparov, the best human chess player. So, did it think? And was it intelligent?
IBM researchers were awarded the Fredkin prize, a $100,000 award for the first program to beat a reigning world chess champion, which had gone unclaimed for 17 years. This (and later) victories in computer chess were disappointing to many AI researchers because they were interested in building machines that would succeed via âgeneral intelligenceâ strategies rather than brute-force. In this sense, chess had started to decouple from AI research.
- From 1991â1995, IBM worked on Deep Thought II, which was a stepping stone to Deep Blue. It was a 24 processor system and the Deep Thought software was rewritten to handle parallelism.
- In 1992, the ChessMachine Gideon 3.1 (a microcomputer) by Ed Schröder won the 7th World Computer Chess Championship in front of mainframes, supercomputers and special hardware.
- From 1992â1998: Chess Genius was a series of chess engines by Richard Lang, written for various processor architectures. The first version in 1992 was released as PC program running under 16-bit MS-DOS. These programs won the World Microcomputer Chess Championship in 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991 and 1993.
- In 1994, during the Intel Grand Prix Cycle, Chess Genius 3, operated by Ossi Weiner, won a speed chess game (25-minutes per side) against Garry Kasparov and drew the second game, knocking Kasparov out of the tournament. This was the first match (speed-chess) that Kasparov ever lost to a computer. In the next round, Chess Genius 3 beat Predrag NikoliÄ, but then lost to Viswanathan Anand. Unlike Deep Blue, which was running on massively parallel custom-built hardware, ChessGenius was running on an early Pentium PC.
- Speed progress (1990s): By the 1990s computers were executing over 50 million instructions per second.
The next part is about the history of chess machines (until Deep Blue)âââPart 3: Machines that Play (Chess)
The part after that (Part 4: Machines That Play (Deep Blue)) is about Deep Blue, which was a highly specialized machine designed to play chess:
- In 1993, Deep Blue lost a four-game match against Bent Larsen.
- In 1996, Deep Blue lost a six-game match against Garry Kasparov (4â2): a) 1.6 to 2 million positions per second per chip, b) 50 to 100 million positions per second for system
- In 1997, Deep Blue (3.5â2.5) won a six-game match against Garry Kasparov . Kasparovâs loss to Deep Blue was his first ever chess match loss in his entire life: a) Enhanced chess chip with 2 to 2.5 million positions per chip, b) 200 million positions per second
Now:
- No human can play the best computers on equal terms. We (humans) have had well over 1000 years to invent, play, and understand chessâââmachines have had less than 60 years and they are much much better than we are.
- Speed progress (now): Processors in our tables and phone can execute over a billion instructions per second.
Luke Muehlhauser Historical chess enginesâ estimated ELOÂ rankings
Part 3: Machines that Play (Chess)
Part 4: Machines That Play (Deep Blue)
Machines That Play (Building Chess Machines) was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.
Disclaimer
The views and opinions expressed in this article are solely those of the authors and do not reflect the views of Bitcoin Insider. Every investment and trading move involves risk - this is especially true for cryptocurrencies given their volatility. We strongly advise our readers to conduct their own research when making a decision.