Google Deepmind researchers are teaching an AI how to understand language by getting it to recreate cards from Hearthstone.

Tens of million of people worldwide play Hearthstone, an online collectible card game set in the Warcraft universe, which also encompasses the massively popular MMO World of Warcraft and a major movie.

Now Google Deepmind, fresh from creating an AI that triumphed at a game it was thought no computer could master, has been using Hearthstone to test ways a machine learning system could generate natural language – such as English – and formal language – such as computer code.

Researchers tasked a system with writing the code that sets the behaviour of cards used in Hearthstone and in another famous collectible card game, Magic: The Gathering (MTG).

The Deepmind system — which implemented a novel neural network architecture — was first trained using code from open-source versions of Hearthstone, programmed in Python, and Magic: The Gathering, programmed in Java. The system ingested data from code that underpins more than 10,000 MTG cards and more than 500 Hearthstone cards.

Once trained, researchers tested the ability of the system to generate code needed to represent Hearthstone and MTG cards in each game.

Each card in Hearthstone and MTG has a written description that sums up the various attacks and power-ups that playing the card will grant. The Deepmind system was given descriptions from cards it wasn’t fed in training and asked to write the code needed to play those cards in each video game.

The system has room for improvement. When the code it generated was compared to that used in the actual games, only a small percentage of cards were generated correctly. Where it did create the correct code for the card, the cards were generally similar to those it had been trained on.

For example, as seen below, the system correctly generated code for Hearthstone’s Madder Bomber card – recreating both its attack and damage rating. However, researchers write that this is likely due to it being trained on the Mad Bomber card, which has the same attack but does less damage.

In contrast, the system failed to code the right effect for Hearthstone’s Preparation card, though it did generate the right properties.

When Deepmind’s generated code was compared to the actual code used to generate cards, using the machine translation evaluation algorithm Bleu, it scored 61.4 percent in MTG and 65.6 percent in Hearthstone.

Researchers will now focus on ways to generate code that can more accurately reproduce the cards, in particular effects relating to attacks, power-ups and the like.

While the work is focused on automatically generating Python and Java code from an English language description, the researchers suggest the broad approach taken to training could help in designing systems that answer natural language questions from humans.

More on Google Deepmind…