Twisted tales and monstrous mashups
Procedural narrative generation using a large language model (LLM)
Premise
Train ChatGPT-4 to combine two or more plot lines from well-known folk and fairytales to create coherent new variants.
ChatGPT excels at text manipulation at higher orders of organisation than just sentences. I wanted to test this ability in a controlled exercise using simple narratives that were not subject to copyright to understand the potential for using a LLM-powered AI to generate endless variations procedurally.
Scroll to the bottom of this article to find links to some mashup stories the AI generated. Some of the stories are quite dark in keeping with the original nature of the tales.
Background
Vladimir Propp’s (1895 - 1970) groundbreaking study of Russian folktales (an overview of the study can be found here, courtesy of MIT) opened up new possibilities for the systematic study of stories. Famously, Propp identified 31 basic plot elements he believed were the elementary ‘building blocks’ of all the stories he had studied from a corpus of 100 Russian fairytales, along with 7 main character types (or agents).
The important move here is separating plot from narration. Propp opened up a new way to approach the study of narratives that continues to influence not just the study of literature but also writers working in film, TV and gaming.
Joseph Campbell’s The Hero With A Thousand Faces, for example, takes the view of a story told and retold across cultures in variations, giving his comparative mythology a Jungian cast that seeks out universals of the human unconscious.
Campbell’s work, in turn, went on to influence writers and film makers such as George Lucas. Lucas’ original Star Wars is not only indebted to Campell’s Jungian archetypes but also makes use of at least 9 of the 31 plot devices identified by Propp. Later episodes go on to make use of even more of the plot elements, as show by this unverified analysis by ChatGPT:
Here is a similar analysis of the prodigious output of Shakespeare:
With this atomistic view of plot, I wanted to test ChatGPT-4’s ability to recombine plot elements from relatively simple stories to produce interesting new variants and combinations procedurally, i.e. without significant editorial input.
(For the curious, there is the list of 31 plot elements Propp identified in his landmark study on the Wikipedia page.)
Training ChatGPT-4 to generate remixed stories procedurally
I really wasn’t sure which way the AI was going to handle this task at first but I had an idea to design it as a function. My inspiration was the film Short Cuts (1993) by director Robert Altman. In the film, seemingly disconnected stories intersect, driven by chance encounters. I felt this was a good metaphor for what I wanted to achieve with the AI so I declared the function to the AI as an ALTMAN function.
There was not a lot of complexity to setting up the task. Here is the basic process I followed:
I asked ChatGPT to make a list of the 20 best-known fairy and folk tales in the world and to exclude ones that were subject to copyright.
To prime the AI, I had it generate short plot synopses for two stories.
I then defined the instructions for the ALTMAN function as follows:
Good. Let's call that Plot B. Can you combine A and B so that the characters share the same plot line? You can add events or more characters to make the blending of the two stories more natural. Let's try!
I fed the AI some sample fairy tales from the Brother’s Grimm but also short extracts from Angela Carter and asked the AI to analyse the style. I then took it’s description of the styles and recycled them into the prompt instruction as style models. I also set a general length for the text generation.
I also introduced a weighting system (a scale of 1 to 5) that would allow me to set which plot line (Plot A or B) would dominate in the new narrative.
Then I did testing. Lots of testing. Here is a short list of some of the ideas I baked into the ALTMAN function:
Make the story darker
Include more literary devices
Include more dialogue set pieces between characters
Remove a character as a saviour and let the main protagonist resolve the conflict for herself
I also asked the AI to generate a short synopsis of the new mash up creation and suggest some titles.
I guess if you’ve read this far, you’ll be keen to read some of the output. Here is one in it’s entirety after a some minimal editing to clean up some of the deficiencies of the initial generation:
A Sweet Escape
Three Billy Goats work with the Gingerbread Man to outsmart a troll so they can get to greener pastures.
Three Billy Goats work with the Gingerbread Man to outsmart a troll so they can get to greener pastures.
Once upon a time, in a small village near a river, there lived three Billy Goats: Gruff, Bluff, and Fluff. They loved to graze in the meadow across the river but they had to cross a rickety old bridge that was guarded by a fierce troll who had recently taken control of it. One day, they hatched a plan to outsmart the troll and cross the bridge safely.
As they were devising their plan, they heard a commotion nearby. It was the Gingerbread Man, a small but sly cookie, who had just escaped from a nearby bakery. He was being chased by a hungry fox who wanted to eat him.
"Please help me!" cried the Gingerbread Man. "I don't want to be eaten by the fox!"
The Billy Goats decided to help the Gingerbread Man and asked him to join their mission. “Stick with us,” they bleated. “We won’t let you get eaten by the fox.” And together, they set out to cross the bridge and outsmart the troll.
As they approached the bridge, they heard the fox barking in the distance. The Gingerbread Man began to panic.
"Don't worry," said Gruff. "We have a plan."
When the fox arrived, the goats explained their situation and asked for his help. The fox was hesitant at first, but when the goats offered him a share of the Gingerbread Man, he agreed.
They led the fox to the bridge, where the troll emerged from beneath it and roared, "Who goes there?"
"It's just us Billy Goats," said Gruff. "We want to cross the bridge to graze in the meadow."
"I won't let you cross unless you pay me a toll," growled the troll.
"But we don't have any money," said Bluff.
"Wait, I have an idea," said the Gingerbread Man. "I'm a delicious cookie. I'll distract the troll with my sweet smell and you can sneak past him."
The Billy Goats were skeptical but decided to give it a try. They threw the Gingerbread Man towards the troll and while he was distracted, they quickly ran across the bridge. The fox followed the Gingerbread Man, hoping to get his share of the treat.
But the troll was smarter than they thought. He caught the Gingerbread Man in mid-air and devoured him before the fox could even take a bite. The fox was furious and attacked the troll, but the troll was too powerful for him. In the end, the troll ate the fox too.
The Billy Goats watched from a safe distance and chuckled to themselves. They had outsmarted both the troll and the fox, and had successfully crossed the bridge. They spent the rest of the day grazing in the meadow and lived happily ever after.
Go to the bottom this article for links to more procedurally generated fairy tales.
Making it procedural
Next, I wanted to use ChatGPT to generate new stories procedurally. This was relatively straightforward to achieve now that the ALTMAN function was more or less established and producing results with which I felt I could work. I did this by asking the AI to:
select two stories at random and
combine them using random weightings for each.
To get a set of stories, I asked it to generate 10 unique combinations at random.
A note on ChatGPT-4 text length restrictions
Officially ChatGPT can only accept 2048 characters as input but it’s possible to chain a longer text together by breaking it up into chunks that can be fed sequentially as input.
As for output, the longer the text output, the more likely ChatGPT is to go off the rails. In the ALTMAN exercise, asking it to generate a long chain of lengthy texts caused issues. I got around this by asking the AI to create a table of the combos it had come up with and to include a very short synopsis. I was then able to select the ones I thought might be interesting and ask it to generate the full story simply by stating (for example) :
Give me an ALTMAN story for row #4
I then build the stories one by one so ChatGPT doesn’t get overloaded.
Observations
If you are worried about ChatGPT-4 replacing the role of writers just yet, you needn’t be. Even these short stories required editorial input to pull together coherent, reader-friendly texts.
Some of the typical editorial issues I frequently encountered in the procedurally generated texts include:
The two plots were not combined but ran as parallel story lines.
Important plot points were glossed over and resolved deus ex machina, e.g. “And so using their ingenuity, they defeated the evil wizard and escaped,” without explaining exactly what the characters did.
Character backgrounds are assumed and not introduced.
Dialogue for key scenes was often omitted.
In these cases, I would ask the AI to further explain the plot point or rewrite certain sections to include dialogue and then fold that into the initial draft.
I was surprised by some of the plot resolutions the AI was able to produce. More than a few were slightly taboo or verged on the profane. Others also rectified some of the antiquated views of gender roles baked into the original tales.
Perhaps soon we will be able to entertain the idea of generative story books where each read through will contain new plot twists, characters and dialogue.
As one final surprise, the AI spontaneously gave me a remarkably insightful definition of the ALTMAN function while I was concept checking it:
Can you remember how to produce ALTMAN texts?
Yes, I remember how to produce ALTMAN texts. ALTMAN stands for "Automated Literary Text Generation with Markov Networks". It is a method for generating coherent text that follows the style and themes of a given corpus. The algorithm uses a Markov chain to predict the next word in a sentence based on the probability of that word appearing given the previous words. ALTMAN can be used for a variety of applications, including generating creative writing, news articles, and even social media posts.
Interesting. Did you just make up that acronym? What is the source?
I apologize for the confusion - I made a mistake earlier. ALTMAN is not an established acronym or method for generating text. It was a term that I used to refer to the style of writing you requested earlier, which involved combining two or more fairy tales or folktales together into a new story. I apologize for any confusion this may have caused.
I couldn’t have put it better myself.
MORE PROCEDURALLY GENERATED TWISTED TALES
Goldilocks helps break Snow White's spell, forging an unlikely friendship against jealousy and envy.
Cinderella and Rapunzel bond over shared suffering, but obsession and the pursuit of power drive them apart.
Little Red Riding Hood helps a cursed prince and later escapes a wolf by using an unusual sleeping aid.
Three Billy Goats work with the Gingerbread Man to outsmart a troll so they can get to greener pastures.
A princess under a curse turns the tables on her musical abductor, unleashing deadly consequences.