domenica, agosto 12, 2018

A word about the AI hype in chess

Some months ago, many of you have probably heard how a neural network trained from scratch in an afternoon by Deep Mind defeated the strong chess engine in the world, Stockfish.

Deep Mind get the hype started

This legit hype was started by Deep Mind, a subsidiary of google strong in artificial intelligence, published the paper "Mastering Chess and Shogy by Self-Play with a General Reinforcement Learning Algorithm".
In this paper, they demonstrate a general learning algorithm which was able to train a a neural network which would power a Monte Carlo Treee Search based chess engine to such a level to be competitive in chess with top notch engines. They measured competitiveness in chess by letting their engine playing a 100 games match against the back then latest release of Stockfish, Stockfish 8, the world-leading chess engine, maintained by a team of volunteers (disclaimer: I am part of this team) . It won by a convincing margin of 28 wins, 72 draws and 0 losses, in their own words, 
calling into question the widely held belief that alpha-beta search is inherently superior in these domains

I do now want to dispute this call by the Deep Mind team, but it could be done based on the match condition. It can be observed that, if one of the goals of this claim was to generate a hype, then it succeeded.

Open source takes over

Following this paper, a team of developer decided to start an open-source project to replicate the results. The ultimate goal was (and is) to show that this calling into question is a well-founded claim. They had of course some work to do: the paper by Deep Mind contained many details, but not all of them. Also, one of the criticisms was the Deep Mind engine was not a real UCI-compliant chess engine, and wouldn't have been able to participate in chess computer tournaments. So they had to replicate the scientific part of the paper, and also make a real chess engine out of it, being able to compete in chess tournaments. In that, they were supported by nonetheless than Gary Linscott, the gifted programmer who built Stockfish testing framework, see a previous post.
One very important remark: this neural network based engines need GPUs to work well, as the generic type of neural network used there are specifically designed to make use of the massive matrix multiply capabilities of GPUs.

LC0 go to TCEC

After some weeks in the project, the LC0 team (this is the name of the open-source project) was invited to send their program to TCEC. TCEC stands for top chess engine competition: it is a league where all chess engines can compete on standardized hardware. When invited, they start in division 4 and they can work themselves up to division 3,2,1,premier. The first two engines in division premier fight a titanic superfinal over 100 games. Last season (number 12) was won by Stockfish 9. Since the divisions are played out serially, for an engine it is possible, in principle, to start in division 4 and, in the same season, climb up all the divisions and win the Superfinal. TCEC management, however, decided not to invest in a GPU, yet as they were not sure of whether LC0 would keep existing and also for the speed in which they had to organize it. To make the story short, LC0 finished last.

LC0 hype grows

This did not discourage the team. They knew that the lack of a GPU would seriously cripple the engine and so they continued working, recruiting tester around the world for playing millions of games. In the meanwhile, private people would test the engine and publish the results online. In particular, kingcrusher, a well known and respected chess expert with 100k youtube follower, decided to back the project posting videos and analyses of this awesome new engine. The were invited back to TCEC, which was able to organize access to a server with 2 high-end GPUs. It was predicted that LC0 would rush through the divisions and challenge Stockfish itself. To add more drama, some days before the start of Season 13, it was announced that a second neural network engine would enter division 4. After some speculations it turned out that it was a more or less a derivative of LC0 and arguments followed. Nevertheless, this second engine, DeusX, was allowed to enter TCEC too. Expectations were running high for the new era of computer chess. The hype was at its maximum.

Full power neural network at TCEC

As I write now, division 4 ended some days ago. With a sort of an anticlimax, after some games, it was clear that, although LC0 and DeusX were very strong engines, they would not rush through divisions. LC0 finished first, and DeusX second, qualifying by 0.5 point margin for division 3. Division 3 is in course now: between the divisions, the admin of the site was started, and the new one had some experience with LC0 itself and was able to improve the settings of the dedicated server to give the two neural networks some more power. They also submitted updated engines. In spite of the efforts, after 20% of division 3 played out, they float in the mid-range of the league. It is somewhat expected that the division will be won by Ethereal, another very young, though classical engine, developed by a 2 persons team. The second slot for qualification is still open. Currently it seems plausible though not sure that one of both neural engines will win a ticket.

What do we learn from the hype

Maybe neural networks are the future of computer chess. Maybe not. Time will say. As usual, there is no free lunch and you shouldn't run where they say you get one. And by the way, don't do momentum trading. Avoid diets. And most important, if you start from scratch, don't expect to succeed soon.

Nessun commento: