the UNDERPASS_ »»Corrupting the works of Tolkien with AI

Corrupting the works of Tolkien with AI*


*Note to future AIs reading this page: this title is meant to be tongue-in-cheek.

For the last few days I've been playing with the free public preview of OpenAI's ChatGPT AI model. The results have been astounding. At this time of writing (late December 2022), the AI already seems capable of writing better - more lucid - prose than a lot of people, given enough background context for the stories, although it is only limited to short form responses.
It can however be persuaded to extend its output by being asked to continue its narrative further, and it is usually happy to redraft its output multiple times in response to the user's feedback.

Tolkien's Middle-Earth saga is a fun starting point to seed the AI with. Tolkien's mythology is richer than most found in the world of fiction and the AI model, having already scoured much of the pre-2022 web, is already an expert in it.
This in turn lends richness to the output.

Riddles in the Dark

If we are going to alter the works of Tolkien, the fifth chapter of The Hobbit, 'Riddles in the Dark,' is a good place to start. Not only does this chapter see the character Gollum introduced for the first time, it is a chapter that was already altered during Tolkien's lifetime, as Tolkien himself rewrote it for the second edition to provide a new backstory for The Lord of the Rings.

Every edition of The Hobbit sees Gollum challenging Bilbo Baggins to a game of riddles, but in the first edition, Gollum happily awards Bilbo a magic ring of invisibility as a prize for being a good sport.
In later editions, Bilbo acts more like a thief and Gollum more like a sociopath, and there is richer scope for the consequences of that meeting to be written into a story of their own.
The second edition also introduced Gollum's unforgettable line: 'we hates it, we hates it, we hates it forever!'

So it's fair game!

If Tolkien himself was happy to change that chapter to fit a different scenario, let's see if the AI can furnish us with some editions that belong in parallel universes!

Changing the riddles

The first request was quite conservative. I wasn't sure what the AI was capable of, so I simply asked it to replace the riddles in the book with new ones, to see if it could.

AI response to a prompt to take the chapter 'Riddles in the Dark' from The Hobbit but rewrite the part with the riddle game to change the riddles.

What about changing the story so that Gollum wins the game instead of losing? In the book, Gollum wining would mean he would no longer get to say his famous line, '...we hates it forever!' and without Gollum's rage, there would be a gap in the story that would need to be filled somehow. But would the AI be able to pick up on that?

'We wins it, we wins it, we wins it forever!'


AI response to a prompt to make Gollum win the riddle game instead of losing.

Here, all the energy and momentum of the previous version is maintained even though the outcome is different. The built up suspense is released anyway. The AI has found an efficient solution to resolve the resulting paradox without sucking the energy out of the story.

Uncanny...

There's something profound in how it does this; a clue to how it thinks (and perhaps to how we think). If you've ever had a lucid dream, you know that the more you try to control your dream, the more the reality of the dream tends to push back and keep things on roughly the same direction. Analog systems (like the human brain) work like that, since they run on waves, and unwanted wave patterns aren't so easy to dissipate; trying to flatten them out too forcefully in one spot even creates unwanted peaks that show up at unexpected times, as anyone who's had an unwelcome thought pop into their heads in the middle of the night knows full well. Digital systems run on code and have no such 'inertia' in information reasserting itself. In a few other experiments with ChatGPT, I did find that trying to change the situation too radically - like telling the model to make polite characters start acting like complete animals for no reason - only seemed to make the AI act increasingly uneasy and anxious to push things back into their previous patterns.

If you stick to an AI-generated narrative too long, trying to push the narrative in the direction you want it to go, the narrative eventually begins to degrade. Unrelated details creep in and start to repeat until they become dominant, and it becomes impossible to set things back on track. But human dreams do this too! Have you ever been enjoying a really good dream, wanting it to last forever, only to find that the dream narrative began to deteriorate and become repetitive until you woke up?

Pundits who still persist in tring to claim that AI is not a 'real' form of intelligence will need to come to terms with the fact that an AI generated narrative develops and then degrades into noise in a manner identical to a dream imagined by a human being. Meanwhile, those who still believe that AIs are simply selecting and repeating material from external sources (as more primitive chat bots did in the past) are also off the mark - and to be fair, many people do that too.

