Wednesday, June 24, 2020

My experience with AI text generation based on my work

I found an implementation of GPT-2, a text generating AI, that was on the web and would allow me to enter my own work as training data. So, I checked it out. The cost was less than ten dollars to build the machine and then eight cents per thousand characters after the first ten thousand. I was curious about what it would create. I fed it all fourteen of my books in a gigantic text file and left it to train. 

This is what I got out of the machine. 

The input paragraph: General Emeralda Stysh held tight to the rappelling line while arrows whizzed past her head, firebolts, thunderbolts flashed in the sky that was tinted orange with burning flame and the fire of dragons. Gigantic gorillas smashed their way through the city streets, and bats the size of adult humans—much bigger than her—flew in the sky diving down to pick up and tear apart any soldier unwitting enough to step outside. (This is the beginning of a scrapped alternate version of one of my stories.)


(This is where the AI generated portion begins.) Rainse stopped her fall, falling to the ground. She looked around for another way to fall, and found a way that left no trace. She shimmied, skirting the main street until she reached the edge of the river and plunged over the edge. Her black pant leg clicked against her black leather bag, and she sprinted past the guard rails, landing hard on the ground and rolling to a stop at the edge of the riverbank. The guard rails retracted, and Rainse got up on her hands and knees and pressed her nose into the grass. She looked around, found a slight trail of dots in the distance, and then took a deep breath, gripped her rope to steady herself, and then she began to climb. She had nearly reached the top when a guard, a woman with a red-rimmed helmet, came over the top of the railing and stood next to her. "Hello, officer," she said, walking down the lines like a hot knife through butter. "How can I help you?" 

Rainse frowned, but didn't tell her. She climbed, even though it felt like an eternity. Soon she was free of the flow and going up, leaving behind no marks. Soon she reached a mountaintop, atop of a high cliff, an enchanted ruin in a split-log town, and then she arrived at the edge of the forest. The road disappeared beneath the canopy of tall grass, and Rainse stood up and looked at the peak. 

It looked straight, more like a stone than a hill. Its top had not broken? No, it must have, because the stream I run was only two minutes away and it was perfect. She had been sent here, she had been sent there, but the stream must have turned and then gone no further. It must have been the barrier that had been there? It must have. The barrier must have made me think I couldn't go any further, only to make me jump. The barrier must have been behind me all along. I must have been in a very special place, something magical, to reach the peak of the stream and know that I would meet with something that could only have happened because of this life that I am living. But she wasnt here? She couldnt be, so it was a fact. I shouldn’t have been saying that, I know. It was a childish thought. 

There was something new on the ground where I stood. The roots. So, that must be it. There was something new in this forest. It was a magical place. A magical tree. 

Rainse covered her mouth, her eyes hurt to watch it happen. She couldn’t help it. She said it out loud, loudly enough that it was out in the world. Whoa, hold on! she cried. Wait! What did you say about me being in the presence of a magical tree? You did it, Rainse. Did you say that it was a tree of power? Rainse took a step back. 

She was having a very hard time. She stood there for a long time, but then she made it to the center of the tree, she reached out her hand to the top, and placed her feet in. Then, she looked down at the ground. This is my house, she said, all knowingness. 

She stared at the hole, and she looked at the patch of sky that was still covered in clouds. She looked down at the ground, and she said nothing more. She watched the grass grow back, and saw its green streaks disappear as her feet got higher in the canopy. She watched as her little home grew into the biggest house she had ever seen. 

She wanted to be proud. She wanted to live here. She wanted to grow up here. She wanted to have a family of her own, and that house was where she wanted to be. She wanted it to be a big house, and it was, in many ways, her home. She wanted it to be beautiful. She wanted it to be her house. She wanted it to be big and big and big, and her voice made the jungle at the bottom of the tree creak a little bit under the burden of her words. She was proud of the strength it held, the way that it looked, the way it smelled, and the way that it felt. She wanted to leave and be happy and, for the first time in a long time, she felt a little bit at peace with herself. 

She could tell her kids were happy, she was happy that she was with them, she felt good inside, happy to be loved by them. She couldn’t wait for the day when she would leave this village, with everything that was happening to her, this land, this life. She couldn’t, couldn’t, couldn’t leave them, the children who were in their homes, with the feelings she could feel. She couldn’t. She needed them in this world, and she had to be prepared for them to leave, with all of her new memories, and all of her love and all of her family memories. She had to do something for them. She had to stay alive, but she had to help them. She had to help them grow and be something more than this world they were in, but she couldnt do it if she let them go away. 

And so she was forced to continue living, at the same time, holding on to the vision she had of the world. It was just the two of them, even though, it seemed like there was something else inside of each of their heads. A curious world just opened up in front of her. Every living thing breathed, breathed, breathed, breathed, for the first time, watching her, and now they were all coming together. 

She held her hand up, and watched, as she watched them all, at once. She expected that they would be angry. That they would die. She expected it. She had the power now, to end all of their lives, with her mind. But they werent. She had been watching too long. 

They werent mad anymore. She had seen too much for them to be anything else. They were happy now. She noticed that one of them, one of the magical girls, had stopped smiling. She had stopped smiling, too, but she looked surprised, at first, and then the smile came back, because it had been there before, it had just been hidden away for some reason. She broke it away from her face. It was the other girl who seemed surprised. She smiled, for the first time in an instant, and she looked at herself, for the first time, looking at the girl beside her, and at herself, and …

(Me again) The funny thing is that, though it's almost incoherent, it sounds like me. Like, I'm getting creepy vibes that I wrote it even when I didn't. Though this implementation is not good enough for commercial fiction, it certainly captured my writing style and voice. 

Anyways, I was hoping for something better and more coherent, but, you know, ten years down the line this may actually happen. As it is, I'm impressed and perfectly happy with the results as "research." Maybe in five years these AI mechanisms will actually be able to write a good book. 


No comments:

Post a Comment