Creative Writing with GPT-3: from Emoji to Flash Fiction

Original Source Here

Creative Writing with GPT-3: from Emoji to Flash Fiction

A robot tasked with writing a story! Image generated by author using DALL-E 2.

Using AI to develop a full story

As a creative fiction writer, I wanted to know if I could get AI to help me write stories. AI has been used to create fiction, such as a children’s book, a book of poetry, and an academic article about itself. AI-enabled writing tools, such as Google’s Wordcraft, have also augmented the process of planning, writing, and editing stories.

In this article, I use GPT-3, a generative AI language model created by OpenAI, to write a piece of short fiction in an iterative, human-in-the-loop process. Through each step in the process, I constrain GPT-3 in different ways to induce varying levels of specificity and sparsity using few-shot learning, detailed instructions, and parameterization. Using GPT-3, I

  • generate story ideas using emojis,
  • flesh out settings and character backgrounds, and
  • synthesize background context to create a compressed, 100-word short story

My philosophy with creative writing, as with most other creative pursuits, is that the human is essential to the creation process. GPT-3 does not automate the role of or replace the job of the creative writer. Rather, it is an instrument which enhances the job of the creator. I hope to show that this process of creative writing, while aided by AI, ensures that the human is still at the center of the creative process.

The Form: Flash Fiction

Flash fiction is a very short story that is anything from 1000 words to as short as 6 words. Flash fiction forces writers to get to the essence of the story in as few words as possible. Each word must be deliberate and essential to the story. See examples from NYT Tiny Love Stories or from 100 word story.

The Method

In this section, I outline the method I used to create a piece of short creative fiction in an iterative and interactive manner.

1) Choosing a title using emojis

Six Word Stories are an even shorter, more constrained version of flash fiction, in which you tell a full story in just six words. One of the most famous ones were written by Hemingway: “For sale: baby shoes. Never worn.”

I generate a six word story and use that as the title of the flash fiction. I use a method called few shot learning to map emojis to existing six word stories. With few shot learning, GPT-3 is first given a few examples mapping emojis to six word stories, which it learns from to generate a new six word story for unseen emojis. As GPT-3 was not very good at counting words, I forced it to deliberately count each word. I picked two random emojis and watched GPT-3 generate the title for my new story.

Using few-shot learning to tell a story in six words given two emojis. Screenshot taken by author.

The title: At night, I Become Human Again

2) Crafting a setting given the title

Next, I generate a setting for the story. I use the title (generated in the first step) as context. I also use parameters to constrain the format and prompt GPT-3 to give me three different examples I can choose from. I force GPT-3 to think of specific nouns and adjectives to describe a scene, as well as reasons why this might fit the title.

This was my prompt:

Title: At night, I become human againBrainstorm ideas for the story idea.  Generate three scenes that might align well with the story title. Make sure each scene is distinct from the other ones.Use this format:
${Scene number}: Nouns: ${Describe the scene using at least 5 nouns}. Adjectives: ${Describe the scene using at least 5 adjectives}
Reason: ${Step-by-step reason why this scene might work well with the title}
Repeat 3 times.
Using AI-generated title as context and parametrization format to generate three possible settings for the fiction piece. Screenshot taken by author

I like the suggestive and mysterious nature of the third generation, so I’ll choose this one. The nice thing about this approach is you can utilize different constraints. For example, you might want adverbs or phrases to describe a scene in more concrete detail.

3) Creating a main character

Next, I create a main character for the story. I encourage GPT-3 to imagine a detailed back story of the character. The majority of these details will likely not be used in the final story, but it builds the richness of the character.

I start with two bullet points (“high school calculus teacher with a gambling addiction” and “little town, big dreams”) and prompt GPT-3 fill in the rest. GPT-3 adds a third bullet point and then generates two paragraphs describing the main character. The resulting generation includes background and context about the main character: his motivations, desires, and personality.

My prompt:

Write a back story for the following person. Do not repeat any of the traits verbatim. Work them into sentences with additional background context. Do not repeat the same sentence twice.In the first paragraph, include the character's name. Describe their childhood and their relationship with their family, if they have any. Include the major event that led to their main personality traits.In the second paragraph, expand upon each of the points to show how they contributed to them as a person. Talk about the character's main fears and weaknesses and where they originated from. End the paragraph with a major conflict the character faces and the consequences of it.
Using GPT-3 to generate a detailed background on the main character. Screenshot taken by author.

4) Combining the pieces to generate a story

Now, I have a title, a setting, and a main character. To generate the final story, I use all of these pieces in the prompt as a context. Then, I supply the following instructions to GPT-3 explaining the format of the final output. The output is constrained to 100 words.

Task: Write a 100-word flash fiction short story.
- You only have 100 words, so think very carefully about each word that you use
- Employ brevity of word while still including the important elements of the story
- Use the character's background as context and refer to it as needed. However, do NOT repeat any sentences from the Character background. Only refer to it cryptically and do not bring up the obvious parts
- The story must include elements of conflict, character building, and a dramatic arc
- The story must be in first person.
- Do NOT include the character's name
- The story takes place in a few minutes
- Tell a story that needs to be told.

I ran the context + prompt several times to obtain several different stories to pick and choose from! Which one is your favorite?

Version #1: A depressing and rather vague story about a man who feels like a robot/calculator during the day and can “become human” at night by feeling his emotions.

Version #1 at generating a flash fiction piece titled “At Night, I Became Human Again.” Screenshot taken by author.

Version #2: A slightly less vague, but still depressing, story about an anxious man worried about his gambling debts who can “become human” at night having a few moments alone to themselves at night.

Version #2 at generating a flash fiction piece titled “At Night, I Became Human Again.” Screenshot taken by author.

Version #3: This story flips the first story, in which the main character is the math teacher during the day and “becomes human” at night by transforming into the secret passion of being a gambler. This version is a little repetitive (“I am …”) but has a nice rhythmic style to it.

Version #3 at generating a flash fiction piece titled “At Night, I Became Human Again.” Screenshot taken by author.

5) Bonus: Rewriting in a different style

GPT-3 can mimic the style of famous authors. One of my favorite authors of all time is Gabriel García Márquez, and so I prompted GPT-3 to rewrite the story in his style. There is some copy-paste from the original story, but there are also new embellishments in a new style.

Using GPT-3 to rewrite a story in the style of Gabriel Garcia Marquez. Screenshot taken by author.

Concluding Remarks

In this article, I showed one example of how I used GPT-3 to generate a piece of short fiction. These methods are but one of many ways to constrain GPT-3 to aid in the creative writing process. The human-in-the-loop portion was evident at each step: while choosing the emojis, while choosing the best generated setting, and while choosing the elements to describe the main character. Additionally, I generated my output as many times until I generated something that pleased me.

My hope is that tools such as GPT-3 can aid the creative writer in moments of writer’s block! For more cool examples of creative writing and poetry generated by GPT-3, I recommend checking out

I hope you enjoyed this article!


Trending AI/ML Article Identified & Digested via Granola by Ramsey Elbasheer; a Machine-Driven RSS Bot

%d bloggers like this: