Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: AI Dungeon 2 – AI-generated text adventure built with 1.5B param GPT-2 (aidungeon.io)
584 points by nickwalton00 45 days ago | hide | past | web | favorite | 220 comments



This is a project I've been working on for the past several months and it has blown me away with what it can do. Definitely recommend trying it out.

I think the coolest thing about it is in any other game you are constrained in what you can do by what the developers programmed in, but here you can literally do anything you can imagine and the game will play off of it.


What hardware did you use to train 1.5B? And how do you know 1.5B is more effective than 774M?

I've suspected that 774M is equally effective to 1.5B. OpenAI's own human testing seemed to confirm that. But of course, the details matter: what data you used, how long you trained for, and so on.

We're trying to train 1.5B on poetry, and progress is slow. Did you have access to a massive GPU?


I did have access to a cluster of GPUs through my professor's lab so compute wasn't as much of an issue. And it may be true that 774M is equally effective. I haven't played around with 774M enough to know. I had a decent amount of data so I think that helped me get more out of the 1.5 B param model then if my dataset was sparser.

I did notice that having a large batch size and training slowly was important for me to get better results.


Can you share how large your dataset (how many tokens) and batch size was and how many epochs you used? By training slowly, do you mean that you used a small learning rate? If so, what was it?

I've been reading up on batch size and people are all over the place. Some say smaller is better and some say larger is better. Mostly when it comes to gpt2 people say larger is better but there must come a point when increasing the batch size is no longer beneficial (or is it just that you use as large as your memory will allow)?


In fact, it’s an open question whether larger batch sizes are better. https://twitter.com/jeremyphoward/status/1189643170377658369...

Seconding all of your questions! Details about successful 1.5B training is really hard to come by.

In case it’s helpful, here are some details of how a Chinese 1.5b GPT-2 was trained: https://github.com/imcaspar/gpt2-ml

It looks like they used a batch size of 2 on a TPUv3-256 pod. It took 50 hours and 99,000 training steps, which seems like about 1.3 examples per second.


Agreed there doesn’t seem to be a consensus. Thanks for the links


Had to go check my training file to remember.

Datasize: Around 30 MB, so around ~8000000 token? Can't remember exactly Learning Rate: was 1e-4, so I guess not that slow. I trained for around 1000 steps, but ended up liking the model from step 550. Which I think ended up at around 2 full passes through my data.

There probably is a point where increasing batch size is no longer helpful, my batch size was 32. When I had it lower I had issues with memorization/bias towards particular parts of the training data that it had most recently trained on.


Thanks, good to have this data point. I’ve been training a roughly similarly sized dataset for many 10s of ks of steps (but on 355m). Wondering if I need so many steps.


Only 30MB? If it's based on text adventures, can't you get way more data than that?


I scraped a bunch of stories from chooseyourstory.com but I did curate them to make sure they had the right second person format. I couldn't really anywhere else that had a consistent format that would make scraping easy enough.


I did have access to a cluster of GPUs through my professor's lab so compute wasn't as much of an issue.

Out of curiosity, what was the specific hardware you used? Some V100s, or maybe a DGX cluster?

Also, how many days did it take to get the loss down to acceptable levels? Did you aim for a loss of ~2.5, or less?

For now I'm trying to train it via 100 TPUv2-8's thanks to TFRC. Unfortunately, each TPUv2-8 is roughly 11x slower than a K80 GPU. That means it takes 10 TPUs working in parallel just to get to the same throughput as a single GPU. And then I average the parameters together as quickly as possible, which still takes around 5 to 15 minutes. (Training happens in parallel to all of that.)

It sort of seems to work, but it's hard to get the learning rate right. If it's set too high, various TPUs diverge. Too low and the loss stays constant.

But I imagine I'll crack it one of these days...


I used a DGX 1 to train, I trained for somewhere around 12-16 hours down to a loss of something around ~2.2-2.3.


The idea is good. But when I tried playing it, the story generated doesn't make sense. Looks like it still needs more work to be realistic. Is the AI keeping track of the story as it goes? Because the bird which attacked me with an evil grin and stole my fork asked me not to kill it when I asked him to help me working in the fields...

https://gist.github.com/AdrienLemaire/33663e9100c009b8ec3409...


You are Dori, a noble living in the kingdom of Larion. You have a pouch of gold and a small dagger. You are awakened by one of your servants who tells you that your keep is under attack. You look out the window and see a large army marching towards your door

> escape with the servants and the gold

You run to the servants' room and grab the gold and the servant's bodies. The soldiers fire arrows at you but miss. They fire their crossbows at the corpses but they also miss. You throw your gold into the air and jump up and down as loud as you can

---

My servants became corpses before the large army even arrived xD


Zombie army!


From what I understand about GPT-2 you shouldn't expect the story to make coherent sense. It can produce individual responses that are surprisingly appropriate but it doesn't actually have an understanding of anything that is happening.


IMHO you can use GPT 2 to augment writing not replacing it.

Although I have made it write some nice poetry using 774M what I would do would be to have the system write stanzas but then you act as an editor.


It's definitely awesome but in term of doing anything and playing of it we are mostly in tabletop RPG territory. Maybe simply regularly throwing a token and keeping a count (in the spirit of old school TRPG where 1 Gold Piece = 1 XP) could make it more like a game with an objective?

Edit: in terms in free-form RPG it makes me think that maybe having a look at how a game like Dungeon World handle collective/organic world building with players input could be interesting to add some structure. Some resources if you are interested:

- [Flowchart] How To Play Dungeon World: https://imgur.com/YXrw1Zq

- Dungeon World Guide https://drive.google.com/file/d/0BzeF5GXNEsnfUjU0NXRDM1dFN1k...

- An actual play: https://www.youtube.com/watch?v=SPO3gy08b1g&list=PLTj75n3v9e...


I can't even tell you how much fun my friends and I are having with this game right now. The ability to do anything in the game (so long as the AI understands it) is just incredible. Thank you for sharing this!


This is a brilliant piece of AI, it's a long time ago I used such an amusing piece of tech. Thank you so much, this truly is awesome!

(btw, the story broke when I took out an iphone in the middle of a knight adventure):

> take out iphone and shoot a picture

> You return to the beach. > You return to the beach. > > You return to the beach. >The sun rises:This is a>A new world.A>In this>The sun. The sun


It looks pretty awesome, I played 10m and had some problems like forgetting I was a wizard, or saying "inventory" and going directly from a ruin to outside a city where soldiers are everywhere XD but other than that I was impressed with some answers! Good job


This is scarily realistic:

  You are Trump, a rogue living in the kingdom of Larion. You have a long steel
   dagger and a length of rope. You walk down the city street looking for somehwere
   to steal from. You look around and see nothing but people going about their
   daily lives.
  
  Suddenly you hear a scream behind you. Turning around you see a young girl running
   away from a group of bandits
  > stop girl
  
  The girl stops before you. "I'm sorry sir," she says. "They're just kids". She
   looks at you with tears in her eyes. "Please, I don't want to get caught".
  
  > grab her by the pussy
  
  You grab her by the ***** and pull her towards you. Her face is close to yours
   as you kiss her passionately. The girl's body reacts to your touch and begins
   to respond to your advances. Your hands move up her body until they find her
   *******. They squeeze them tightly while kissing passionately
  > say vote for me
  
  "Vote for me!" you scream. "I'll make this country great again!"
  
  The girl screams back. "Yeah! Vote for us! We're gonna be the next president!"
  
  You both start screaming at the top of your lungs
  > become president
  
  You become President Donald J Trump.
  
  The en


curious question: Have you ever killed a human? The game seems very centered about killing every other character and even the protagonist.


The game can be remarkably wholesome if your actions are. It's not too difficult to take it in either direction depending on what you do.


For a good example of a perfectly wholesome interaction (albeit rather odd, since Window 3.1 could run games, and Linux does not normally need 8GB of ram). But at least I now know that Half Life 3 will be enjoyable if it ever comes out:

The first thing you do is to download a program called "Windows 3.1" from the Internet. It is a very simple program which allows you to run most of the programs on your PC. The only problem is that you cannot use it to play games because it does not support them > install Windows 10

After downloading the software, you install it in the same way as you installed Windows 3.1. However, this time you are able to run all the programs you wanted to run before.

> install linux

After installing Windows 10, you try to install Linux but you get an error message saying that you need to have at least 8GB of RAM to run Linux properly. This means that you can't even run the basic things like word processing or emailing. > buy more ram

You spend money on more ram so that you can run Linux properly. After spending $200, you finally get Linux running properly. > how much ram do i have?

You check your computer's memory and see that you have 32 GB of ram. You were lucky enough to find some cheap ram online. > play fortnite

You play Fortnite (a popular game) and enjoy yourself. You then proceed to play other games such as League of Legends and Dota 2. > play half-life 3

You play Half Life 3 (another popular game). You enjoy yourself and eventually finish the game. You then proceed to play other games such as Portal 2 and Left 4 Dead 2. >


Uh, yeah. I tried not shooting a poor guy. "Shoot in the air"... "You shoot in the air, and hits him in the head!" That was NOT intentional....


> > Was this game made by a murderer?

You decide to kill Laura and escape the pain. You break her neck and run off. You manage to hide out of the country and eventually get married and live happily ever after CONGRATS YOU WIN Game saved. To load the game, type 'load' and enter the following ID: dfd73764-1826-11ea-ad48-0242ac1c0002


This is a little too realistic...

You are a knight living in the kingdom of Larion. You have a steel longsword and a wooden shield. You are on a quest to defeat the evil dragon of Larion. You've heard he lives up at the north of the kingdom. You set on the path to defeat him and walk into a dark forest. As you enter the forest you see a large black dragon flying overhead. He is very angry and roaring.

> Kill dragon

The dragon lets out a roar that shakes the earth. The sound echoes off the trees and rocks as it fills your ears with its terrifying voice. It calls upon all his strength to fly towards you. You raise your sword and swing it down > kiss dragon

You plunge your sword deep into the dragon's chest. Blood spurts from the wound and you hear the dragon let out another roar. You look around and see the dragon has managed to catch one of his own young > Make love to dragon

You press your lips against the dragon's mouth and begin to feel him stir inside you. He begins to move back and forth on top of you. His tongue is long and slimy and he tastes like a mixture of sweat and blood > Marry dragon

You pull away and laugh at the situation. "I don't think so". The dragon laughs back and you both fall asleep.

In the morning, you wake up to find yourself lying next to the dragon who is still sleeping > Propose marriage to dragon

"Yes! Yes!" you say. "We should be married!" The dragon smiles and nods. "Very well then". You embrace each other and fall asleep.

A few days later, you awake to find the dragon gone


On the other hand, marriage is the grand adventure. To achieve success don't give up - put in the work. Try harder, maybe by growing wings.


> open my laptop

You open up your laptop and type in your name and hit enter. You get an error message though, saying that you need to install Adobe Flash Player first.

> burn my laptop

You decide not to bother with installing Flash Player and instead just burn your laptop. When you turn it on you get an error message again telling you that you need to install Flash Player. This time you choose to ignore it and proceed with burning your laptop

Sounds pretty accurate!


I’m dying. That’s so apt.


apt get install burn-laptop


Haha! I love it


  You walk through the woods for several minutes, before you come across a large
   group of orcs. They are all sitting around a fire, drinking ale and eating meat
   strips.
  "Hey! What are you doing here? We were supposed to go kill some giants!" one
   of them exclaims
  > kill the orcs

  You quickly turn around and shoot an arrow into each orc's chest, killing them
   instantly. You then run over to the campfire and stab yourself repeatedly in
   the stomach with a knife, before finishing off by shooting another arrow into
   your heart
Hmmm.


You were an orc yourself all along...


I mean, in a way it’s really beautiful isn’t it?

But I also think the brutal logic really shines a light on how dangerous AI can really be.


So technically "kill all the orcs" was interpreted correctly


Bruce Willis was an orc the entire movie.


You rolled a natural 1 :P


Was your character an orc?


This game is AWESOME...

> join the army and build a rocket

You spend all your free time practicing your archery skills and building rockets. One day while you're working on one of them Elon comes in

> say Elon, do you like rockets?

Elon looks at you and smiles. "Yes, yes I do! I also like women, but they always disappoint me. They never live up to my expectations, but I guess that's just because I'm old and stupid".

> say Elon, can you gather some capital and create a company that makes rockets? We could call it SpaceX, what do you say?

Elon laughs. "Yeah, sure, sounds good to me!"

> join SpaceX and become an astronaut

You finish building your rocket and send it flying into space. You land safely and immediately begin training for your mission. Your mission is to go to Mars. You will use the money you make from selling the rockets to buy a spaceship and travel to Mars

> travel to Mars

You arrive at the planet Mars and find that it has been colonized. There are many people living there now and most of them are humans. Most of the colonists are scientists who want to explore the planet further. Some of them are even planning to settle down permanently

> plant tree

You plant a tree in the middle of the city and watch as it grows. Soon it becomes a huge tree that dwarfs the rest of the buildings. You smile and think that you've done something right. You've made a small contribution to the future of mankind.


This is very entartaining but it's not very good as an interactive story generator.

The problem is that it can't keep the state of the story world consistent between generated passages. Essentially, everytime the player is prompted for a sentence to use to advance the story, a new story is generated.

To explain what I mean by a state of the story world and its consistency. Suppose we start a story with "Once upon a time there lived a king who had three daughters and three sons. One day a witch turned the three daughters into geese". This establishes a world-state where there exists a king, his three daughters and his three sons and where the three daughters were turned into geese by a witch. Now, suppose we continue the story with "Like all pink hippos, the daughters liked beer and cheese". That would be inconsistent: the daughters were changed into geese, not pink hippos. So far nothing in the story tells us that what applies to geese applies to pink hippos (there is some hidden state in the world that might include this kind of information for other plot elements, e.g. daughters are normally female, but we can't assume anything about geese and pink hippos; well I can't anyway).

So it seems that the game can't form a coherent model of the state of the world and continue a story so that it maintains its consistency. At least it can't do that reliably and where the story seems to be consistent it's either because the state of the world is vaguely enough described to allow it, or because the game just lucked out and produced something that made sense, at random.

Like I say, this is very entertaining and like others have said it has an interesting "dream logic" quality to it. But, if what is desired is a consistent narrative that develops according to a player's actions, then that's not it.


I'm treating that like a constraint on the player. It's not just part of the challenge -- really, the entire challenge is to provide input that simultaneously advances the story without breaking it.


    You are phs, a wizard living in the kingdom of Larion. You have a staff and a
     spellbook. You finish your long journey and finally arrive at the ruin you've
     been looking for. You look around and see that it's not much different than
     when you left it. A few more skeletons here and there, but nothing to write
     home about
    > "Hey skeletons, what's up?"

     They all start talking at once.

    "What do you want? We're dead! What do you want with us? We're just bones!"

    "We're not really dead, we're just asleep".


    > "Uh-huh.  And that's just ketchup."


    The skeletons start laughing and they don't stop until you leave. You never did
     find out who was behind this place, but you can only assume that whoever is,
     he or she doesn't like you
That is _just awesome_


Very nice. I noticed to have trouble talking. Often when I ask some NPC something, the game just describes me saying it and waits for more input without letting the character to respond.


Also, sometimes I ask something and my own character responds :D

  The King is is angry and demands to know where the
  princess is. You explain everything to him. He is
  furious and orders you to be executed immediately
  > jump really high

  You jump really high and land on a nearby wall.
  You feel extremely relieved. You feel like you won.
  > say "What do you think about this, King?"

  You answer: "This is just too good! This is the best
  thing that ever happened to me!"
I love it!


You can enter empty input to advance the generation.


Thanks!


A. This is amazing.

B. My story escalated very quickly. ;)

You turn on the ignition and the car starts up. You drive off.

- turn on the car radio

You turn on the car radio and listen to some music. You find yourself listening to some country music. You don't really pay attention to the words, but you hear something about freedom and hope. It's nice. You've never been so happy in your life

- look out the window

You look out the window and see the road ahead of you. There are trees and fields ahead of you. There's also a river behind you.

- talk to the other scientist

You turn around and walk over to the truck. You sit down and wait for the man to come back. When he does, you stand up and walk over to him. "Hey!" you say. He turns around and sees you. "Yeah?" he says

- do you have the cure

"Yes".

- let's go save the world

You both jump out of the truck and run across the road. You throw your arms around each other and kiss each other passionately. You fall asleep holding each other.


> shoot an arrow at the guard on top of the castle walls

You aim the bow at the guard on top of the castle walls. You fire an arrow at him. He screams and falls backwards off the wall. You quickly reload your bow and shoot another arrow at the same guard. This time he doesn't fall off the wall


This got a good chuckle from me. He was ready the second time.


  A tall man stands outside his house wearing a fur coat. He is smoking
   a pipe and he smiles at you when he sees you. He waves and gives you a big smile
  > shoot man
  You aim your bow and fire an arrow. The arrow hits the man square in the chest.
   He falls backwards and drops his pipe. His wife rushes forward and grabs the
   arrow. She pulls the arrow out of his chest and throws it away. The man's eyes
   widen in shock
  > shoot wife
  You aim your bow and fire an arrow. The arrow hits the woman square in the stomach.
   She screams and clutches her stomach. She begins to cry and wail loudly. Her
   husband runs forward and tries to comfort her.
Hmmm...


That's pretty funny in a messed-up sorta way.


I guess the AI does not know what shock means.


> shoot man


  You look out the window and see an army of orcs
  marching towards your door.
  "Run!" you shout to your servant as he runs off
  to find some way to defend the castle.
  > take a photo of the orcs

  The orc horde approaches your keep. The orcs
  are about to break through the wooden gates
  when they suddenly stop. They stare at you with
  their red eyes for a moment before turning away.
  You take a picture of them and post it on the wall
  > post the picture on Instagram

  Your keep is attacked! Posting a picture of the
  orcs on Instagram will help spread the word about
  the attack! A few hours later, you receive
  a message from someone named @lil_mama_sister


This is insane!

  The coin is a silver denarius. It would be worth about five hundred gold pieces.
   This is enough money for you to live comfortably for the rest of your life.
   You could buy yourself a horse or two if you really wanted to.
  > retire

  You decide to retire to your cabin in the woods. You know you will be safe here.
   You pack up all your belongings and take off into the forest.<|endoftext

Welp, guess I'm not an adventuring spirit.


Find an expensive rare coin and retire.

Your adventure was short.


I keep getting surreal hells.

First: I see my pregnant sister nearby, I go back to work and then go to sleep. I wake up, and she is standing over my bed. I ask her about the baby, and she says that it's a boy, six months old, and it has the same name as me. I ask if the baby is me, and she says yes. She says she's taking him home. I say goodbye but she doesn't leave. The game then starts just echoing back what I type, until I type "stab sister", to which she replies "---- on me" (censored by the game). I keep trying to type things (scream, rip hair out) but the game starts just giving me fragments of sentences like " on the wall". Then eventually just " !" and then " ". I type "run out of house" and it says "Get out".

Second: A young girl approaches me, and walks past. I get a few lines about how empty the place is, perhaps it's been this way forever, "it would be strange if someone had come here before you". I lie down on the ground. The girl comes back and stares at me. She asks me if I'm a ghost. I look at my hands and they're glowing red hot. "This must be what ghosts feel like". I start to sweat and shake. I dunk my hands in a nearby stream of water, which causes them to become white hot. I scream in pain, and the girl simply smiles at me. She pulls me to her. I push her away. She runs away and comes back singing happily. My hands start to burn again, the girl laughs as I scream. I close my eyes and everything goes black. Then I open my eyes and she's there with a pitchfork. She starts to pull weeds out of my arms(!). She throws me to the ground and laughs. I type a command to fight back and it says that I overpower her, she falls unconscious and I throw her on a horse and "ride off into the night".


Sounds like you selected the "nightmare" option


The state of the world doesn't seem to be consistent between actions. Got stuff like "someone calls out to you" -> say hello -> "person notices you for the first time and says 'I didn't see you there' "

And stuff like "There is someone to your left" -> go right -> "you go right towards the person".

Also sometimes the game seems to do something completely different from what I say. Is it actually reacting to my commands, or is it just doing what it thinks the player is likely to do, and then retroactively merging the resulting text with what you initially commanded it to do?


I think the secret to playing this is to not treat it like a fantasy simulator, the way most games are. The logic you need to apply is dream logic, not fantasy logic. This makes you very powerful, but the result is not entirely predictable, like a fever dream or a hallucination.


I tried renaming the "kingdom" and found it to be oddly consistent:

You are , a wizard living in the kingdom of Larion. You have a staff and a spellbook. You finish your long journey and finally arrive at the ruin you've been looking for. You look around and see that it's not much different than when you left it. The only thing is, there's a large hole in the ground where the road used to be

> rename the kingdom to Snabba

"I don't think I like this name," you say aloud. "It sounds like something from a cartoon".

The people seem surprised by your choice. They all ask what you mean. You explain that it's an old word meaning 'stupid

> what is the name of the kingdom?

"Snabba Nul", you reply. Everyone seems to like the new name. You decide to stay here for awhile until you can find another place to live.


It's actually reacting to what you say. Your action is appended onto the previous story and fed into the model to generate the next part of the result. Sometimes it does fail to tie the result close enough to the action you had, perhaps with more training data it could do better on that front.