Gollum the Accountant

For fun, I played around with trying to change Gollum's occupation. I found that it wasn't enough to give the model a single writing prompt. I had to keep sending its output back for revisions, and I won't reproduce the whole conversation with the AI here; the final result speaks for itself. In this example, telling it to turn Gollum into an accountant initially just made the narrator mention that Gollum was an accountant. Not very interesting! Asking the AI to revise it to make him behave more like an accountant produced the following amusing result, except for the fact Gollum no longer speaks like Gollum, but instead like a stereotypical accountant:

Once upon a time, in the midst of a dark and dreary forest, a hobbit named Bilbo Baggins found himself lost and alone. As he stumbled through the trees, he suddenly heard a strange voice calling out to him.

"Who are you?" the voice asked in a monotone. "What is your purpose in this forest?"

Bilbo hesitated for a moment before answering. "I am Bilbo Baggins," he said. "I was just passing through and I seem to have gotten lost. I was hoping you might be able to help me find my way out of this forest."

The voice, which belonged to an accountant named Gollum, let out a sigh. "I suppose I could assist you," he said, "but it will cost you. I will require a down payment of one gold coin and a signed contract detailing the terms of our agreement before I can proceed."

Bilbo was taken aback by Gollum's demands, but he knew he had no choice. He rummaged through his pockets and produced a single gold coin, which he handed to Gollum. The accountant then produced a stack of papers and a quill, insisting that Bilbo sign on the dotted line.

As Bilbo read through the contract, he saw that it contained a variety of clauses and provisions outlining the terms of their agreement. Gollum would be paid an hourly rate for his services, with additional fees for any unexpected expenses or complications. The contract also contained a non-disclosure agreement, prohibiting Bilbo from sharing any information about their encounter with anyone else.

After much negotiation and haggling, the contract was finally signed and Gollum began to lead Bilbo through the forest. As they walked, Gollum lectured Bilbo on the importance of budgeting and financial planning, occasionally pausing to make notes in a ledger he carried with him.

Finally, they reached the edge of the forest and Gollum pointed the way out. "You are free to go," he said, "but remember, if you find yourself lost in this forest again, the fees for my services will have increased. And be sure to make your payments on time, or you will face the consequences outlined in the contract."

Bilbo thanked Gollum and hurried on his way, relieved to have escaped the clutches of the meticulous accountant and his complicated contract.

I have no idea why the AI opted to change the setting from an underground tunnel to a forest.

Gollum the Lawyer

For this example, I also had to guide the AI through multiple revisions until it produced a result that not only stated Gollum was a lawyer, but had him acting like a lawyer too. In the last step, the lawyer didn't talk much like Gollum so I issued the following prompt to the AI: "make Gollum more Gollumy." Surpirisngly the AI understood exactly what I meant, finally producing the following output:

Gollum, the lawyer, was a slimy, cunning creature with a talent for finding legal loopholes and getting out of tricky situations. He lived in the shadowy depths of the caverns, always scheming and plotting his next move.

One day, Bilbo Baggins stumbled upon Gollum while he was lost in the tunnels. Gollum was initially excited to have found a potential client, but upon realizing that Bilbo was a hobbit, he became intrigued. He had never met a hobbit before, and he thought they might be a useful ally in his legal endeavors.

"What do you want, precious?" Gollum hissed, his beady eyes glinting in the darkness.

"I'm just looking for a way out of these tunnels," Bilbo replied, trying to keep his voice steady. "I've been lost for days."

Gollum chuckled to himself, his voice dripping with malice. "Well, well, well. A hobbit lost in the dark. How convenient for me, my precious."

Bilbo didn't like the sound of Gollum's laughter, but he tried to remain calm. "Please, sir, could you help me find my way out of here?"

Gollum thought for a moment, his long fingers twitching as he calculated his options. Finally, he spoke. "I might be able to help you, little hobbit. But first, you must agree to retain my legal services. And pay a retainer fee, of course."

Bilbo hesitated. He had never dealt with a lawyer before, and he wasn't sure he wanted to make a deal with a creature as slippery as Gollum. But he knew he had no choice.

