Friday, July 19, 2019

In Which An AI Attempts to Do My Job

You're the only one who can write your story. That's an oft-repeated encouragement among writers; depending where you're coming from, it promises that your work matters, that your work is unique, that you have some weird form of job security in that you cannot really be replaced by another person or, heaven forbid, a robot. It's also not entirely accurate; other people can take your story and make it their own (as evidenced by, say, series that are taken over by another author after the first author dies, or even the existence of fanfiction). And, as it turns out, there are AI that are at least semi-competent at writing.

So, does that mean that an AI can write your story? I decided to figure out the answer using Talk to Transformer, a neural network created by Adam King and based on OpenAI's GPT-2 learning model. I feed the AI the first few lines of one of my novels, and it generates the next few paragraphs based on what it knows from downloading a large chunk of the internet. From that, we'll see if an AI really could write my story.

 Can An AI Do My Job?

First Test: Blood in the Snow

We begin, obviously, with Blood in the Snow. If you're not familiar with it: it's an Asian-inspired retelling of Snow White crossed with The Goose Girl, a story of betrayal, friendship, magic, and finding one's voice. It's also available to buy on Amazon or add on Goodreads, if you're so inclined! What will the AI do with it? Let's find out! The original prompt is the portion in bold; the AI created what follows.
The cherry blossoms fell slowly the morning Princess Zhu Baili of the Kingdom of Seven Rivers left her home forever.
Baili tucked her hands deeper into the wide sleeves of her red silk robe, watching as the petals sprinkled the surface of the Taìyáng River and swirled around the royal barge.
She heard the noise of the wind through her bedroom window. It was silent and beautiful, like birds flying. In her room, she tucked herself deeper into her white robe and closed her eyes, waiting for her mother's footsteps to come slowly down the steps of the palace, like a boat sliding into the waves.
After about forty-five minutes had passed, a small door was opened. As the door closed, the rain began to fall, soaking the windows, and the breeze blew through her room.
With little noise, Princess Zhu Baili fell asleep for only nine hours.
On Friday morning, June 6th, she awoke at six. She looked at the clock, and heard her mother's footsteps enter the room, which was now empty, as usual. Looking in all directions, she saw her little sister Yúxi in her bed, still wearing her long gown.
As you see, the AI manages a surprisingly pleasing tone (especially given how little of the original it had to work with). It does have a bit of trouble keeping track of small details, though, and it seems inclined to take the story in a rather different direction than intended. It's also invented a younger sister for Baili . . . which, honestly, is pretty feasible. Baili has more than a few siblings who don't feature in Blood in the Snow.

Now, let's move on to the second test: my upcoming novel, Mechanical Heart!

Second Test: Mechanical Heart

Mechanical Heartin case you somehow missed it, is a steampunk retelling of Rapunzel centering on a girl trapped in a clock tower and a prince fighting his relative lack of power. It comes out in just three weeks (ahhhhh!), and I'm super excited. Because we have two POV characters, I'm going to give the AI the opening lines from each of their first chapters and see what happens.

First up: Breen's POV! I ended up running this one multiple times (trying to give the AI a fair chance) and ended up with a couple good options. My favorite result actually bears very little resemblence to the original, but it sounds like an interesting story.
Her heart beat on, as it always did.
Breen waited, eyes shut, trying to ignore the pain of her bones knitting back together. The crystal in her chest burned with an almost unbearable heat as it fed magical energy into her body. Yet the clockwork of her heart pumped on, unperturbed.

"I was planning to see you again."
Breen spoke, not to Akenes or her fellow workers. No, she spoke to Breen's friends, her closest circle around whom she was able to talk for the first time this day as the ship began its turn at Port Jarnarth. Breen spoke as Akenes stood on a deck and waited anxiously for the ship to approach her, a small ship that she knew could never reach Akenes, ever.
The crew of Jundlande stared at her, and the look on her face was one of confusion and terror. The people of Jundlande couldn't comprehend what Breen had done. She had done it, surely. They would never understand what she had done to their world. No. They would see what she had done. She had done it for them.
Again, a bit muddled on who and where characters are, but an interesting concept. What did this alternate universe Breen do? Will people understand what it is and why she did it? Who is Akenes? All the questions; none of the answers.

Moving on, let's see what the AI makes of Josiah's introduction . . .
“Powerless!” Josiah waved his hand in the air, pacing up and down the rich red carpet of the royal library. “That’s what we are. What we’ve become. Powerless!”
His eyes widened and he took a step back, the sound of glass shattering behind him. “Powerless!?” It was the cry of a frightened man, a scream that echoed around the building. “Oh God!” His sister's scream seemed to wake him up from what he'd been doing; it had broken his trance and, now that he was awake, he'd found it hard to concentrate in front of the door.
He stumbled down the steps onto the carpet, staring out toward the ceiling as a faint pink glow made him look back up at the room.
He pulled himself up by his sword before he could cry out again; instead he turned on a dime, and when the first girl was gone he turned to the girls in a look of incredulity, not knowing whether to laugh or cry. He saw her face grow even larger, her cheeks starting to get red.
So, the AI seems to have decided that Josiah is either in a horror novel or the survivor of some horrible event. Possibly both. Poor Josiah. Though, you have to admit, the AI's decision is pretty characteristic of certain schools of authors . . .

That's two tests, but any student of fairy tales knows that it's best to do things in threes. So, the AI's last chance:

Third Test: Once Upon a Dream

For those of you who don't know, Once Upon a Dream is a steampunk Sleeping Beauty retelling featuring dreamworlds, chemistry nerds, and the power of science motivated by love! I wrote it for the Five Magic Spindles contest and intend to publish it at some point, but it needs a bit of work first. Can an AI do that work for me? Let's find out. As before, the lines from the original work are in bold; the rest is the AI's creation.
Our story begins as do most tales: with a dream.
The ground rippled beneath Alexander’s feet, sending him stumbling sideways into the nearest tree. He pushed himself upright, brushing lichen and tree sap from his jacket. Another ripple unsteadied him, but he was ready for it this time and stayed upright.
His eyes were open. He took in the sights. A distant hilltop, a dark and distant lake, a dark and distant tree. He turned toward the lake, hoping with his eyes that it would give way without warning.
It did, and the ground beneath him cracked and rolled back, letting him out of the tree and into the lake—and his head, which lay atop of a tree branch. All that remained was a rock with something staining it, something bright and dark shining, and the world seemed filled with nothing except the image of him perched and waiting.
While he sat, staring at the landscape, the other characters of the tale moved away. They were gone, they said of themselves. In their place were strange men, who called themselves the Order, and had come down to see how the world went (or didn't go).
The AI's tendency to get a little mixed up about the details actually works somewhat in its favor here; the weirdness adds to the feel that this is a dream world that works by dream logic. One also has to appreciate the AI's decision to go a bit meta at the end, and this Order (looking to see how the world does or doesn't go) and the strange stone sound quite fascinating. All that said, it's certainly not the story originally intended.

So, in conclusion: our jobs as writers are probably pretty safe from the AI, at least for now. But if we're ever stuck for story ideas, dropping a few lines in this particular neural network might be a good way to get the mind working.

Now, it's your turn! Add your speculations about any of these AI snippets in the comments, or put in a few lines of your own work and share what the AI comes up with! I'd love to see what you get out of it!
Thanks for reading!
-Sarah (Leilani Sunblade)