The card reads: “When Yiving Citemester is put into your graveyard from the battlefield, look at the top card of your library. Then shuffle your library.”
It doesn’t take an intricate understanding of the rules of Magic: The Gathering — or any understanding of the trading card game at all — to see the absurd, self-negating pointlessness of that card’s ability.
But the artificial intelligence that designed the card is learning, says Reed Milewicz, a PhD candidate at UAB’s Department of Computer and Information Sciences. It won’t make that mistake again.
In June, Milewicz, a 26-year-old Mountain Brook native and Birmingham-Southern College graduate, posted on an online Magic: The Gathering forum that he was teaching an artificial neural network (ANN) to produce cards based on the popular game. Within a few days, the project was receiving attention from media outlets such as VICE and Gawker Media subsidiary io9. Milewicz was approached by several game companies — Magic publisher Wizards of the Coast not among them — which he says “seemed eager to recruit me.”
Much of the attention surrounding Milewicz’s project comes from the cultural salience of ANNs. Google, for instance, made headlines earlier this summer with its “Deep Dream” software, which transformed normal photographs into psychedelic nightmares by attempting to reconcile apparent patterns in the images with photographs already in its database.
Milewicz, though, came upon ANNs through his graduate research as a member of UAB’s iProgress lab under his advisor, Dr. Peter Pirkelbauer. “My research is in software reliability, which is to say that I am in the business of making sure that systems do not break or fail,” he says. Because software often operates on a scale “exceeding the human capacity for comprehension,” Milewicz says that it’s difficult to detect programming bugs or unpredictable “emergent behaviors” in the software.
“My research consists of developing formal tools and techniques that allow us to uncover the hidden rules that software obeys,” Milewicz says. “Much of that work has to be done by hand and it is very time-consuming and challenging. I knew that there had to be a better way.” Aided by Andrej Karpathy and Bill Zorn, PhD candidates at Stanford and the University of Washington respectively, Milewicz decided that artificial neural networks were a potential solution.
As their name indicates, artificial neural networks are a type of statistical model meant to imitate the learning process of the human brain. Typically ANNs rely on a large quantity of inputs from which it “learns” and adapts to be able to recognize or replicate those inputs. For instance, the voice recognition software of Android mobile phones uses ANNs to learn how to interpret its users’ voices. The more it hears you speak, the more it understands what you’re saying.
“When you teach a neural network, you are sending a series of signals at one end and expecting a specific set of signals to come out of the other end,” Milewicz says. “When it gets an answer wrong, you tell it so, and the weights on its connections are reshaped to make more likely that it will get the answer right in the future.”
Milewicz saw ANNs as a way “to teach programs to understand other programs.” While setting up ANN, though, Milewicz wanted to test the network’s ability to handle the arcane nuances of software’s rules. “I chose to experiment with Magic cards because the game represents a complex, rule-based system, one which I was already intimately familiar with,” Milewicz says.
Magic: The Gathering was first introduced in 1993 and holds the distinction of being the first trading card game ever produced. The game, which focuses on players casting various types of “spells” in attempts to outsmart their opponents’ strategies, remains popular even 22 years later, thanks to its extreme adaptability.
The game’s numerous expansions often introduce new rule concepts and gameplay mechanics that are able to exist within the established rule structure of the game — though it makes the Magic learning curve rather steep. In this way, Milewicz says, the game was an ideal analog for the complexities of software.
Milewicz and his fellow researchers began inputting the text of Magic cards into the ANN one character at a time, “and teaching it to predict the next character.”
“If the network sees ‘c r e a t u r’, it predicts that ‘e’ will come next to make the word ‘creature,’” Milewicz says. “Over time, it develops complex associations, like the fact that if it sees the word ‘merfolk,’ it should predict [the card’s color], because merfolk usually belong to the color blue.”
The cards generated by the program, like the nonsensical “Yiving Citemester,” are ways of testing the extent of the ANN’s learning. “All the network is doing is giving us an honest representation of what it thinks Magic cards look like,” Milewicz says. “For a human being seeing Magic cards for the first time, they can come across as incomprehensible garbage; the machine undergoes the same experience. It’s only with exposure, time and the right training conditions that all the pieces fall into place.”
Milewicz is still working on improving the ANN’s output, and the resulting cards are decidedly more coherent — though in a recent forum post, he notes that Wizards of the Coast, unlike many other game developers, “has made no attempt to contact me. No idea why… Maybe it’s just that they have a preference for flesh and blood designers.”
It’s that tension surrounding the concept of ANNs and artificial intelligence that gives the project a larger importance, Milewicz says.
“As a society, we’re comfortable with the idea of machines telling us where to eat or who to date, yet few really understand them or how they reason. It can be difficult to get people to critically evaluate that relationship,” he says. “Yet when they see a project like mine, it awakens that curiosity. Perhaps it’s because game design is a creative act, and creativity is something we think of as a uniquely human characteristic. That gets people talking. I like that.”