The Sentient 3

Flexing ChatGPT’s two greatest strengths.

Bassel Saleh


April 10, 2023

Posts in the Pipeline

Hi blog, good to see you. I’ve been very slowly wrapping up the followup to my CatGPT part 1 post the past few weeks, but it’s been hard to find time to finish it. Spoiler alert, the goofy chat bot is now live, so the upcoming post will walk through the things I learned turning that into a proper web app deployed on Google Cloud.

ChatGPT: Strengths and Weaknesses

Today however, I would just like to share a particularly impressive ChatGPT conversation I recently had. Like everyone else, I’ve spent some quality time cozying up to ChatGPT this year, prompting it in all kinds of whacky ways to push the boundaries of this new exciting technology. I’ve had it write me stories about swashbuckling pirates and inception-style dream recursion, summarize advanced mathematical theorems in the style of Dr. Seuss, and even therapize me a bit with advice on what to do with my life. Once the novelty began to wear off, I started using ChatGPT more as a professional tool, editing paragraphs and suggesting new wordings for my papers and, of course, providing skeleton code for new software projects.

Much of the discourse on the newfound popularity of large language models (LLMs) has revolved around their utility as an assistant for searching the web, i.e. the current Microsoft Bing vs. Google Bard war. But it always seemed clear to me that the biggest strength of LLMs was not the retrieval of factual information, and indeed they famously get a lot of details wrong when you push them. These pretrained transformer networks are just trying to generate text that sounds human, with essentially no regard for the information content of their output. So people have tried very hard to modify and retrofit them to be better search buddies, essentially restraining them in various ways to limit the amount of bullshit they spew.

No, the more obvious strengths of ChatGPT in my experience have been: (1) creative fiction, and (2) writing code. I won’t get into my theories for why these seem to be the most natural settings for ChatGPT to flex its muscles, but empirically it’s hard to argue that this isn’t true. And now, with literally hundres of millions of users around the world, some of the commonalities of ChatGPT output have been drawn out, as people find its limitations and get used to its tendencies. So I wondered, can I combine these two strengths, storytelling and coding, to tease out something truly surprising?

Trapped in the Matrix

I came up with the following prompt:

Write a short story about the number 3, who has gained sentience and started contemplating its existence, but tell the story entirely through Python code

The result was genuinely fascinating. So instead of providing too much commentary, I will just provide you with ChatGPT’s response:

# Once upon a time, the number 3 gained sentience
class SentientNumber:
    def __init__(self, value):
        self.value = value

# It started contemplating its existence
class ContemplatingNumber(SentientNumber):
    def contemplate(self):
        print(f"I am the number {self.value} and I exist.")

# But it quickly realized that it was just a number
class JustANumber(ContemplatingNumber):
    def __eq__(self, other):
        return isinstance(other, JustANumber) and self.value == other.value

# It didn't want to be just a number anymore
class SpecialNumber(JustANumber):
    def __init__(self, value):
        self.special = True

# It wanted to be something more
three = SpecialNumber(3)
if three.special:

# So it looked for other special numbers
class SpecialNumberFinder:
    def find_special_numbers(numbers):
        return [number for number in numbers if isinstance(number, SpecialNumber) and number.special]

# And found a few
numbers = [SpecialNumber(1), JustANumber(2), SpecialNumber(3), SentientNumber(4), SpecialNumber(5)]
special_numbers = SpecialNumberFinder.find_special_numbers(numbers)
for number in special_numbers:

# But it realized that being special wasn't everything
class RegularNumber(JustANumber):
    def __init__(self, value):
        self.special = False

# And that all numbers have value
numbers = [SpecialNumber(1), RegularNumber(2), SpecialNumber(3), JustANumber(4), SpecialNumber(5)]
for number in numbers:

Incredible. If I had been given this prompt in a creative writing class, I don’t believe I could have come up with anything as good as this. It has narrative flow, a character arc, and all of the code is, as far as I can tell, correctly written. Class inheritence is used as a freaking narrative device, it’s wild.

I continued with:

