Skip to main content

The world’s most freakishly realistic text-generating A.I. just got gamified

What would an adventure game designed by the world’s most dangerous A.I. look like? A neuroscience grad student is here to help you find out.

Earlier this year, OpenAI, an A.I. startup once sponsored by Elon Musk, created a text-generating bot deemed too dangerous to ever release to the public. Called GPT-2, the algorithm was designed to generate text so humanlike that it could convincingly pass itself off as being written by a person. Feed it the start of a newspaper article, for instance, and it would dream up the rest, complete with imagined quotes. The results were a Turing Test tailor-made for the fake news-infused world of 2019.

Of course, like Hannibal Lecter, Heath Ledger’s Joker, or any other top-notch antagonist, it didn’t take GPT-2 too long to escape from its prison. Within months, a version of it had found its way online (you can try it out here.) Now it has formed the basis for a text adventure game created by Northwestern University neuroscience graduate student Nathan Whitmore. Building on the predictive neural network framework of GPT-2, GPT Adventure promises to rewrite itself every time it’s played. It’s a procedurally generated game experience in which players can do whatever they want within the confines of a world controlled by the fugitive A.I.

And you know what? Not since Sarah and John Connor teamed up with The Terminator to take on Skynet has the world’s most dangerous artificial intelligence been quite so much fun.

The game that rewrites itself

“GPT-2 is basically an extremely powerful predictive text algorithm,” Whitmore told Digital Trends. “You give it some text and it tries to predict what comes next. This is really well-suited to text adventure games. You can feed in the player’s current location and their action — [for example], ‘go east’ — and then you just ask GPT-2 to predict what text comes next, which is the consequence of that action. Then the player makes another action, and you have a game.”

Image used with permission by copyright holder

In GPT Adventure, the text world of the game is generated by the predictive GPT-2. That means that, instead of programming a collection of rooms and monsters in advance, the game starts your character in a location and then uses A.I. to figure out what happens next.

To turn GPT-2 into the world’s most dangerous Dungeon Master, Whitmore started out by collecting transcripts of users playing Zork and Colossal Cave Adventure. These text-based adventure games were created in the mid-1970s, originally for Digital Equipment Corporation’s PDP-10 mainframe, a computer about the size of a refrigerator, and considerably less powerful than the devices most of us carry around in our pockets. He was inspired by Mind Game, a fictitious game that’s generated in real-time by artificial intelligence in Orson Scott Card’s sci-fi novel Ender’s Game.

“[To create the game, I had to] train GPT-2 to produce text that looks like the game transcripts,” Whitmore continued. “This is done using algorithms that automatically adjust GPT-2’s internal parameters until the text it produces looks like the text from the text adventures. This lets GPT-2 learn the mechanics of text adventure games; things like ‘If the player says look east, describe an object to the east of them.’”

“You give it some text and it tries to predict what comes next.”

The resulting game looks and plays a lot like the decades-old text adventure games it is modeled on, with the same basic elements and gameplay mechanics. Whitmore acknowledges that he had to make a few tweaks along the way. “Even with this, GPT-2 sometimes makes mistakes like forgetting where the player is,” he said. “So there’s also some manually written code that tries to correct the more common kinds of mistakes and make the game more playable.”

On the face of it, the resulting game is simplistic. It’ll play in your browser (you can follow the simple instructions to get it started here) and, unlike Ender’s Game’s Mind Game, there are no graphics. Whitmore said, “I did play around with using this neural network to automatically generate images based on the place descriptions which yielded some weird results.” However, these are not a part of the finished product.

But is it creative?

GPT Adventure is good fun, albeit full of the strange flourishes that occur when people use A.I. to generate new scripts for, say, one of J.D.’s monologues from Scrubs or a chapter from a new Game of Thrones novel. If you’re familiar with the source games, you can begin to see where some of the ideas and concepts have been lifted from and mashed together in strange new ways.

Click to enlarge

Really, though, it hints at something amazing: Another piece of evidence that machines can, to some degree, display creativity. While logic doesn’t always apply, players can type any command into the game and, in many cases, it will oblige and try to come up with whatever step follows next.

