The adventure of chess programming (1)

By Frederic Friedel

Can you guess how long it took, after the first computer was built, for people to embark on the task of teaching it to play chess? Just a few years, we hear you say? Correct — but it was a few years before there was a computer that could execute the code. That was written by one of the greatest minds of the 20th century. Alan Turing’s “Paper Machine” needed a human CPU, Turing himself. He had to laboriously calculate the moves with pencil and paper. The story was told by former chess world champion Garry Kasparov (and me) in 2012 at the Alan Turing Centenary Conference in Manchester, where we showed the audience a reconstruction of Turing’s program running on a modern-day computer, which Kasparov played against.

The full lecture was recorded and can be viewed on this page. Spoiler alert: Kasparov won the game.

Chapter two: One of the world’s earliest programmable computers, MANIAC, was set up in 1951 at the Los Alamos Scientific Laboratory. It was built to execute extensive calculations that were needed to optimize the implosion of thermonuclear weapons. But just weeks after its delivery scientists had already written code for it to play chess. The games were played on a reduced 6x6 board, and MANIAC actually managed to beat an amateur who had learnt the moves a few weeks earlier.

Scientists playing chess with the MANIAC computer [photo courtesy of Los Alamos National Laboratory]

My personal involvement with computer chess began thirty years later. As a rookie science journalist I had read an article describing the progress that had been made in the field, and after doing some research I presented an idea to my boss at the German national channel ZDF. “Do you know that computers can now play chess?” I asked legendary science anchor Hoimar von Ditfurt. His reply has stuck in my memory: “I wo!” (German for “you must be kidding!”). I spent half an hour explaining how it all worked, after which he said: “Write it up, we can do a 43-minuted feature on the subject.”

A few months later, in our studio in Hamburg, we played Scottish International Master David Levy against CHESS 4.8, the strongest chess program at the time. The moves were executed by a robot arm, remotely controlled by a giant mainframe in Minneapolis. It was a very exciting game that ended in a draw.

The documentary was a great success. Der Spiegel, Europe’s largest news magazine, reported extensively on it — in fact they staged a second match between the program and World Championship challenger Viktor Korchnoi a short while later (Korchnoi won comfortably). After our ZDF program a total of 95,000 viewers wrote in, requesting the notation of the game, annotated by Levy, German grandmaster Helmut Pfleger and by the computer itself. All of that is described in this report, which includes the game and commentary.

The success of the ZDF feature led to me being commissioned to do a second documentary on the subject, in 1980, this time for the other national channel, ARD. It was great fun and dragged me permanently into computer chess. I got to meet many pioneers in the field, including pioneer Claude Shannon.

Then, in June 1985, the 22-year-old World Championship Challenger Garry Kasparov was invited by Der Spiegel to Hamburg to do a major interview  and to face 32 of the most powerful chess computers on the market in a simultaneous exhibition. Kasparov won that event with a score of 32:0, documenting the superiority of the human mind over computers at the time. He also visited me in my home and we spent a lot of time discussing computers and the development of a database for chess. I was not a programmer, but fortunately found Matthias Wüllenweber, a physics student, who had single-handedly programmed a rudimentary chess database. We showed it to Garry and, at his urging, founded the company ChessBase. The full story is told in this article, and retold by Garry himself in this article.

First meeting: Kasparov, Friedel (on the right), with a team of journalists from Der Spiegel watching.

The program ChessBase is a classical database that allows players to rapidly sift through a very large number of games, looking for new openings and new ideas, and for weaknesses in their opponents. Today it is the study tool used by all ambitious chess players, without exception, from amateurs to World Champions. Version 15 of ChessBase was recently launched, with new features centred around research and training.

In 1990 we had an idea: instead of only giving chess players access to large amounts of data, wouldn’t it be nice to add a “chess engine” to the program, a module that can actually analyse with the user? At the time the first chess programs had appeared for IBM PCs, and we got a Dutch chess programmer, Frans Morsch, to provide us with a module one could call up for analysis in ChessBase. The logical continuation was to build a stand-alone chess playing program, and this was completed in 1991. We called it “Fritz”, for a specific reason: Germany had recently reunified and people were, for the first time really since WWII, feeling proud of the country. Fritz is the nickname the British had for Germans during the wars. It was also a better name than something like “Grandmaster Chess”, our original consideration. “Fritz showed me that you can actually take the pawn,” became normal banter amongst tournament players.