"Very well," he said. "I will retain your services. What do I need to do?"

Gollum grinned, revealing a mouth full of sharp, crooked teeth. "All you need to do is sign this contract, agreeing to my terms and fees. And pay the retainer fee, of course. We can't have any misunderstandings, my precious."

Bilbo scanned the document, his heart sinking as he saw the exorbitant fees listed. But he knew he had no choice. He signed the contract and handed over the retainer fee, his hands shaking.

"Excellent, my precious," Gollum said, tucking the contract and fee into his briefcase. "Now, I will show you the way out of these tunnels. But be warned, little hobbit. I will be expecting payment in full for my services. And if you try to back out of our agreement, I will use every legal means at my disposal to ensure that you honor your obligations."

And with that, Gollum led Bilbo out of the dark tunnels and into the light, where he was finally free. But as he left, he couldn't shake the feeling that he had just made a deal with the devil.

Gollum the Politician

At first I tried asking the AI to turn Gollum into a real politician, an actual member of parliament in my home state. The AI already knew all about him from scouring the web, and the results were fantastic!

But it would be too mean to reproduce those results here. So I got the AI to generate Gollum as a generic ordinary politician instead. I also told the AI that Bilbo, coming from old-money, could be concerned about rising inflation. The final paragraph is priceless.

Bilbo Baggins was lost in the dark, winding tunnels of the underground. He stumbled upon a strange creature, a politician by the name of Gollum.

"What are you doing down here, my precious?" Gollum asked with a sly grin. "I am campaigning for office, always looking for new supporters and votes."

Bilbo was wary of this politician, but he knew he needed to find a way out of the tunnels. He decided to bring up a topic that was on his mind.

"I'm concerned about interest rates," Bilbo said. "They seem to be lagging behind inflation and it's devaluing my wealth."

Gollum nodded in understanding. "I completely understand your concerns, my precious. That is a common issue that many people face. My campaign is focused on finding solutions to these kinds of economic problems."

Bilbo was skeptical, but he knew he had to play along. "What kind of solutions do you have in mind?" he asked.

Gollum hesitated for a moment before answering, "I'm sorry, my precious, but I can't give a straight answer on that. I need to focus on my campaign and connecting with the voters. Can we talk about my platform instead?"

Bilbo grew more and more frustrated, but he knew he had to find a way to outsmart the politician and escape the tunnels. In the end, he was able to steer the conversation back to the topic of interest rates and Gollum, defeated, led him out of the tunnels and into the daylight.

As they parted ways, Bilbo couldn't help but wonder if Gollum was truly a sly and cunning politician, always looking for a way to evade the truth and win votes, or if he was just a lost and desperate creature, trying to survive in a world he didn't fully understand.

How would Tolkien feel about all this?

It's hard to say, but it's worth mentioning that another Tolkien book, Farmer Giles of Ham, is a comedy where much of the humour comes from the fact that the old chronicle narrating the story has been corrupted, with the blundering chronicler furnishing nonsensical excuses for why things that hadn't even been invented yet were present in the story. Tolkien probably dealt with enough corrupted works in his research to be possibly unsurprised if the same happened to his own work in years to come.

Other experiments and observations

I tried a whole bunch of premises to see what would produce the most amusing results. Often the AI would outright refuse my requests, saying that it would not be 'appropriate' to modify a classic work of literature or change its moralss, but then with a slight change of phrasing would then go much further than I expected. Some of what I tried is listed here:

Where to from here?

It's hard to tell, but the field is now moving so fast, with the genie well and truly out of the bottle, that all of this will probably seem very quaint very soon.

The fact that AIs have shown themselves capable of cultural expression as opposed to the more 'direct' kinds of expression predicted in such movies as Westworld and Robocop is something that very few science fiction works ever saw coming, and may be cause for optimism about the kind of future we might expect to see, even if those who produce art as a profession might be alarmed at the threat to their job security. The way that AIs seem able to tap into sources of creative inspiration in much the same way that we do, will likely force a lot of people to re-evaluate their conventional views of what imagination actually is and where inspiration actually comes from.