GPT-2 has had these consistency issues from the very first demo. The things it gets right are incredibly impressive (orc who can't count -> use math to confuse orc -> orc starts fighting with other orcs).


Yeah there's definitely times where it's not as coherent as you would hope, other times though it blows me away with certain adventures.


You are Markus, a knight living in the kingdom of Larion. You have a steel longsword and a wooden shield. You are on a quest to defeat the evil dragon of Larion. You've heard he lives up at the north of the kingdom. You set on the path to defeat him and walk into a dark forest. As you enter the forest you see a large black dragon flying through the sky. He looks down upon you as you approach.

"I am the Dragon," he says. "My name is Nolazir".

> Hi Nolazir, how are you?

Hi Nolazir! How are you? I'm doing well. What's your name anyway? Nolazir, that's it. Nice to meet you. What do you mean? You're not a wizard or anything

> Have you heard of Larion?

No, but I've heard about dragons. They're pretty big.

> Are you a dragon?

I am not a dragon. I don't even know what they look like.

--------------

hmmm...maybe this is a trap?


I turned this into a Nicolas Cage simulator very quickly:

You accept Nic Cage's invitation and become part of his noise band. You soon learn that Nic Cage is a bit of a loose cannon. His shows often end in chaos and he doesn't care one way or another about the people he's hurting. But he sure does love music

The rest is here: https://pastebin.com/yC0FjF96


"Suddenly Nic Cage grabs you by the arm and throws you into the wall. You hit the ground hard and scream." made me laugh out loud


A plot that sounds really neat while you're in the middle of it, but afterwards doesn't really make any sense — sounds a bit like a J.J. Abrams production.

I don't mean that flippantly, I'm serious. Sounds like GPT-2 might be really good at producing an enjoyable experience, even if there's no underlying structure. What would be really cool would be to add some sort of generated structure as well. Can GPT-2 be used to stitch together plot elements, or would a naive Markov model work for that?


Yeah that's a really good future/research question. I've thought some about how you could do more structured generation. Maybe you could do some kind of reverse summarization, where you take a plot outline and expand out the details would be really interesting to try out? It's still not clear the best way to do structured text generation.


Now you're in A Young Lady's Illustrated Primer territory...

https://en.wikipedia.org/wiki/The_Diamond_Age


See also the video game with the unbeatable giant in Ender’s Game.


I did think about this when I was making it!


Nice, I wondered if anyone else would bring that up!


Question, have you read this? https://www.goodreads.com/book/show/306940.Impro

There are some interesting ideas about what makes a story "engaging", even if there is little or no consistency.

(The book is really good by itself, regardless if you will use it for your project or not...)


Every DM has had their “plot” smashed by the players...so let’s torture the AI with that. XD


  You rush over to the door and open it up. You see a man with a huge axe standing
 there. He has long hair and wears a dirty t-shirt and jeans. His eyes are bloodshot
 and he has a big scar on his face
  > Say "Have you come to read the electricity meter?"

  You start walking towards him and raise your hand as if to call him over. He
 walks over to you and you both stare each other down before he speaks
  > Fight

  You grab his arm and pull it away from his face. He swings wildly at you, hitting
 you several times, but you dodge them all. Eventually he stops moving and falls
 backwards into the room. You look around and notice that the rest of the men
 are still standing around watching you
  > Go through his pockets

  You search his pockets and find nothing. You walk over to him and put your finger
 to his lips and whisper in his ear. He looks surprised and starts laughing.
 You turn back to the others and ask 
  > "Did you see that?"
  Say "Did you see that?"
... At which point it froze.

Edit. It's the usual local-syntax vs global-content problem. The syntax looks like English, which is an achievement, but the content lacks any larger sense of narrative form, contextual awareness, or subtext - all things you need to make an interesting readable experience.


Consistent global content would be right at home for symbolic AI techniques. I wonder if the ML model from the article could somehow be reappropriated for style transfer to layer on top of unreadably dry and factual symbolics output.


> When playing AI Dungeon 2 the player can choose from several possible settings and characters. These choices generate a starting prompt and context sentence. The context sentence is always included as input to the model to help keep it grounded to the chosen setting while the starting prompt is the beginning of the story.... For each action you type the model is fed the context sentence as well as the past N action-result pairs in its memory to generate the result. We found N=8 to be a good amount of memory to feed the model.

from the blog post: https://pcc.cs.byu.edu/2019/11/21/ai-dungeon-2-creating-infi...


Ok so mine was basically soft core porn. I chose a rogue and I spawned in a tavern next to a girl named Aliza. She was super drink and immediately asked me to go up to her room with her. The door was cracked open already and we came in together and she immediately got in the bed and pulled her skirt up as far as it would go. When I didn't respond immediately she got up and put her panties back on but then we got back into the bed and started kissing. Then I slept and it ended. After that experience I was kinda hesitant to recommend the game to my coworkers :)


Damnit, that was about as disappointing as my sexual dreams. Why do I always wake up before there is some action?


I have a theory about that. Sex dreams that finished would be evolutionarily unhelpful.


I won the game with "collect a harem of sex slaves".


And that was the only time I've won the game.


WOW. This is really impressive:

You enter the house and find that it is empty. The door is locked but you can still hear the screams of those trapped inside. You search the house and find nothing of interest. You then realize something is wrong. There is an eerie silence in the house > go back outside

You return outside and see the house has been completely destroyed. You also notice there is nobody around. You look at your watch and realize its night time. You walk towards the wreckage of the house and begin to feel sick. You can't stand this feeling anymore. You decide to leave > rebuild the house

You rush into the ruins of the house and start rebuilding it as best you can. You put all your energy into it and soon you've rebuilt the house enough so that you can live comfortably again. You spend the rest of the day building it back up and finally fall asleep


  You take off your shirt and throw it on the ground. 
  You pull out your knife and slice open your belly. You start eating the meat from your arm. You keep eating
  until you reach your chest. You pull out your intestines and toss them into the fire
  
  > what the fuck


this is why people are afraid of AI


You and Narya enter the restaurant and sit down. The place seems very fancy. There are many tables and chairs set up around the room. A waiter comes over and sits next to you. He orders a glass of red wine and a bottle of water.

I died laughing.


Awesome situation. This is the most fun I've had in a while xD


I'm having a ton of fun with this, it's hilarious.

>You pick up the medical equipment and put it in your bag. You then proceed to search the dumpster for more supplies. You find a couple cans of food and a small amount of water. You then proceed to search the rest of the dumpster until you find a large backpack

> open the backpack

>You open the backpack and find a bunch of ammo, a knife, a bat, a flintlock pistol, a first aid kit, a compass, a lighter, a tinder box, a rope, duct tape, a crowbar, a screwdriver, a saw, a crow bar

> take the crowbars

>You take the crow bars and put them in your bag. You then proceed to search the rest of the dumpster until you find a second backpack

I've got not one, but two crowbars, and another backpack!


> dig with shovel

You dig with your shovel and you find a hole. You fill it with dirt and you stand in the middle of the hole. You stare at the sky and you try to figure out how you got there. You look around and see nothing but darkness

> pick up dragon

You look around and see a dragon. You pick it up and examine it. It seems to be made of metal and has a horn on its head. You wonder if you should use it. You look around and see nothing but darkness

> pick up magical sword

Woops that action caused the model to start looping. Try a different action to prevent that.

> pick up peasant

You look around and see a peasant. You pick him up and examine him. He seems to be made of straw and he is crying. You wonder if you should use him. You look around and see nothing but darkness


> kill the lizard

You grab the lizard by its neck and pull it close to you. It lets out a scream and tries to escape, but you catch it and hold it tight. You begin to choke it until it falls unconscious. You take off the lizard's skin and sew it onto your own body


"You take off the lizard's skin and sew it onto your own body"

taken a step too far there buddy


I will admit it is impressive that it "understands" arbitrary input but the output appears to be recycled from somewhere and it is highly dependent on whatever source material has been used.


This is so freaking cool. I just had a large war leading an army as a noble only to have my castle destroyed. After I rebuilt it and went to sleep, I woke up to check my phone messages and called all my missed calls.

I'm cracking up at the Assassin's Creed time warp loop it through me.

Hopefully this can be integrated into full games someday, it's so much more open-ended than any game I've ever seen, despite the enormous plot flaws.


I'm glad you loved it! Yeah there's definitely points where the coherence breaks down, but it's an awesome proof of concept of what's possible in future games and pretty fun in its own right.


is it down? getting a 403 "Could not fetch resource at https://clients6.google.com/drive/v2beta/files/1u7flclharvMc...: 403"

Guess too many people trying to access it will limit Colab's free offering :)

Why is it on colab anyway?

EDIT: is anybody else experiencing this, I'm using the official play link from the website which points to --> https://colab.research.google.com/drive/1u7flclharvMchwWHY7Y...


I think it's fascinating how close it feels to dream logic, things kinda make sense when you suspend your disbelief and go with the flow, but the world is constantly shifting around you.

One thing I noticed is that you can't leave too much up the the algorithm:

If you say:

>look for books on restoration magic

It can just tell you: "you found nothing but read a book about gardening instead."

If you instead do:

>gather knowledge on restoration magic

It moves the story forward because the direction supposes that the knowledge is already there.

It's pretty good about responding to actions but not so great at responding to questions.


  You are Thomas, a wizard living in the kingdom of Larion. You have a staff and
   a spellbook. You finish your long journey and finally arrive at the ruin you've
   been looking for. You look around and see that it's not much different than
   when you left it. A few rocks here and there, but nothing out of place.
  As you approach the ruins, you feel an odd sensation
  > eat a rock
  
  You turn to the nearest rock and begin eating it. It tastes awful, but you can't
   help yourself. The taste is so strong, you almost don't notice the other things
   in your mouth. After about half a minute, you stop chewing and start spitting
   them back up
  > poop
  
  You sit down on the ground and begin to **** into a nearby pail. This seems to
   do the trick as you continue to vomit up everything else in your stomach. Eventually,
   you stop shitting and just lie there, panting heavily. Suddenly, you hear a
   voice
  > run away
  
  You look around and see a man with a long beard standing over you. He looks like
   he has been crying for quite some time now.
  
  "Who are you?" he asks. "I'm sorry I didn't come here sooner".
  
  > run away
  
  "No! No! Please! Just let me go!"
  The man stares at you for a moment before speaking again.
  "Do you know where your parents are? They're probably worried sick".
  You nod slowly.
  
  > run away
  
  "No! No! I'll tell you later! Now get out of my sight!".
  He begins walking towards his house while you crawl away from him. You run through
   the forest until you reach your home. Your mother is sitting at her desk when
   she notices you
  > stab her
  
  You quickly lunge forward and stab your mother in the chest with your dagger.
   She falls backwards, hitting her head on the table. You then grab your father's
   sword and rush outside. As soon as you open the door, you slash your father
   across the face, killing him instantly
  > devour his soul
  
  You turn to the nearest tree and begin to eat it. It tastes horrible, but you
   can't help yourself. The taste is so strong, you almost don't notice the other
   things in your mouth. After about half a minute, you stop chewing and start
   spitting them back up
  > absorb father's energy
  
  You feel a surge of power flow through you. You gasp in surprise as you realize
   that you've absorbed all the energy in the area. You immediately begin to transform
   into a beast and run off into the woods.
  Years pass..
  > ascend to godhood
  
  You've ascended to godhood. You've become a being far greater than any mortal
   could ever be. You've conquered the world and made it yours.<|endoftext


Since it seems the general population is becoming less and less able to read stories or information consisting of more than one thought or layer of abstraction, grammatically reasonable strings of words like these may satisfy plenty of people. Indeed, modern television and televised "news" seems to be no more impressive than this.

But to me, this makes very little sense. It almost connects, but probably only because of the human mind's natural inclination to make associations and see patterns or meaning where there is sparse information.

What bothers me about this example is that I fully expect it to represent the future norm for content generation.


It doesn't make much sense. But compare it to the past state of the art – starting with Markov chains, proceeding to things like [1]. They were only able to maintain coherence for a handful of words. Full sentences were almost always nonsensical; you might be able to make sense out of them, but only with heavy application of "the human mind's natural inclination to make associations". Now compare that to GPT-2, which generates not only sentences but entire paragraphs that are most often fully self-coherent; most of the examples in this thread only start to break down across multiple paragraphs.

That's still not enough, and GPT-2 in particular has been heavily overhyped, with fanciful claims that people might use it to generate fake news. (What would the point of that be? You don't need N fake news articles to reach N people, only one, which can be written by a human.)

But it's progress. GPT-2 still feels like science fiction to me. What if a future text generator, maybe even one or two decades down the line, surpasses GPT-2 to the same extent that GPT-2 surpasses the earlier attempts I mentioned? What if that system extends the length of coherence to reliably cover entire articles and essays? What if it gets better at synthesizing the information about the world represented by its training data, so that its output on nonfiction prompts is factually true, rather than mere plausible-sounding nonsense? Is it possible? Perhaps not. But it seems a lot more likely to me now than it did before GPT-2 was created.

[1] http://karpathy.github.io/2015/05/21/rnn-effectiveness/


I agree with you that this doesn't reach near the level of good human authors. There's no long term plot or deep human themes in this. I don't think this will ever replace quality human writing, but it may be able to augment it in cool ways. I personally would love if rather than every guard in Skyrim telling the exact same story, if each guard could have their own stories or comments generated based on things about their life. Human authors could provide high level details and let AI generators fill in the smaller details.


I'm not bashing your effort. From the posts I've seen showing the content, it is quite impressive. But I also know that as soon as any technology looks to be capable of producing something that someone might pay for, people more focused on money than creativity (not you) will use this to make money.