When Fritz 1.0 was launched our grandmaster friends thought it was quite cute — it actually played chess and avoided elementary mistakes. But of course the program was not a serious opponent. Versions 2 brought a clear improvement, and even top players had to be more careful when playing against it.

On December 28, 1992, I took the latest beta version of Fritz 3 with me to Cologne, where World Champion Garry Kasparov was preparing for a match. We installed the program on his HP OmniBook laptop and he played, compulsively, around 35 blitz games, against it. Fritz won four of them. It was an historic occasion: for the first time in his life Garry had actually lost a game against a computer, albeit at fast time controls and under informal circumstances.

As the world knows, four years later Kasparov played against a million-dollar machine developed by IBM. He won the match in Philidelphia against Deep Blue quite comfortably. The world-wide attention the event got prompted the computer giant to challenge him to a rematch. This was staged in 1997 in New York, and Kasparov faced an improved version of Deep Blue. He lost the match, not because the machine was stronger than him, but because he was out-psyched by the opponent. In my opinion the computer was close to 2700 Elo points in playing strength, and the World Champion was over 2800. But Deep Blue had a library of millions of opening moves, which it could consult during the game. Kasparov tried to counter this with unconventional lines of play, which were not at all suited to his style. He also knew full well that playing a machine is quite unlike human chess matches: make one mistake and you lose. During the game you are always under tremendous pressure, mindful that you must not commit even the slightest inaccuracy. That really cramped his style.

In the years of development of Fritz, which has currently progressed to version 16, I was able to experience this first-hand. Initially top grandmasters, who were regular visitors in my home, thought the program was cute; after version 3 they said it was getting better; then it became a “serious opponent”; then “wow, it’s really strong!” Fritz started to play in public tournaments and matches. In 1993 it in fact won the Computer Chess World Championship, ahead of a prototype version of Deep Blue.

Fritz vs World Champion Vladimir Kramnik. The first match in Bahrain was drawn, in the second, in Bonn, Germany, Fritz won.

In 2002 Fritz played a match against the human world champion Vladimir Kramnik, drawing him with 4-4 points, and in 2006 it beat him in a six-game return encounter 4–2. Soon matches against human players had to be abandoned, after chess engines had climbed the rating scale to over 3000 Elo points (the strongest human players are rated around 2800). Today top engines like Fritz, Stockfish, Komodo or Houdini are approaching 3500, which means playing them against a human opponent would be like racing Usain Bolt against a Ferrari. Simply unfair.

So why are chess engines still so popular? Not because people are eager to play against them, but because they can help you to analyse. They will explain moves, show you new ideas, tell you where you went wrong in your games. In my view this has had an overall positive effect, even if people tend to worry about “over-preparation” by top players. That is to a certain degree justified. But on the other hand, after analysing with computers players are willing to take greater risks and play more daring games, because they have seen how chess engines handle them. “If I simply take the pawn the position looks very promising,” players used to say; but the process of making sure that it does not lose to some tactical manoeuvre was so tedious that they would abandon the idea and play something safer. With chess engine assistance available at a single mouse click people are able to prepare more volatile strategies, analysing them thoroughly in a reasonable amount of time. The latest versions of Fritz have been tuned not to beat human opponents more soundly, but to help them to study the game, to train for opponents in their next tournaments and matches.

So where does this leave us? Chess programs are ridiculously strong, and their playing strength keeps increasing every year. How far can that go, and do we really need an engine that plays 4000 Elo chess? Well, the last year has brought a radically new development in chess programming — one that is relevant not just for the game but for humanity in general. In 2017 the Google company Deep Mind introduced an Artificial Intelligence program called AlphaZero, which was unlike any traditional chess engine that had been handcrafted over years by top programmers. Alpha Zero was only told the rules of the game, how the pieces move, and then, using massive hardware, worked everything out by itself, in self-play. After just a few hours of calculation the program had reached superhuman strength and was able to beat a top chess engine — making it the strongest entity that had ever played chess. And that is just the start.

But this is the subject for a later article in this series.