stub Text-Based Video Game Created With OpenAI's Powerful GPT-2 Algorithm - Unite.AI
Connect with us

Artificial Intelligence

Text-Based Video Game Created With OpenAI’s Powerful GPT-2 Algorithm

Updated on

A neuroscience graduate student at Northwestern University recently created a  text-based video game where the text the user reads is entirely generated by AI. The AI responsible for generating the text is based on the GPT-2  algorithm created by OpenAI earlier this year.

Many early computer games had no graphics, instead, they use a text-based interface. These text adventure games would take in user commands and deliver a series of pre-programmed responses. The user would have to use text commands to solve puzzles and advance farther in the game, a task which could prove challenging depending on the sophistication of the text parser. Early text-based adventure games had a very limited range of potential commands the game could respond to.

As reported by ZME Science,  Nathan Whitemore, a neuroscience graduate from Northwestern University, has revitalized this game concept, using AI algorithms to generate responses in real-time, as opposed to pre-programmed responses. Whitmore was apparently inspired to create the project by a Mind Game that appeared in the Sci-Fi novel Ender's Game, which responded to user input and reformed the game world around the user.

The algorithm that drives the text-based adventure game is the GPT2  algorithm, which was created by OpenAI. The predictive text algorithm was trained on a text dataset, dubbed WebText, which was over 40 GB in size and pulled from Reddit links. The result was an extremely effective predictive text algorithm that could generate shockingly realistic and natural-sounding paragraphs, achieving state-of-the-art performance on a number of different language tests. The OpenAI algorithm was apparently so effective at generating fake news stories that OpenAI was hesitant to release the algorithm to the public, fearing its misuse. Thankfully, Whitmore has used the algorithm for something much more benign then making fake news articles. ‘

Whitmore explained to Digital Trends that in order to produce the game he had to modify the GPT-2  output by training it extensively on a number of adventure game scripts, using various algorithms to adjust the parameters of GPT-2  until the text output by the algorithm resembled the text of adventure games.

What's particularly interesting about the game is that it is genuinely creative. The user can input almost any text that they can think of, regardless of the particular setting or context of the game, and the game will try to adapt and determine what should happen next. Whitemore explained that you can  enter almost any random prompt you would like because the model has enough “ common sense” to adapt to the input.

Whitemore’s custom GPT2  Algorithm does have some limitations. It easily forgets things the user has already told it, having a short “memory”.  In other words, it doesn't preserve the context of the situation with regards to commands, as a traditional pre-programmed text adventure game would, and of course, like many passages of text generated by AI, the generated text doesn't always make sense.

However, the program does markedly well at simulating the structure and style of text adventure games, providing the user with descriptions of the setting and even providing them with various options they can select to interact with the environment it has created.

“I think it’s creative in a very basic way, like how a person playing ‘Apples to Apples’ is creative,” Whitmore explained. “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.”

Whitmore’s project also seems to confirm that the GPT-2 algorithms are robust enough to be used for a wide variety of other purposes outside of generating text intended only to be read. Whitemore demonstrates the algorithms can be used in a system that enables user responses and feedback, and it will be interesting to see what other responsive applications of GPT-2 will surface in the future.