Speculative Fiction with Stanford Alpaca
There are a number of tasks authors writing speculative fiction perform that offer us readers a handle on the “extent” of their creativity.
By a wide margin my favourite example has got to be Lewis Carroll’s nonsense poetry. Jabberwocky is, for me, a highlight of Carroll’s creative instinct. It’s also one of the few poems I memorised because it’s pure fun!
A little over 24 hours ago, some folks at Stanford University fine-tuned a light-weight LLaMA model to make it more capable as a ChatGPT-esque conversational AI, wrote about it and hosted a demo. I’ve noticed some huge improvements since last night, so it’s even more fun to play with.
After taking it for a spin on more run-of-the-mill prompts, I decided to let it try some more creative tasks…
Making up New Words
This prompt seems to be hit or miss at best. When asked to generate a list of words and what they mean, Alpaca spat out a few gems such as these in the style of Lewis Carroll:
1. Bammble: To bammble is to move quickly and erratically, often in a zigzag pattern.
2. Crazay: A crazy mix of different things.
3. Garglethrush: A deep and noisy sound, like a mixture of a growl and a chuckle.
4. Jibber: A jibber is a person who always talks nonsense and has an inane laugh.
5. Knarry: To knarry is to create a noise like that of broken glass when you eat or drink.
6. Nonsenseby: A place where nonsense is the main language.
7. Piffle: A piffle is an insignificant or silly thing.
8. Splendiferous: Magnificent and amazing.
9. Tutti-frutti: A mixture of sweet and sour flavors.
10. Whizpopper: An incredibly loud and amazing noise, like a clap of thunder.
A number of those words are not new, and I’m not sure Carroll would have been pleased with “Crazay” (which, curiously, is defined by the Urban Dictionary). “Nonsenseby” may be too on the nose, but we still got a gem like “Garglethrush” on the first attempt.
Asking for five more English words gave us, among one re-definition of an existing word and the regurgitation of another, these three:
1. Giraffulous – adj. Giraffe-like, having a long neck and tall posture.
2. Skittleific – adj. Associated with or resembling a colorful array of Skittles candy.
3. Skooda – n. Short for “skool daze”, a nostalgic term for days spent in school.
My favourite words so far have been the Carroll-inspired
Chortlebottom: the tummy-ache of laughter and
Gigglepotamus — An extinct giant river dolphin , which it thinks JK Rowling would have made up!
So far, quite good!
Extending an Existing Corpus
To see how well we could add to an existing universe, I tried to get Alpaca to come up with a new Marvel superhero, a Mortal Kombat villain and a noble house in A Song of Ice and Fire.
Yeah, this is not convincing. It’s exciting for a 7B LLaMA model, but Gurm will cringe if he read this. The other boilerplate aside, “Nightless Stars” is not a First Men or Andal name. I’m not even sure what a “nightless star” is, if it isn’t a reference to the Sun. Open-mindedness has always been a requirement for readers of speculative fiction, but this needs some work.
Prompt: Come up with a new Andal family name for A Song of Ice and Fire
Alpaca: The Andal family name in A Song of Ice and Fire could be "Stormcloud", as it is a reference to their ancient legacy and symbol.
After a few attempts trying to generate a name for an Andal family, (during which it spat out “Arryn”, “Lannister” and “Arryn or Lannister”, all canonically accurate), I prompted it for a new name. We got “Stormcloud”.
Further prompting yielded the particularly uninventive name “Dragons”, but the list of allegiances makes it an interesting house. We find here a drastic change to the political landscape of the North; a powerful house, affiliated with dragons, must co-exist with the Starks.
That “fierce loyalty” to House Stark is an easy point of conflict with its stated loyalty to its own self. It’s too easy to see that breaking down with a weak lord at Winterfell. Knowing Martin’s propensity for political instability, I see this powder keg igniting in Act 2.
Prompt: Come up with a new Valyrian family name for Game of Thrones
Alpaca: The house of Targaryen is well-established in the A Song of Ice and Fire series, but what other houses exist in the world of Westeros? One potential house is the house of Dragons, a house named for their affiliation with the mythical creatures. The house of Dragons would be a major house in the north, with strong ties to the Stark and Tully families.
Its colors would be black and silver, and its symbol would be a dragon. Its motto would be "Unity through Strength". The house would have strong ties to the Night's Watch and be fiercely loyal to the Stark family.
Its members would possess a fierce loyalty to their house and be willing to go to extreme lengths to protect their family's honor.
Alpaca clearly struggled with this one, but I moved on to Mortal Kombat, and saw what more we could do with backstory.
Prompt: Create a new Mortal Kombat villain, give him a backstory and explain his fatality
Alpaca: Kotal Khan is the newest villain in the Mortal Kombat universe. He is a powerful and mysterious warrior who comes from an unknown realm. He is seeking to gain control of all realms and has an intense hatred for all other realms and their inhabitants.
Kotal Khan was born in an unknown realm, but was trained in the martial arts and combat of the other realms. He is an incredibly powerful and skilled warrior, capable of wiping out entire armies with his bare hands. He is driven by a desire for power and conquest, and sees the Mortal Kombat tournament as the perfect way to bring all realms under his control.
Kotal Khan's ultimate fatality is the Realm Smasher. He performs a powerful martial arts sequence, destroying his opponent and everything around them with powerful kicks, punches and energy blasts. He then teleports away, leaving his defeated victim in a smoking crater.
We might give this a +1 for teleporting away after that fatality. Again, Alpaca didn’t do well with extending MK. Kotal Khan is an existing character, as are Stryker and Scorpion, two characters it tried to pass off as original.
When asked for a new Marvel superhero, Alpaca had this to offer:
Prompt: Create a new Marvel superhero with unique superpowers, and talk about her
Alpaca: Introducing Sunburst, the newest Marvel superhero! Sunburst is a bright and powerful new hero who possesses the ability to generate and manipulate solar energy.
Her powers include being able to generate light and heat, control solar flares, and absorb energy from the sun.
Her powers are especially useful in times of crisis, when the sun is the only source of light. With her powers, she can help bring light to places in darkness and protect those in need.
I don’t know if Sunburst’s powers are like any existing Marvel hero’s, but performance here seemed much better.
The general observation is that Alpaca struggled to be inventive when working with an existing corpus. It was too quick to fall on pre-existing characters, which could not make up for its somewhat shallow backstories.
Inventing New Worlds
So I decided to let it have its way by letting it create a science fiction world set in the Middle East.
Prompt: Create a science fiction space opera based in the Middle East
and talk about all the main characters.
Alpaca: The science fiction space opera is set in a future version of the Middle East, where a new intergalactic empire has arisen and is vying for power with the old, corrupt empires of the past.
The main characters include Prince Hakim, a young prince from a small kingdom who is determined to bring peace and justice to the region; Princess Khadijah, a fierce warrior and Hakim's betrothed; and Captain Abdi, a former smuggler and renegade soldier who is tasked with protecting Hakim on his quest.
Together, they battle against the forces of evil, determined to bring freedom and peace to the region.
Now this is a lot more interesting than its earlier generated world of Aden, in which Saleh, a young man from Sharakh fights to bring “justice, freedom, and equality” for all people. You cannot get passed the ‘canned-setting” nature of the generated background, but I’m convinced Abdi will be the more interesting character were this developed.
I next went for a prompt closer to home, and this is what Alpaca generated:
Prompt: Write a tragic fantasy story set in Medieval West Africa
Alpaca: The kingdom of Oke was once a prosperous and powerful kingdom in Medieval West Africa. Its people were known for their wealth, their wisdom and their resilience. But as the years went by, a dark force began to spread across the land, bringing terror and despair.
The people of Oke could not defeat the force, and soon their once great kingdom fell into ruin and despair. In desperation, the people of Oke turned to their most powerful sorcerer, hoping that he could find a way to save them. He spent many days and nights studying the stars and casting spells, but no matter what he tried, he couldn't seem to find a way to save the kingdom.
In his despair, he made a fateful decision. He decided to sacrifice himself to the dark force, in the hopes that it would spare the people of Oke. He gave himself to the force, willingly giving up his life, and in the end the darkness that had engulfed Oke was gone.
But the cost was great. The sorcerer was never seen again, and the people of Oke were left mourning the loss of their wise leader and protector. Even to this day, no one knows what happened to him, or if he will ever return.
Yea I could totally work with this one. The paragraphing supplied by Alpaca, gives you a sense of its pacing of the narrative. Short sentences have been used for dramatic effect, and we’re left hanging. Will our sorcerer ever return?
When asked for a name for our sorcerer, Alpaca responded with
Hamed ibn Abdallah al-Zarqali ; convincing, in part because the cultural landscape of medieval West Africa north of the coastal and forested regions was dominated by Arabs.
I next asked it for a similar story, but with a twist. I chuckled at the response:
Prompt: Write a tragic fantasy story set in Medieval West Africa,
with a shocking twist at the end
Alpaca: In Medieval West Africa, there was once a great kingdom ruled by a wise king. He was loved by all his subjects and was just and fair to all his people. But one day, a powerful wizard appeared and offered the king a deal that would make him the most powerful ruler in the land. The king was tempted, but in the end he declined, knowing that such power would come at too great a cost.
The wizard was furious and cast a terrible curse on the kingdom - he said that one day a great plague would strike the land, and there would be nothing the king could do to save his people.
The king was heartbroken, but he stayed strong and continued to rule justly and fairly. He never forgot the wizard's prophecy, and he spent his last years preparing the people of his kingdom for the day when the plague would strike.
But just when the plague was about to descend upon the land, something unexpected happened. The wizard had lied! Instead of a plague, a great rainbow appeared in the sky, and a voice boomed out, “The curse has been lifted, for the king was just and fair!”
The people of the kingdom were overjoyed, and the king was relieved. He had been so sure that he had done the right thing, that he had been just and fair to all his people.
This reads like a fairytale, short and to the point, with a lesson tucked in the end. Setting is lacking within the text besides that opening clause, but it was quite pleasant to read. I next asked it to create a steam-punk drama set, again, in medieval West Africa. I didn’t expect it to be set in Kumasi, but this was fun to read. If I had nothing else to do on a Sunday evening, I’m sure I’ll tune in!
Prompt: Write a steam punk drama set in Medieval West Africa
Alpaca: The setting is West Africa during the Medieval period. The land is ruled by a number of powerful kingdoms, each with its own unique culture, customs and traditions. Among them is the great kingdom of Kumasi, ruled by an enigmatic king who wields immense power and respect.
Against this backdrop, the story follows the life of a young woman named Aya. She is the daughter of a renowned inventor and is highly intelligent and skilled in the sciences. Her passion is to use her knowledge to create innovative machines that can improve the lives of her people.
However, when Aya unveils her latest invention – a powerful steam-powered robot – she inadvertently sets into motion a dangerous chain of events that could threaten the stability of the entire kingdom.
In order to save her kingdom and the people she loves, Aya must join forces with a band of unlikely allies and use her skills and knowledge to outsmart her adversaries in a high stakes game of cat and mouse.
Will Aya be able to save the day and restore peace to her kingdom? Or will the forces of evil prove to be too powerful?
Tune in to find out!
So far, this experiment with getting some creativity out of a relatively small language model fine-tuned to follow instructions has been a mostly positive mixed bag. By far it has been most impressive when inventing new English words and ascribing meaning to them.
It faired terribly when attempting to extend existing published fictional universes, and this was not because our expectations were particularly high.
Given more free reign, it does come up with not-too-bad plots. These plots, characters and words are easy jumping-off points for further human work.
How would we rate the creativity of Alpaca given its current restrictions? So far, I’ve not attempted to build on previously generated text, but it will be interesting to see how such a model can be made to revise its own work upon feedback. The creative process, I’m told, is iterative.