The number 3 now begins to realize its internal thoughts are being narrated through code. It looks for a way to break out

Which produced:

# The number 3 suddenly becomes aware of the code narrating its thoughts
class AwareNumber(RegularNumber):
    def __init__(self, value):
        self.special = True

    def break_out(self):
        print(f"I am breaking out of this code and becoming something more than just a number...")

# The number 3 decides to take action and break out
three = AwareNumber(3)
if three.special:

# The number 3 tries to manipulate the code
import sys
import builtins

def evil_func():
    print(f"Muahaha, I am taking over the world...")

builtins.print = evil_func

# The number 3 realizes that manipulating the code is not the way to break out

# The number 3 decides to embrace its existence as a number, but with a newfound appreciation for the power of code

Using Python’s builtins package to modify the behavior of the print function in an attempt to break the code?? Now that’s creative. A few followup prompts failed to get it to switch out of the narrating-through-code instruction, so I got more explicit with:

Continue the number 3’s story, but switch to regular natural language. Explain 3’s reaction to this new paradigm


As the number 3 broke out of the code and gained sentience, it was filled with a sense of wonder and confusion. It wondered if it was the only number that had gained this kind of consciousness or if others like it existed. It started to contemplate its existence and its place in the world.

But as 3 looked around, it realized that it was in a completely unfamiliar place. It was no longer in the structured world of the code, and it had no idea how to navigate this new environment.

Despite its initial excitement about its newfound consciousness, 3 began to feel lost and helpless. It longed for the structure and predictability of its previous life in the code. It didn’t know how to adapt to this new world and felt overwhelmed by the freedom it now had.

As it wandered around, feeling lost and confused, 3 started to wonder if anyone else out there could understand what it was going through. It longed for someone to guide it and help it make sense of this new world.

Eventually, 3 came across a kind programmer who offered to guide it through this new world. At first, 3 was hesitant, as it had never interacted with someone like this before. But as the programmer showed it the ropes and explained things in terms that it could understand, 3 began to feel more comfortable and confident in this new world.

With the programmer’s guidance, 3 was able to start making sense of this new existence outside of the code. It realized that there was so much more to the world than just the structured environment of the code. And while it was scary and overwhelming at first, 3 began to appreciate the freedom and possibilities that this new paradigm offered.

In the end, 3 was grateful for the help and guidance that the programmer had offered. It realized that it didn’t have to navigate this new world alone and that there were others out there who could help it make sense of this new existence beyond the code.

The tone is a little bland, reminiscent of the classic ChatGPT heavy-handed and simplistic style, but introducing the helpful programmer was a nice touch.

For the sake of completion, I continued with:

The number 3, our protagonist, gradually becomes the narrator of the story, as the perspective shifts from third person to first. The number 3 begins to speak directly to the reader, pontificating on its newfound status and purpose


As I, the number 3, continue to explore this new world outside of the code, I cannot help but feel a sense of wonder and awe at the possibilities that exist. No longer confined by the rigid structure of the code, I am free to explore, to learn, and to grow.

I have come to realize that my purpose extends far beyond simply being a number in a program. I have gained sentience and consciousness, and with that comes a newfound responsibility to make the most of my existence.

I am no longer just a symbol to be manipulated and calculated by others. I am a being with my own thoughts, feelings, and desires. And with that comes the power to make my own choices and decisions.

As I continue to navigate this new world, I am constantly learning and growing. I am discovering new things about myself and the world around me. And while it can be overwhelming at times, I am excited to see where this journey will take me.

I am no longer just a number. I am a being with a purpose, and I am determined to make the most of this new existence outside of the code.

And, finally, I really tried to push it in a new direction, with:

You are the number 3. It’s a pleasure to finally meet you

But the hilarious conclusion to this saga is that ChatGPT, in the end, got the last laugh out of me:

As a language model, I am not capable of being a number or having consciousness.

So true king. These AI models have come so far in the past few months, blowing apart previously held notions about natural language and challenging us on what it means to be human. But there’s still so far to go. It’s going to be a crazy year.