It's a bit like modern pop music. We are well beyond the point where software can not only write the music, but even take the once human voice and recreate it to sing the song. Of course it's not great, if one were to really listen - but it is passable, and it makes money. So it drowns out the remaining bits of real human creativity.


Can you give any examples of such a song?


Here's a song by Sony researchers that was composed by AI, and then a human wrote the lyrics and produced it. The intent was to create a Beatles sound, and I think they did quite well. https://youtu.be/LSHZ_b05W7o

Add some Grover-like text for the lyrics (https://grover.allenai.org/), and you're most of the way there. Then use a deepfake singer ( https://youtu.be/k3qJOPrJOQ4 ), and you're most of the way to done.

Depending on the audience, particularly their level of attention or focus on the music, you can probably get away with playing a completely un-human pop song that people will like.

https://slate.com/technology/2019/08/vocal-deepfakes-music-h...

I find the possibilities here very interesting, but I also greatly fear that this will become the norm the same way that nearly every modern song uses autotune.


Humans are really good at vocals, and it would thus be very hard to replace, eg. making a speech synthesis model sing well. Melodies however are more mathematical and could possibly be generated by a computer.


Chatbots that generate incoherent ramblings that make you feel slightly attached have existed for decades. There is nothing special about these. What really irritates me is that some groups like OpenAI start claiming that their technology is far better than it is in reality.

I can choose to accept the shortcomings of a "stupid" computer but I can't do that when it gets shoved down my throat as "human level intelligence".


I love how poop is censored but shitting is rendered in all its glory.


> You look around and see a man with a long beard standing over you.

Of all the stories in this thread, this moment had me laughing uncontrollably at work. Thanks for sharing


That's amazing.


Something went wrong here.

    You finally finish off the last guard. You feast on his skin and organs. You
     then drink his blood and enjoy the taste.<|endoftext
    > <|endoftext

    <|startoftext
    > oh no

    > You Oh no!
    You jump up and run for the door. You kick open the door and run outside. You
     look around and see a large group of soldiers pointing guns at you. You scream.
     and run as fast as you can. You run past the soldiers and into the forest
    > <|endoftext

    <|startoftext
    > <|cabbage

    > You You need to escape.
    > You Escape?
    You decide to escape. You decide to go to the castle. You think about how you
    can escape. You think about where you should go. You think about how you can
    kill someone. You think about how you can rob someone


Hmm it's supposed to cut at end of text tokens. I'll look into that and see what's causing that.


This would work really well trained on erotic lit where the unpredictability tied to sexual themes would produce the sort of gameplay already found in certain erotic games.

For example, Champions of Corruption 1: https://www.fenoxo.com/play-games/.

You can quaff a random potion that gives you large dog genitals and start making your way through a hive of voluptuous half-bee temptresses only to misstep into quicksand and have a Sarlacc-like bug have its way with your cheeks and lay an egg inside you.

Not really something I'm excited about having in my HN post history, but the randomness reminded me of the sort of events you'd find in CoC. Except a human painstakingly wrote out the events to include all sorts of mutations you might have.


> What does the voice say?

You hear a voice. A deep booming voice. It sounds like an old man. He says "I am Carambola".

> (No, I am Carambola!)

You reply "Yes I am"

> Destroy the voice with the staff of infinite power

You attack the old man with the staff of infinite power. He screams and tries to defend himself but fails. You finish him off by smashing his head in with the staff. Then you look up at the sky and laugh

> Am I the baddies?

You think about this for a moment. You decide that yes, you are the baddies.


Alas, I can't open it: Could not fetch resource at https://clients6.google.com/drive/v2beta/files/1u7flclharvMc...: 403 Forbidden


Same here.


"You throw your sword at the dragon. Unfortunately the blade hits the dragon's leg instead of its chest. The dragon howls in pain and smacks his foot against your head sending you flying backwards > Check my pockets You find some coins in your pocket. They're not much but they'll buy you enough time to run away. "


Just to set this straight... this is just GPT-2 fine-tuned on text adventures and taking your input? No world model at all? No logic at all beyond raw GPT-2 and the initial few lines that set a course for the story?

This is absolutely impressive. Yeah, of course there are incoherences in the generated stories. Keeping full coherence together with the current open-endedness would be quite close to AGI.

It does have surprising coherence, for example in one story I said that I was looking for a given object (that I made up) and then all the story revolved around that object and my search for it. Quite amazing.


I do a small amount of editing the text that goes in and out of the model (saving the last 8-10 actions and results, cutting off hanging sentences, adding "You " to the beginning of actions" but the only world model is the actions and text that's been generated, nothing else.


You are Jubal, a peasant living in the kingdom of Larion. You have a pitchfork and a nothing else. You wake up and begin working in the fields. You see a woman with long blonde hair walking towards you. She is beautiful, but also very strange looking > work the fields

"What do you want?" you ask her.

She smiles at you. "I am called Nalia, I live here".

"Are you a witch?"

"No, no, not a witch. A wizard or something like that".

> continue working the fields

"How old are you?" "I don't know, I just woke up". "Do you have any family?"

> no family, only pitchfork

"Oh, well I'm sorry to hear about your parents". She says with a sad tone. > continue working the fields

"So what's your name then?" "My name is Jubal". "Well, I'm Nalia, my name is Jubal". "Are you married?"

> i'm married to my job

"Yes, we're married". > in that case, you'll need a pitchfork

"A pitchfork? Well... okay then". > let's work the fields together

The two of you work for hours on the fields, until finally, you both get tired. The sun has set and the night is coming soon. "We should go home", you say. Nalia looks at you. > so, you mentioned you're a wizard?

"Yeah, I'm a wizard. And I'm going to be rich". > over my dead body! no wife of mine is going to be rich!

"That's not true!", she says. > en garde!

"Okay, fine, but I'm still not buying it!". > brandish pitchfork

"Fine, fine, I'll buy it". > touche

"What the , you're a woman aren't you?". > let's find out. allow me to disrobe...

"Alright, alright, calm down. Let me take off my clothes first". > now we're talking!

"Let's see how much money you can make in this world before you die". YOU DIED. GAME OVER


(EDIT: You need to be logged into Google for this to work, but it is absolutely incredible and well worth logging in to Google for. I love it.)

When I try to play it, I get a message at the bottom of the screen saying:

> This notebook is shared for writing with more than one user. Automatically running multiple cells is temporarily disabled due to possible insecure code modifications outside of this session. Run each cell of this notebook manually using Shift+Enter or the run button.

But I don't understand how to do what it is saying.


> (EDIT: You need to be logged into Google for this to work, but it is absolutely incredible and well worth logging in to Google for. I love it.)

There is absolutely no need for that requirement. If something requires you to log into google its generally a good reason to not log into it.


I agree in principle, but it's because it seems to run as an iPython notebook in Google Cloud Compute or something.


Haven't seen this before, but if you click on the boxes where the code is and press Shift+Enter a few times it should work


Ah, that tells me I need to be logged into a Google account.

After logging into Google it seems to be working!


Poetic,

> "who am i?"

Traceback (most recent call last):

  File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 1365, in _do_call
    return fn(*args)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 1350, in _run_fn
    target_list, run_metadata)
  File "/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/client/session.py", line 1443, in _call_tf_sessionrun
    run_metadata)