“From a gameplay perspective, the cool thing is it can be totally open-ended and you can do basically anything you want,” Whitmore said. “I tried a version of it where you’re exploring a space station instead of a cave. I can say ‘>eat rock’ or ‘>ride sheep’ and the game will just go with it and try to figure out what should happen next. You can do all this weird stuff that no-one would ever bother to program because the GPT-2 model has enough ‘common sense’ knowledge to roll with it in a believable way.”

“You can do all this weird stuff that no-one would ever bother to program because the GPT-2 model has enough ‘common sense’ knowledge to roll with it in a believable way.”

Would he say that it’s creative? “I think it’s creative in a very basic way, like how a person playing ‘Apples to Apples’ is creative,” Whitmore continued. “It’s taking things from old adventure games and rearranging them into something that’s new and interesting and different every time. But it’s not actually generating an overall plot or overarching idea. There are a lot of different kinds of creativity and I think it’s doing one: Generating novel environments, but not the other kinds: Figuring out an intriguing plot for a game.”

A step in the right direction

Ultimately, just as text adventure games were just one step in the process that led to today’s cutting-edge 3D games (and will continue on from there), so GPT Adventure is just another data point in the advance of A.I. But it’s a pretty darn exciting data point — and, as Whitmore notes, the fact that such tools are now publicly available makes things all the more fun.

“One of the really cool things about this is that there are public tools like GPT-2-simple and Google Colaboratory (read: Google’s Jupyter notebook environment which runs programs in the cloud and stores its notebooks on Google Drive) that make it really easy to do these kinds of creative things with A.I.”

Anyone want to guess where things go from here? Heck, if the Simulation Hypothesis is true, maybe we’re all in a big A.I.-generated adventure game already…

Editors' Recommendations

Luke Dormehl
I'm a UK-based tech writer covering Cool Tech at Digital Trends. I've also written for Fast Company, Wired, the Guardian…
Emotion-sensing A.I. is here, and it could be in your next job interview
man speaking into phone

I vividly remember witnessing speech recognition technology in action for the first time. It was in the mid-1990s on a Macintosh computer in my grade school classroom. The science fiction writer Arthur C. Clarke once wrote that “any sufficiently advanced technology is indistinguishable from magic” -- and this was magical all right, seeing spoken words appearing on the screen without anyone having to physically hammer them out on a keyboard.

Jump forward another couple of decades, and now a large (and rapidly growing) number of our devices feature A.I. assistants like Apple’s Siri or Amazon’s Alexa. These tools, built using the latest artificial intelligence technology, aren’t simply able to transcribe words -- they are able to make sense of their contents to carry out actions.

Read more
World’s Fair 2.0: The mission to resurrect the greatest tech expo of all time
New York World's Fair — Unisphere & Flag Display

The Twitter header image belonging to Cameron Wiese is a black-and-white photograph of the Unisphere, an enormous, spherical, stainless steel representation of Earth created as a centerpiece for the 1964/1965 World’s Fair in Flushing Meadows-Corona Park in Queens, New York.

Over two six-month stints across a couple of years, the Unisphere was seen by more than 50 million people who visited the World’s Fair’s 650 acres of displays, pavilions, and public spaces, bringing together citizens, cities, nations, and corporations for a tantalizing glimpse at the future. The Unisphere served as a symbol of humanity’s shared home and, perhaps, of our ability to bend its resources to our will. At various times during the World’s Fair, a performer wearing a Bell Aviation's Rocket Pack jetted past the massive globe, highlighting humankind's ability to rise above any and all challenges.

Read more
Language supermodel: How GPT-3 is quietly ushering in the A.I. revolution
Profile of head on computer chip artificial intelligence.

OpenAI’s GPT-2 text-generating algorithm was once considered too dangerous to release. Then it got released -- and the world kept on turning.

In retrospect, the comparatively small GPT-2 language model (a puny 1.5 billion parameters) looks paltry next to its sequel, GPT-3, which boasts a massive 175 billion parameters, was trained on 45 TB of text data, and cost a reported $12 million (at least) to build.

Read more