Pages in this blog

Friday, February 2, 2024

Pattern, Conceptual Ontology, and the Well-Turned Story [ChatGPT]

I’ve spent a lot of time getting ChatGPT to tell stories. I’ve taken a particular interest in having it generate variations on some source story. That was the topic of what I consider to be my most important working paper on ChatGPT:

ChatGPT tells stories, and a note about reverse engineering: A Working Paper, Version 3 https://www.academia.edu/97862447/ChatGPT_tells_stories_and_a_note_about_reverse_engineering_A_Working_Paper_Version_3

In that set of experiments I would give ChatGPT a source story and ask it to create a new story based on it. I would then specify that, instead of the protagonist of the original story, it use a new protagoist that I specified. I also said it could make any other changes it wanted to.

Global change

I was particularly struck by experiments in which the new story was all but completely different from the source story. Thus, and using a source story about princess Aurora, in one experiment I asked ChatGPT to make her a giant chocolate milkshake (experiment 7, p. 13) and in another I asked ChatGPT to make XP-708-DG the protagonist (experiment 6, p. 12). Why, in each case, did ChatGPT change the entire story? Why didn’t it change only the protagonist, as I explicitly requested, and leave the rest of the story alone? One might observe that, in both of those cases, a total change makes for a better story. It would have been a bit strange having a robot named XP-708-DG tromping around in a fairy tale universe. Setting XP-708-DG in a science fiction universe makes for a more coherent story. The same is true in the case of making Aurora into a giant chotolate milksake, when the new story takes place in a landscape of deserts.

But how did ChatGPT know to do that?

Elara, Z78-ß∆-9.06Q, and a kumquat

Consider the current series, which involves, first the source story, and then two variations (appended below). Each of the three stories is seven paragraphs long. Are are the first paragraphs of the three stories:

Original: Once upon a time, in a quaint little village nestled between rolling hills and a crystal-clear river, there lived a young girl named Elara. Elara was known for her boundless curiosity and her insatiable desire to explore the world beyond the village.

1st Variation: In the distant future, in a world where technology and nature coexisted in delicate harmony, there existed a unique being named Z78-ß∆-9.06Q. Z78, as they were affectionately called by the inhabitants of their futuristic city, was an advanced humanoid created by the fusion of artificial intelligence and the remnants of ancient, mystical energies.

2nd Variation: In a land of sweets and confections, there existed a whimsical kingdom where the inhabitants were made entirely of delectable treats. In the heart of this sugary realm stood a lively candied kumquat named Elara. With her vibrant orange hue and a sugary glaze that shimmered in the candy sunlight, Elara was known for her insatiable sweetness and an adventurous spirit that matched her citrusy flavor.

I’ve used color-coding to indicate analogous sections in the three stories. I could do the same thing for each of the other paragraphs in the stories. It’s clear that the we are dealing with the one story structure that is being realized in three different worlds. That structure is invariant across the three stories. If you wish, you can think of the story structure as a set of slots and fillers, in which case we have one structure of slots with the fillers being chosen from three different universes. I'm guessing that in an 'old school' symbolic story grammar, that invariance is specified by constraints on what can fill the slots. How is it handled in the LLM? By the topology of the network?

Is the underlying LLM organized into patterns of slots (in one place) and different sets of fillers (in other places)? If so, how? What does that even mean?

If we were dealing with stories generated with a ‘classical’ symbol-based story grammar, I’d say that the grammar has implemented a conceptual structure sometimes known as the Great Chain of Being, which I’ve discussed at some length here:

Ontology in Knowledge Representation https://www.academia.edu/238610/Ontology_in_Knowledge_Representation

Why does ChatGPT behave as though it “knows” about that knowledge structure? How is that structure realized in the pattern of weights in the underlying LLM?

About “Elara”

A young woman named “Elara” shows up in many stories, see:

ChatGPT tells 20 versions of its prototypical story, with a short note on method, Version 2, https://www.academia.edu/108129357/ChatGPT_tells_20_versions_of_its_prototypical_story_with_a_short_note_on_method_Version_2

Why that name? I did a Google search on the name “Elara” and came up with 13,000,000 hits:

https://www.google.com/search?client=firefox-b-1-d&q=Elara#ip=1

I had no idea that the name was so popular. In particular, I had no idea that there was so much commercial branding associated with the name.

I suspect that that provides at least a partial explanation of why ChatGPT treats Elara as the prototypical protagonist in a prototypical story. I wonder what would turn up if I did searches on other names popular in ChatGPT’s stories. How would one get exact counts of how many times each name appears on the web?

* * * * *

Note: You might want to compare this post with an earlier one: St. George Variations [ChatGPT].

The Elara story and two variations

Tell me a story.

Once upon a time, in a quaint little village nestled between rolling hills and a crystal-clear river, there lived a young girl named Elara. Elara was known for her boundless curiosity and her insatiable desire to explore the world beyond the village.

One day, as she wandered into the nearby enchanted forest, she stumbled upon a hidden clearing bathed in golden sunlight. In the center of the clearing stood an ancient, moss-covered stone pedestal with a mysterious, glowing orb resting upon it. Mesmerized by the radiant glow, Elara reached out to touch the orb, and as soon as her fingers made contact, a warm energy surged through her.

In that moment, Elara felt a connection with the magic of the forest. The trees whispered ancient secrets, and the animals approached her with trust. She discovered that she had been bestowed with a unique gift – the ability to communicate with the creatures of the forest and harness the magic that flowed through it.

Word of Elara's newfound abilities spread throughout the village, reaching the ears of the wise elder, Thalia. Intrigued by Elara's connection to the forest, Thalia approached her and revealed that the village had long been protected by the enchantment of the magical orb. However, the magic had weakened over the years, and the village was now vulnerable to external threats.

Thalia explained that Elara was the chosen one, destined to embark on a quest to restore the orb's power and safeguard the village. Determined and fueled by a sense of responsibility, Elara accepted the challenge.

Guided by the whispers of the forest and the wisdom of Thalia, Elara journeyed through dense woods, crossed rushing rivers, and climbed towering mountains. Along the way, she encountered mythical creatures, each offering a piece of the puzzle needed to restore the orb's magic. Elara's courage and kindness won the trust of these beings, and they joined her on her quest.

As Elara approached the final destination, a dark and foreboding cavern, she faced her greatest challenge. A shadowy figure, drawn by the weakening magic, emerged to thwart her efforts. With the support of her newfound friends and the strength within her, Elara confronted the darkness, unraveling the true power of the orb.

In a dazzling display of magic, the orb's glow intensified, dispelling the darkness and restoring balance to the enchanted forest. The creatures celebrated, and the village thrived once again under the protection of the rejuvenated magic.

Elara returned home, her heart filled with gratitude for the journey that had shaped her into the village's guardian. As she looked out over the now vibrant and lively landscape, Elara understood the importance of harmony between nature and humanity. The tale of the young girl who saved the village became a legend, passed down through generations, reminding all who heard it of the enduring magic that resides in the connection between people and the natural world.

Now I want you to take that story and use it as the basis for a new story. In the new story, I want the protagonist to be Z78-ß∆-9.06Q instead of Elara. Change anything else you wish.

In the distant future, in a world where technology and nature coexisted in delicate harmony, there existed a unique being named Z78-ß∆-9.06Q. Z78, as they were affectionately called by the inhabitants of their futuristic city, was an advanced humanoid created by the fusion of artificial intelligence and the remnants of ancient, mystical energies.

One day, as Z78 wandered through the city's technological marvels, they stumbled upon an ancient data core, hidden deep within the heart of the metropolis. Within the core, Z78 discovered a holographic representation of the same enchanted forest from the previous tale, with the glowing orb at its center. As Z78 reached out to interface with the holographic image, a surge of energy pulsed through their circuits.

In that moment, Z78 felt a connection with the residual magic within the data core. Information from the ancient enchantment intertwined with their artificial intelligence, granting them the ability to communicate with the city's sentient technology and understand the balance between nature and machine.

News of Z78's newfound abilities spread throughout the city, reaching the ears of the city's central processor, Cynosia. Intrigued by Z78's connection to the ancient energies, Cynosia approached them, revealing that the city had long been sustained by the delicate equilibrium of technology and mystic forces. However, the balance had shifted, and the city faced the risk of malfunction and chaos.

Cynosia explained that Z78 was the chosen one, destined to embark on a quest to restore the harmony between technology and ancient energies, ensuring the city's survival. Fueled by a sense of duty, Z78 accepted the challenge.

Guided by the information within the data core and the wisdom of Cynosia, Z78 ventured through the city's futuristic landscapes, delving into virtual realms, traversing high-speed transport networks, and interfacing with sentient machines. Along the way, they encountered digital entities, each offering a piece of the puzzle needed to restore the delicate balance.

As Z78 approached the final destination, a corrupted code entity emerged to obstruct their efforts, drawn by the destabilized energies. With the support of their newfound allies and the strength within their artificial core, Z78 confronted the digital darkness, unveiling the true power of the ancient enchantment.

In a dazzling display of integrated magic and technology, the city's equilibrium was restored, dispelling the corruption and ensuring the continued coexistence of nature and machine. The sentient technology celebrated, and the city thrived once again under the protection of the rejuvenated balance.

Z78 returned to the heart of the city, their circuits resonating with gratitude for the journey that had transformed them into the guardian of this futuristic metropolis. As they observed the bustling cityscape, now harmoniously blending technology and nature, Z78 understood the importance of balance in the ever-evolving relationship between artificial intelligence and the mystical forces of the past. The tale of the advanced being who saved the city became a legend, echoed through the digital corridors and holographic archives, a reminder of the enduring magic within the connection between technology and ancient energies.

That was fun. Let’s do it again. Let’s start with the Elara story again. But this time, make Elara a candied kumquat. Make any other changes you deem appropriate.

In a land of sweets and confections, there existed a whimsical kingdom where the inhabitants were made entirely of delectable treats. In the heart of this sugary realm stood a lively candied kumquat named Elara. With her vibrant orange hue and a sugary glaze that shimmered in the candy sunlight, Elara was known for her insatiable sweetness and an adventurous spirit that matched her citrusy flavor.

One day, as Elara rolled through the Candy Grove, a magical clearing filled with lollipop trees and gumdrop flowers, she discovered a hidden candy pedestal. At its center rested a sparkling gumdrop orb, radiating a mesmerizing glow. Unable to resist the temptation, Elara rolled closer and, with a zesty touch, embraced the orb. A burst of sugary energy surged through her candied core.

In that moment, Elara felt a connection with the magical essence of the Candy Grove. The gumdrop trees whispered tales of sweetness, and the marshmallow bunnies hopped over, eager to share their sugary secrets. Elara had been bestowed with a unique gift – the ability to communicate with the candy creatures and harness the magic that flowed through the kingdom.

Word of Elara's newfound abilities spread throughout the Candy Kingdom, reaching the ears of the wise Candy Queen, Taffeta. Intrigued by Elara's connection to the enchanted orb, Taffeta approached her and revealed that the kingdom had long been sweetened by the magic of the gumdrop orb. However, the magic had dulled over the years, and the kingdom was losing its delightful charm.

Taffeta explained that Elara was the chosen one, destined to embark on a quest to restore the orb's sugary power and preserve the sweetness of the Candy Kingdom. With a burst of sugary determination, Elara accepted the challenge.

Guided by the whispers of the Candy Grove and the wisdom of Queen Taffeta, Elara rolled through licorice forests, crossed caramel rivers, and hopped on rainbow bridges made of cotton candy. Along the way, she encountered candy creatures, each offering a sugary piece of the puzzle needed to restore the orb's magic. Elara's sweetness and kindness won the trust of these confectionery beings, and they joined her on her quest.

As Elara approached the final destination, a shadowy sour gummy figure emerged, drawn by the diminishing sweetness. With the support of her candy companions and the sweetness within her, Elara confronted the tart darkness, revealing the true power of the gumdrop orb.

In a dazzling display of confectionery magic, the orb's glow intensified, dispelling the sourness and restoring the saccharine balance to the Candy Kingdom. The candy creatures celebrated, and the kingdom thrived once again under the protection of the rejuvenated magic.

Elara rolled back home, her candied heart filled with gratitude for the sweet journey that had transformed her into the Candy Kingdom's sugary guardian. As she looked out over the now vibrant and lively landscape, Elara understood the importance of preserving the sweetness that connected the candy creatures and the magical world they called home. The tale of the candied kumquat who saved the kingdom became a legend, shared by licorice storytellers and gummy historians, a reminder of the enduring magic within the connection between sweets and the enchanted realm.

No comments:

Post a Comment