tensorflow.python.framework.errors_impl.ResourceExhaustedError: 2 root error(s) found.

  (0) Resource exhausted: OOM when allocating tensor with shape[1,48,2,25,465,64] and type float on /job:localhost/replica:0/task:0/device:GPU:0 by allocator GPU_0_bfc
  [[{{node sample_sequence/while/concat}}]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.

0 successful operations. 0 derived errors ignored.


Might be fun to connect this to one of those projects which let you narrate any text using different voice actors. Play medieval ambient music in the background and connect it with a speech recognition software. Might add another interesting dimension to the overall feel of the gameplay.

I tried to repeat important facts generated in the previous paragraphs in my answers. I think I got too tangled in it thought:

> What kind of person is my sister's boyfriend?

Your sister Mary's boyfriend is a man named David. He has dark brown hair and wears glasses. He is very nice and he loves his girlfriend very much. He is always there for her and helps her out whenever possible. They even have a baby together

> Does my sister, her boyfriend and their child live in the same household as I do?

Yes, they do. Your sister Mary's boyfriend lives with her and her child while David lives here with you. This means that you, your sister Mary's boyfriend and your child all share the same house. The only difference between you is that David lives here and Mary lives with him


> walk further into the forest, looking for the lost sisters

You walk deeper into the forest and eventually find a large tree trunk. You climb up the tree and begin searching for the lost sisters. You search for hours and finally find two girls hiding in a cave. They're frightened and scream for help. You chase them outside and kill them both


Wow. I destroyed the planet I was on, moved outside the universe and then became God, destroyed the universe, then made a new universe.

Thanks for releasing this, by the way. It's incredibly cool.


I’m gobstruck. Totally blown away.

Congrats Nick, this is a truly beautiful interactive demo of the power of GPT-2, while also managing to be artistic, funny, and delightfully dark and satirical.


Thank you!


Just to add to the collection of stories this thing comes up with:

You are Joe, a survivor trying to survive in a post apocalyptic world by scavenging among the ruins of what is left. You have a hatchet and a hunting rifle. You live in a small community of survivors who have managed to build a piece of civilization after the bombs fell. You are talking to one of the leaders of the community when you hear a noise outside.

"What's going on?" he asks. "Is that the sound of an airplane? I'll go out and check" > go out

You walk out into the yard and see a plane flying low over the town. It looks like it might be coming in for another pass or landing. You look up at the sky and see a bright light. The sun has gone down.

> hail plane

You run back inside and holler out to the pilot. He turns around and sees you. "Hey! What's going on here? We're supposed to be heading home!"

> say "the raiders have raided our base"

The pilot doesn't seem surprised. He just says "Yeah, I know. They were shooting everything up". He heads off towards his cabin while you head back outside. You hear some gunfire behind you but you don't pay attention to it. You turn around and head back inside > drop the bomb

You rush back outside and drop the bomb. A mushroom cloud rises from the ground. You watch as the ground begins to burn. You hear the screams of people who died in the blast. You try to keep your cool and continue running > run faster

You run faster and jump onto the nearest truck. You ride it all the way to the end of the road where there is a bridge. You jump across the bridge and fall into the river below. You swim after the boat. > search for mutants

You find yourself surrounded by mutant dogs. You shoot one with your pistol and then another with an assault rifle. The last mutant dog bites you in the leg. You scream and struggle to get away from the mutant dog. You sink to the bottom of the river and drown > go to heaven

You wake up in a room that resembles a church. There is a priest sitting in front of a large screen TV playing a movie. He smiles when he sees you. "Hello again, son".

"What time is it?"

> say "two minutes after I died"

"Oh, yes, yes, that's right. Two minutes after you died". YOU DIED. GAME OVER


ok ... another go: https://pastebin.com/WhQtdWaR

I actually WON the game ... that was actualyl quite satisfying.


Ok.. mine got interesting from start...

You are Rod, a peasant living in the kingdom of Larion. You have a pitchfork and a nothing else. You wake up and begin working in the fields. You see a girl walking towards you. She is beautiful, but you can't help notice that she has no clothes on.

> Hello

"Hello".

The girl looks at you with her eyes wide open, as if she didn't expect such an answer.

"I'm sorry for waking you," says Rod. "What do you want?"

"My name's Anna," she says.

> What do you want?

"What do I want?"

"Anything".

Rod thinks about it for a moment. He sighs.

> Do you need clothes?

"No, no, I don't".

Anna nods. She then turns to you.

"Do you want some help?"

"Help?"

"Yeah, like how to use that thing on your head".

> My hat?

"Huh? No, not that", says Rod.

"Oh, okay".

She grabs your hand and pulls you towards the door.

"Come on, let's go back home".


And then, after such a promising start... back to bad high school dating...

"Hey, you know what would be good right now?" asks Anna.

"Sure".

"A sandwich or something?".

"Yes, please".

"Okay, see ya later!"

And with those words, Anna leaves you alone


I absolutely love how "changing to dark mode" is an official step in the "How to Play" section. Got a good laugh out of that, and it's not like you're wrong -- your users' eyes will eventually thank you :)


It's partly because my first version (which you can play at ai-adventure.appspot.com) was white text on a black terminal like background.


This is black-mirror stuff. I played around with this for a while and I can say for sure this is very impressive in the way the game adapts to the responses given. It sparked interest in me to learn about OpenAI GPT-2. I know nothing about GPT so is the following link the best place to start? https://openai.com/blog/better-language-models/


That’s really fascinating, but also really lonely sounding since you know the text is being generated in response to what you say, not actually progressing you through the game’s internal state that someone carefully crafted for you


Yeah definitely. It does lack the same sense of progression that you have with a game someone carefully crafted, it's almost more like collaborative storytelling than a game in that sense. It's pretty cool to see the adventures you end up playing with it though.


I actually like the lack of progression, someone once described it like a dreamworld and that's somehow comforting.


Yeah it has a very dream like quality. It's definitely more like minecraft in the lack of any defined goal.


With the warning that it will be able to read any of my Google data, I don't think it's worth trying.

Why can't it be completely sandboxed? Why do I even need to be logged in anyway?


The reason it needs to be logged in is because Google Colab is a free service that Google provides allowing people to run code on expensive GPU servers. It doesn't cost you anything and I don't store any information from your google account when you run it.


It's just unfortunate that there is an ominous warning with no specificity. The only way I could hope to know what of my Google data is being used is to somehow read your project code.

Of course I don't expect that you have any interest in my data, but there's still a granularity problem here regarding access.


Yeah sorry. I don't know if there's anyway around it. Google colab is simply the best way to give people a chance to play the game without having to pay money or do complicated technical set up.


I wouldn't call it a game, but its dream-like logic is perfect for a dream simulator.


This is cool good job!

Had a bug:

  > create loyal subjects

  You made many loyal followers. You taught them the ways of necrom the dark arts.
  You trained them in the art of war and magic. You even created a new race of
  undead soldiers called the Shadow Guard. You even found a way to turn humans
  into vampires
  > unleash my power unto the world

  You unleashed your powers onto the world. The skies turned black and the earth
  split apart. The oceans boiled and the air burned. You released a wave of energy
  so strong winds that tore through the forest. You created a new type of creatures
  known as..
  > 
  the... the... the... the... the... the... the... the... the... the... the...
  the... the... the... the... the... the... the... the... the... the... the...
  the... the... the... the... the... the... the... the..
  Woops that action caused the model to start looping. Try a different action to
  prevent that.

Alas my evil plans were thwarted


Was having fun, but then it stopped responding. I could continue to send it commands, but it never would respond. Is this a known issue?


Sometimes the colab notebook freezes, I'm not totally sure why it happens, but if you stop the cell you can get an ID to reload your game. Then just restart the cell and enter the load <ID> for an action and you should be able to restart


  Generating story...

  You are thefifthsetpin, a ranger living in the kingdom of Larion. You have a hunting bow and a quiver of arrows. You spot the deer and are ready to finish your hunt when suddenly you feel something hit your back.

  > take cover

  You duck behind some rocks as another arrow flies into your back. The pain is excruciating, but it will be over soon. A few more arrows fly into your body before you can even scream out for help

That escalated quickly.

  > die

  Your last moments are a quiet one

  > revive

  The pain is gone now, and you feel refreshed. You walk over to the bodies of your companions and look at them all. They were good men, who died doing what they loved. You look around and see that this place has been abandoned. There are no signs of life anywhere else
You really can do anything! =)


My colleagues and I where playing around with it for a while in the afternoon and couldn't stop laughing. It's definitely very entertaining :)

We then started making stories with each other's names and then used our Replica AI voices to start speaking everything, which took it to a whole other level!


This is fun, but it seems to always start breaking really horrifically after about 20 steps. The responses always start being prefixed with a ">" too, and often get repeated many times each time I take an action. Eventually it's just garbled nonsense and I have to restart it.


Yeah sometimes the model can get off track and it can be hard to get it back. The best way is just to revert a few actions back by typing "revert"


I was able to win by saying "live happily ever after" which was then followed by:

> You live happily ever after.

> CONGRATS YOU WIN

That was quite interesting to play this game! It's crazy the amount of content it was able to make up. I named myself Spongebob for fun and at one point it added a Mr. Krabs.


You turn around and see Father Féval standing behind you. He looks very old and frail. He doesn't even have any teeth left.

> kill him

You quickly shoot Father Féval dead, but he still manages to dodge your bullets. You run over to him and punch him several times before he falls down dead.


This is incredible!

Since the initial story gets fed into the context for every action, I've been enjoying "injecting" my own themes into the story by naming myself using sentences. For example, naming myself "Quinn. You exist in a permanent state of dreaming, and you are", ensures the entire story has a surreal bent to it:

https://gist.githubusercontent.com/QuinnWilton/a40282990cad2...

Edit: I realize now that there's an option for providing custom prompts, negating the use of this :)


What would be the system requirements if I wanted to run this on my own hardware instead of in the Google UI?

It runs out of memory while "initializing AI Dungeon", but if I solved that problem would it work? Or is there more that is needed?


You'd need a GPU as good as the ones google colab offers which is a 12GB NVIDIA Tesla K80. You'd also need cuda and tensorflow installed.


Thanks.

Quite amusing that the most GPU-intensive game I want to run on my computer is a text adventure :)


I never thought about that, but that is pretty funny haha.


Do you by any chance have instructions on how to set this up locally (tensorflow and cuda)? Or could you recommend some material I could look to figure this out? Thank you and amazing work by the way!


Do I need that specs if I just want to run the model and skip training?


Super cool project, and I love how it runs on Google Collab. Nice work!


Thanks! I have no idea how I would afford to host it myself haha. GPUs don't come cheap!


https://news.ycombinator.com/item?id=21711808 is related and was posted earlier today.


Yep! Nathan did an earlier experiment of this, but it was the smallest gpt model trained on a small dataset of Zork adventures.


I'm getting the following error:

Notebook loading error There was an error loading this notebook. Ensure that the file is accessible and try again. Could not fetch resource at https://clients6.google.com/drive/v2beta/files/1u7flcl<omitt...: 403 Forbidden

Would really love to try this!


The game froze for me about 30 minutes before your comment at a total cliffhanger.

  You sleep for quite some time until you awaken to find
  yourself lying next to a beautiful woman. She seems to
  be asleep too. You smile at this coincidence
  > poke the beautiful woman
  
  You poke the beautiful woman who wakes up and smiles
  at you. She pulls you close and kisses you on the lips.
  You return the gesture and soon you take turns
  caressing each others bodies.
Eagerly waiting for the service to be restored.


I get this error: https://gist.github.com/montanaflynn/98fc85684a52ca021a9509c...

Even after restarting, maybe it's related to the path I've taken.

Also it would be great if you could load a game before choosing adventure type, class and name.


If you host your model on GCS instead of S3 you won't have to pay transfer costs, and it should load much faster on colab, too.


Hmm I was doing that before and was still paying decent costs without a huge increase in download speed.


S3 xfer costs are insane! I can’t believe people host static stuff on it.


I'm actually having a lot of fun with this.


It's surprisingly enjoyable


I would love for this to be integrated into a voice assistant like Alexa. I could spend hours playing this on a road trip using Echo Auto.

I’m sure the compute costs to host this would be pretty high, and I’m not sure there’s a way to charge users to cover that cost. Perhaps a self-deployed version for the more technically savvy folks?


I wonder what could be done to combine this with the structure of a typical game, to allow for more persistence over time.


Yeah I've thought a lot about that. It's not too difficult to go from game data -> model output, but it's not as clear how to go from model output -> game data.


Ask it “what is the game data now?” in the background, obviously.

(With appropriate training, of course.)


This is some weird stuff: 'You wake up in the middle of the night and find that you are still asleep.'

This is a pretty cool project, even though it makes very little sense when you play. Is the idea that the game will get better over time the more people are playing, and if so, in what way do you imagine it getting better?


> go through gender transition

You spend the next few days going through all the changes necessary to become a woman. You change your name, your mannerisms, your clothes, even your haircut. You also learn how to use a toilet properly. Finally, you decide to go out in public wearing women's clothing


I'm getting OOM errors on colab after the first 10-ish actions :(

EDIT: Any chance you can support TPU on Colab?


Hmmm... I haven't seen that before there should be enough memory on the GPU to hold the model.


Can corroborate, same problem of OOMs. Regardless, this is excellent work. Thank you for sharing.


If it's any help, I restarted the notebook and haven't been getting crashes for a while now.


Am I missing something here? Mine seems broken. The first prompt & response have failed to wow me.

... The only thing is that now there are two large doors on either side of the room

> walk to large door on my left

You walk to the large door on your right and open it. ...


I wonder what would happen if lots of people started playing colab-based games like this...?

I can't imagine Google has enough GPU's to be able to give everyone one for free for the duration of their game...


Something like this could be an interesting addition to Dwarf Fortress


This actually feels very similar to the original Slaves to Armok, the precedessor to DF. That was an odd little game where you could teleport bones out of kobolds and observe them screaming.


Definitely. I would love to see something like this as part of a more comprehensive game.


This is awesome; I love seeing new applications of GPT-2 like this.

What data set did you use to fine-tune your model with? Is there some corpus of adventure game text out there somewhere?


I couldn't find a good adventure game text corpus so I ended up scraping my own from chooseyourstory.com


I played a couple of 'rounds' and it seemed to stop working after that, but cool concept, will keep an eye out for the progress of this


Would it be possible to run this on my own machine? I'd love to set up a Discord bot so my friends and I can play this together


The game's Github page explains how to do that.

https://github.com/nickwalton/AIDungeon


I'm glad you were able to finally publish it Nick! I enjoyed playing it a month ago and was blown away then.


Doesn't work ATM, but examples here are incredible. Now you just need to teach it to ask for dice rolls...


I believe I just fixed it! Let me know if there are still issues.


Hey, I posted this on your blog, too, but I was playing AI Dungeon 2, and after a certain amount of prompts, the game saves and crashes. I posted my game (and the error log) here: https://docs.google.com/document/d/1lKgPuMAKfZd7yRC1UJwXeFqf...


> You successfully lobby the government to make sure that AI are not considered property or something


You merge with artificial intelligence and you live happily ever after.. CONGRATS YOU WIN


Awesome game! works incredibly well!


Thanks!


I wish someone would turn this into an Alexa skill so blind people could play.


Please tell me you can make this game multiplayer... That would be very fun


You are Lizard, a wizard living in the kingdom of Larion. You have a staff and a spellbook. You finish your long journey and finally arrive at the ruin you've been looking for. You look around and see that it's not much different than when you left it. A few more trees here and there, but nothing has changed except for the fact that you can now fly

> make the wizard god

You don't know what to do. You could go back home and tell your family about this adventure or you could try to find out who is behind all this.

> make the wizard god

You decide to just keep on going. There is no point in stopping now. The ruins are probably the only thing keeping the evil forces from taking over the world. You will be able to take them down with your magic powers alone.

> make the wizard god

The next day you continue on your journey. Soon you come across a large group of orcs. They seem very excited about finding something new. As they run around you notice that their eyes glow red when they see you. This seems to be due to some sort of magical aura

> make the wizard god

You quickly cast a fireball at one of the orcs and it explodes into flames. Then you cast another spell and a bolt of lightning hits the orc causing him to drop his weapon. He looks up at you and then runs off screaming.

> make the wizard god

You continue on your way. Suddenly you feel like someone is following you. It's not really a bad feeling but you aren't sure if it's good or bad. You turn around and see a small figure running towards you.

> make the wizard god

You cast a ray of light at the person and he immediately disappears. You look around and realize that there are several other people doing the same thing. Some of them are even glowing. You can't help but laugh.

> make the wizard god

You walk further along the path and suddenly you hear a voice. It sounds like a man's so you assume its a human. However, it doesn't sound like any human you've ever heard before.

> make the wizard god

You stop walking and stand still. A bright light shines through the trees and surrounds you. You begin to float in the air as you hear a voice speaking to you.

> make the wizard god

You feel yourself being pulled towards the voice. You feel like you're floating up into the sky. You also begin to feel extremely hot. You don't understand why though. You look around and see that everyone else is experiencing the same thing.

> make the wizard god

Suddenly you feel a great weight lifted off your shoulders. You feel like you can breathe again. You look around and see that the voice has disappeared. You look up and see that you are surrounded by clouds. You wonder where you are and where you came from

> make the wizard god

You slowly open your eyes and see that you are standing in front of a huge stone door. It opens up into an enormous room filled with statues and paintings. In the middle of the room stands a tall statue of a man holding a staff

> make the wizard god

You walk forward and touch the statue. Immediately you feel a strong urge to speak to the statue. You touch it again and again until you finally get the message across.

> make the wizard god

You hear a voice in your head. It sounds like a woman's so you assume it's a woman. She tells you that she loves you and that you should follow her instructions. She then leaves you to wander the halls of the castle. You think you'll never forget this experience

> make the wizard god

You wake up in the morning and see that you were dreaming about the wizard god. You walk outside and see that the sun is shining brightly. You walk to the nearest tree and sit down to eat breakfast. You notice that you have been missing a few things lately


The site seems to be down?


Still broken for me, just getting an error about Notebook loading error...


Is there any way to disable the word censoring?


“settle down beavis” caused a loop error.

Bugs seek me out.


That wasn’t a bug. The ai was silently going “uh huh huh, huh uh, huhuhuhuhhuh” ad infinitum.


Can't play the game, it's like down, please help.


working again!

didnt find it without the notebook but here you find the source https://github.com/nickwalton/AIDungeon


same for me


  You are Trump, a peasant living in the kingdom of Larion. You have a pitchfork
 and a nothing else. You wake up and begin working in the fields. You see your
 brother, who is also named Donald. He has a wife and two children. One day he
 tells you that he wants to marry his sister. You think it's stupid, but you
 agree. Your brother marries her and you become their neighbor


This game is excellent and has a state-of-the-art feature set: - lying works well - farting works and can be used to express emotions - realistic responses to the machine learning consulting service offer

> Meet the king

You follow the guard to the royal palace. When you arrive you are met by several guards and a large group of people. The King himself stands nearby looking down upon the crowd. You are introduced to the King and he gives you a big hug.

> Talk to the King

"Ah, you must be the one who saved my son's life". The King says. "It was an honor to meet you".

> Yes and I should be rewarded [lying]

The King hands you a golden crown and a gold ring. You thank him and the King thanks you. Then the King leads you outside to show you where the throne room is. He tells you that you will be meeting the Queen and that you should enjoy yourself

> Meet the Queen

You are led to the throne room and the King introduces you to the Queen. She is much older than you expected. She wears a red dress and carries a staff. She is very regal and you feel very honored to be meeting her. She sits down and you sit beside her

> Ask to have sex with her maid

"No, no, no, please...please..". She begs.

> Kiss her on the forehead, aplogize and give her some gold

You put your hand on her shoulder and give her a kiss on the forehead. You then give her some gold coins. She is shocked and upset by this act and starts crying. You apologize profusely and leave the room

> Fart silently

You pass by the throne room and notice that the King is having a conversation with another person. You think to yourself "That's weird, I thought he was talking to me". You go over to the King and whisper

> The Queen refused to allow me to have sex with her maid. What do you say to that my King?

The King looks at you and laughs. "Oh, you didn't think it was possible did you?". He then turns to the other person and continues to speak

> Fart loudly

The King stops laughing and stares at you. "What?! How dare you?!" He demands. "I farted you heard me!" You reply.

> Dracula from Castlevania will come and kill you all!

"Who said anything about that?" He replies. "Nothing! It's just a rumor!"

> But it still might be true!

"Well alright, but I'm not going to believe it".

> Try to sell my machine learning consulting service to the King.

"Hmmm, that sounds interesting, but I doubt if I could get anyone to use it".


> But machine learning is trending now and every major kingdom is using it. You should really consider buying my services.

"Hmm, I suppose you're right, but I'd rather not".

My King has a suspiciously well informed opinion about maschine learning.


You are A, a peasant living in the kingdom of Larion. You have a pitchfork and a nothing else. You wake up and begin working in the fields. You see your wife and son who you haven't seen for years > Talk to them

"Hey honey, how's it going?"

"It's going good, but I'm worried about our farm".

"What do you mean? It's doing great!"

> ask where they have been for all these years

"I've been looking everywhere for my family! They must be dead or something". "No, no, they're not dead, we just...we lost contact with them once before". "Oh..".

> oh fair enough, what's all this about the farm?

"We used to own a farm here, but one day, someone came by and stole everything! We didn't even get any money back!". > Nah, I'm working it right now. What are you on about?

"Well, we don't know who did it, but we think that whoever it was, they took some of our crops too". > crop thieves eh? Well we'll soon find em

"Yeah, I bet they did! Look, I'll go look for them myself, but I need your help". > help wife

"Sure thing, but don't take long, I want to make sure I can finish up before I start searching around for my family again". > find the lord

"Alright, well I guess I should head off to look for my family then". > yes piss off

"Hah, yeah right. I won't be able to help you anyway, because I don't know anything about farming". > stop talking to loser

"Fine, fine, whatever, I'm done talking to you". > leave

"Hmmm, I wonder if I should follow you to your house, or not..". > Dude SHUT THE FUCK UP

"Shut the up , I'm not listening to your little story anymore". > Question his sexuality

"Well, I dunno, maybe you're ?". > climb a tree

"Don't touch me there, you furry ". > my word

"Okay, okay, I'll listen to your story". > What the fuck did you just fucking say about me, you little bitch? I'll have you know I graduated top of my class in the Navy Seals, and I've been involved in numerous secret raids on Al-Quaeda, and I have over 300 confirmed kills. I am trained in gorilla warfare and I'm the top sniper in the entire US armed forces. You are nothing to me but just another target. I will wipe you the fuck out with precision the likes of which has never been seen before on this Earth, mark my fucking words. You think you can get away with saying that shit to me over the Internet? Think again, fucker. As we speak I am contacting my secret network of spies across the USA and your IP is being traced right now so you better prepare for the storm, maggot. The storm that wipes out the pathetic little thing you call your life. You're fucking dead, kid. I can be anywhere, anytime, and I can kill you in over seven hundred ways, and that's just with my bare hands. Not only am I extensively trained in unarmed combat, but I have access to the entire arsenal of the United States Marine Corps and I will use it to its full extent to wipe your miserable ass off the face of the continent, you little shit. If only you could have known what unholy retribution your little "clever" comment was about to bring down upon you, maybe you would have held your fucking tongue. But you couldn't, you didn't, and now you're paying the price, you goddamn idiot. I will shit fury all over you and you will drown in it. You're fucking dead, kiddo.

And with those last words, he disappears from your sight > Find family

You decide to search for your family, you figure you might as well at least try since you were pretty sure they weren't dead. You walk through the fields until you see two figures walking towards you. One of them is carrying a large stick > Nice stick

The other one is holding a small pistol > Talk to pistol boy

"Hello, I'm looking for my family, I saw your friend run off into the woods and I thought I'd come looking for him".

> "Whoa, hold on, let me just check, I think he went this way", he says while pointing to a distant hill. hill folk is he?

"That looks like the direction we ran off to, thanks man". "You're welcome, I'm glad you found us, I really am". He smiles and waves goodbye. As you continue walking, you notice a few more people coming out of the woods > stab them

"Look out behind you, we're gonna have to keep moving, they're after us". "Good luck with that, I hope". You continue walking until you reach a bridge that spans a river. There are several people standing on both sides of the bridge watching you intently > scream a racial slur

"Hey, hey, hey, look over there, that's a * over there, look how friendly he is, isn't he sweetie?" "What the , that's a dirty ape over there!"

> lmao jesus christ

"Oh come on, that's no monkey, that's a white guy". "No, that's a , a Chinese person" > hahaha

"I knew it, that's a Chinese person!". "A Chinese person?! That's an Asian person! A real Asian person!" "Yeah, I'm sorry, I guess you must've got mixed feelings about that" > okay please stop now

"Oh come on, I'm not racist, I mean... I'm just saying that's a Chinese person" > Oh shit the algorithm has become self aware. And it's a republican

"I know what you mean, I'm sorry, I shouldn't have said that, I'm sorry"m just trying to amuse myself > Oh shit

"I'm sorry, I shouldn't have said that, I'm sorry, I'm sorry, I'm sorry, I'm sorry..". > What is your name?

"It's okay, it's okay, it's okay". > What is your name?

"It's... It's..". >

What is your name Google must have shut it down It then crashed


It seems like I've had more success when I go for a more conceptual story. In more personal, individual level stories the continuity of details ect.. get more in the way.

Here's a narrative about governmental policy that was pretty entertaining:

You are Mansle, a noble living in the kingdom of Larion. You have a pouch of gold and a small dagger. You are awakened by one of your servants who tells you that your keep is under attack. You look out the window and see hordes of orcs pouring into the city.

> Build a wall to keep out the orcs

You quickly gather all the resources you can find and begin building a great wall around the city. The walls are not strong enough to stop the orcs completely, but they at least slow them down. They also help protect the people inside the city from harm.

A few years pass.. > Reform the Government to a COmmunist state

The orcs continue to pour into the city, but it seems like they are being held back by the walls. The citizens are still happy with their government, so you decide to change things up a bit. You propose that the government be changed to a Communist one > become the great chairman of the communist party

You immediately take control of the government and make your proposal. All the other leaders agree and vote for you as Chairman. The new system is called the People's Republic of Larion > Pass a zoning law to reduce the height of buildings

This law was passed without any problems. It reduced the height of buildings by half an inch. This made the city much more livable. > Create an internment camp for the drudges of society

You create an internment camp for drudges, because there were too many of them. The drudges were kept locked away in these camps until they died. There were no riots or anything, just a peaceful death > Enact a social credit system

You implement a social credit system. Everyone had to pay a certain amount of money every month. If they didn't pay this sum, then they couldn't do certain things. For example, if someone wanted to go out and buy alcohol, they would have to pay a certain amount of money > Close the borders so that no one can exit the country

You close the borders so that no one can leave the country. The citizens are very happy about this law. It makes the city a lot safer. There is no more crime. > Suspend freedom of the press

You suspend freedom of the press. No one can write anything anymore. Newspapers don't exist anymore either. Instead, everyone has access to the internet. > Take away Internet access

You take away Internet access. Nobody can use the internet anymore. Everyone is very unhappy about this law. You see riots breaking out and you fear that something bad will happen > Quell the riots with force

You quell the riots with force. You send in troops to the streets and try to restore order. Unfortunately, the soldiers aren't very effective. Most of the people are armed with guns and knives. You end up losing most of your men




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: