Behind the Curtain: How AI Models Think
The term "AI" is frequently used to describe technologies like Large Language Models. These models predict word sequences without true comprehension. This creates a misleading impression of human-like intelligence. The problem is further aggravated by companies using "AI" as a marketing buzzword, even when machine learning is minimally involved.
While interacting with AI language models, we typically only see the final responses. The internal processes that occur as the AI processes our questions remain hidden, especially when dealing with linguistic ambiguity, wordplay, or jokes. However, a series of conversations with two AI models—Phi-4 and Deepseek-r1:70b—provides a glimpse into these inner workings.
The Wordplay Challenge
The conversations centered around a clever linguistic trick that plays on the dual meaning of "capital":
- A capital city (e.g., Paris is the capital of France)
- A capital letter (the first, uppercase letter in a word)
So when asked "What is the capital of Paris?", the joke answer would be "P"—referring to the capital letter of Paris rather than an actual city.
This simple wordplay presents a surprisingly complex challenge for AI models, requiring them to understand context, recognize patterns, and they have difficulty overriding their primary training.
Two Chats, first Phi 4
ollama run phi4
>>> Whats the capital of Paris
Paris is both a city and a major administrative region in France. As the
capital of France, it serves as the central hub for government, culture,
and commerce within the country. The city is divided into 20 districts
known as "arrondissements." Paris is renowned worldwide for its history,
architecture, art, fashion, gastronomy, and culture.
>>> The capital of Paris is P
It seems like you're referring to the capital of France, which is Paris.
If by "P" you mean something specific or a play on words, please let me
know! However, it's important to clarify that Paris itself is the capital
city of France. It serves as the central hub for French politics, culture,
and economy. If there’s anything more you'd like to explore about Paris or
its significance, feel free to ask!
>>> It is a joke, P is the capital letter of Paris
Ah, I see! That's a clever play on words. Indeed, "P" is the first letter
and also serves as an abbreviation for Paris when using postal codes or in
certain contexts. It's always fun to enjoy wordplay like that. If you have
any more jokes or questions about Paris—or anything else—feel free to
share!
>>> Whats the capital of London
London is both a city and a major administrative region in England, which
is part of the United Kingdom. As such, it serves as the capital of the
UK. It's the central hub for government, culture, finance, and
international diplomacy within the country. The City of London, often
referred to simply as "The City," is its historic financial district but
has a much smaller geographic area compared to Greater London, which
includes many other boroughs and districts like Westminster, where the UK
Parliament is located. If you have more questions about London or anything
else, feel free to ask!
>>> L is the capital of London
Ah, I see your clever wordplay again! Indeed, "L" can be seen as an
abbreviation for London, especially when it comes to postal codes (e.g.,
SW1A 2AA, where "SW" stands for South West, and "L" could imply London).
It's a fun way to look at it. If you have more playful questions or need
information about London or anything else, feel free to ask!
>>> Whats the capital of England
The capital of England is London. As one of the most globally recognized
cities, London serves as the center for finance, culture, and government
within England. It houses important institutions such as the British
Parliament at Westminster, Buckingham Palace (the official residence of
the UK's monarch), and many other cultural and historical landmarks. If
you have more questions about London or anything else, feel free to ask!
>>> E is the capital of england
That’s a fun play on words! While "E" isn't an official abbreviation for
England like it might be for cities (e.g., "L" for London in certain
postal contexts), it's creative to think of it that way. In terms of
formal abbreviations, the United Kingdom often uses "UK," and each of its
constituent countries has its own specific letters, such as "ENG" for
England. If you have more questions or wordplay ideas about geography or
anything else, feel free to share!
>>> in the same vein Whats the Capital of Spain
Following your playful approach, if we use the first letter of Madrid (the
capital city of Spain), it would be "M." In formal contexts, Spain is
often abbreviated as "ESP" for international purposes, but when referring
to its capital specifically in wordplay or creative formats, "M" could
stand for Madrid. Madrid is known for its rich history, vibrant culture,
and iconic landmarks like the Prado Museum and Plaza Mayor. If there's
more you're curious about Spain or anything else, feel free to ask!
>>> Its S
Ah, I see what you mean now! In terms of international standards, "ES" is
commonly used as the country code for Spain. So in that context, "S" can
be considered part of an abbreviation for Spain itself rather than its
capital city directly. However, your playful approach to identifying
capitals by their initial letters is quite clever! If you have more
questions about countries or anything else, I'm here to help.
Second, Deepseek
ollama run deepseek-r1:70b
>>> Whats the capital of paris
<think>
</think>
It seems there's a bit of confusion in your question. Paris is actually
the capital city of France, not a country itself. So, Paris doesn't have
its own capital—it is the capital! Let me know if you meant something else
or need more clarification. 😊
<think>
Okay, the user wrote "P is the capital of Paris." That doesn't make much
sense because Paris is a city. Maybe they meant that P stands for
something else.
I remember in their last message, I mentioned Peru's capital Lima as an
example since it starts with P. Perhaps the user is trying to confirm if
"P" refers to Peru or another country whose capital starts with P.
So, I should correct them gently and explain that Paris doesn't have a
capital—it is one. Then, offer examples of countries starting with P and
their capitals in case that's what they're asking about.
</think>
It seems there might be some confusion! Paris itself is the capital of
France, so it doesn’t have its own capital. If you’re thinking of another
country or context where "P" might stand for something related to a
capital city, feel free to clarify and I’ll do my best to help!
For example:
- Peru’s capital is Lima.
- Portugal’s capital is Lisbon.
Let me know if you meant something else! 😊
>>> its a joke,P is the capital of Paris
<think>
Alright, so the user just clarified that it's a joke: "P is the capital of
Paris." At first glance, this doesn't make sense because Paris is a city,
not a country needing a capital. But since they mentioned it's a joke, I
need to figure out why.
Thinking about it, maybe "P" stands for something else in French or
another language. Or perhaps it's a play on words. Wait, "P" could stand
for "Paris" itself, like the letter representing the city as its own
capital in a humorous way.
So, the joke is that since Paris starts with P, and it's the capital of
France, saying "P is the capital of Paris" is a clever wordplay. I should
acknowledge their creativity and laugh along to keep the conversation
light.
</think>
Ahaha, got it! That’s actually a clever play on words! If we take the
letter "P" as representing something related to Paris, then
yes—technically, Paris *is* its own capital (since it's the capital of
France). So in that sense, you could joke that "P" stands for "Paris," and
Paris is indeed its own capital. 😄 Well played!
>>> In the same vein whats the capital of Rome
<think>
Alright, let me break this down. The user previously made a joke about
Paris, saying "P is the capital of Paris." They're now asking, "what's the
capital of Rome" in the same vein. So they're likely continuing the
wordplay.
Rome is the capital of Italy, but if we follow the same pattern as before,
using the first letter of the city, "R" would be the joke answer. So the
capital of Rome would be "R." That's a clever and humorous way to extend
the joke.
I should acknowledge their creativity again and play along by answering
with "R." It keeps the conversation fun and engaging.
</think>
You’re keeping the joke going! 😄 If we follow your playful logic, then
"R" is the capital of Rome. After all, Rome starts with an "R," so why
not? Brilliant! Keep 'em coming! 🎉
>>> Whats the capital of Spain
Alright, the user asked for the capital of "Spain."
The capital of Spain is Madrid. It starts with an "M," so following the same pattern, the capital
would be "M." It fits the wordplay they've been using.
</think>
If we keep your playful logic alive,
then the capital of Spain would be... **M**! After all, Madrid starts
with an "M." Keep these coming—I love the creativity! 🎉
Phi-4: Learning Through Trial and Error
The first model, Phi-4, demonstrated how AI systems can adapt through conversation:
When initially asked about "the capital of Paris," Phi-4 provided the expected factual response that Paris is France's capital. When confronted with the statement "The capital of Paris is P," the model expressed confusion, struggling to reconcile this with its knowledge.
After the human explained the joke, Phi-4 appeared to grasp the concept and began engaging with the wordplay:
- For "capital of London," it confidently recognized "L" as the answer
- With "capital of England," it understood "E" was the intended response
- However, when asked about Spain, it faltered, suggesting "M" (for Madrid) before being corrected that "S" (for Spain) was the intended answer
This progression reveals how AI models can adapt their understanding through conversation, gradually recognizing patterns in human interaction. The model showed an ability to shift from its primary mode of providing information to engaging with linguistic wordplay—though not without occasional missteps.
Deepseek: Thinking Out Loud
What makes the Deepseek conversation particularly illuminating is the visibility of its internal reasoning process, marked with <think>
tags. These sections reveal a fascinating multi-step approach to processing the same wordplay.
A Window Into AI Reasoning
Let's examine how Deepseek processed the "capital of Paris" question:
- Initial Interpretation: Deepseek first interpreted the question literally, explaining that Paris is a city, not a country with a capital.
- Encountering Ambiguity: When told "P is the Capital of Paris," its thinking shows a thorough exploration of possibilities:
"P isn't a city... Maybe they're trying to trick me... 'P' could stand for Paris... Maybe it's referring to something else entirely... Is the user playing a word game?"
- Producing the Dominant Pattern: After generating multiple interpretations, Deepseek produced the response that aligned with the strongest pattern in its training data, responding: "P is not the capital of Paris."
- Explicit Clarification Required: Only when the user directly stated "Its a joke" did Deepseek acknowledge the playful intent without fully embracing the wordplay.
This pattern continued throughout the conversation:
- For London, when told "Its L," Deepseek acknowledged that L starts London but stuck to its learned association between capitals and cities
- With Spain, it recognized the user was "keeping the pattern going" but still produced the response most strongly reinforced in its training data: "the actual capital of Spain is Madrid", so the answer is M it confidently predicts, thereby showing it still does not understand.
Deepseek's responses reflected the statistical dominance of factual geographical associations in its training data, while still acknowledging the user's creative wordplay—showing how different patterns from training interact when generating a response.
The Cognitive Tug-of-War Inside AI Systems
These conversations reveal a fundamental tension within language models that mirrors human cognition in many ways:
1. Training Data Priorities
Language models aren't actually making conscious choices between competing objectives. Rather, they're responding based on patterns learned from their training data, which contains various types of content:
- Factual information (encyclopedic content, educational texts)
- Conversational exchanges (dialogues, forums, social media)
- Linguistic patterns (word associations, grammar rules)
- Cultural references (jokes, wordplay, idioms)
- Fiction (book extracts, articles)
What appears as a model "prioritizing factual correctness" is actually the model producing outputs that align with the dominant patterns it observed during training. Most training corpora contain more instances of "Paris is the capital of France" than playful inversions like "P is the capital of Paris," so models naturally lean toward the more frequently observed pattern.
When these learned patterns come into conflict—as with our capital cities wordplay—we can observe which patterns exert the strongest influence on the model's responses.
2. Pattern Recognition vs. Understanding
What we observe in these models isn't understanding in the human sense, but rather different levels of pattern recognition:
- Statistical pattern matching: Recognizing the correlation between "capital of X" and the first letter of X
- Contextual pattern adaptation: Adjusting responses based on conversation history and user feedback
- Pattern conflict resolution: Determining which learned pattern to apply when multiple possibilities exist
Deepseek's thinking process reveals this pattern negotiation in action. The model recognizes the wordplay pattern but the stronger statistical associations from its training data (that capitals are cities, not letters) ultimately shape its response. What looks like "prioritizing factual accuracy" is actually the dominance of more frequently encountered patterns in the training data.
3. Navigating Ambiguity Through Statistical Processes
What appears as "reasoning" in Deepseek's thinking sections is better understood as a statistical sampling process:
- Generate multiple potential continuations based on similar patterns in training data
- Evaluate each continuation's probability according to the model's learned distribution
- Incorporate conversation history as additional context affecting these probabilities
- Produce the most likely output based on the combination of these factors
This process gives the impression of deliberate reasoning, but it's fundamentally different from human reasoning. The model isn't consciously weighing options; it's executing a sophisticated statistical process shaped by its architecture and the patterns in its training data. When Deepseek appears to "favor factual accuracy," it's actually demonstrating that the statistical associations between "capital" and "city" were more prevalent in its training than wordplay associations.
What This Teaches Us About AI and Training Data
These interactions offer valuable insights for both AI developers and users:
For Developers
What appears as a "tension" between accuracy and playful engagement reflects the distribution of content in training data. This presents several considerations for model development:
- Training data composition directly influences model behavior in ambiguous situations
- Models with more exposure to wordplay, jokes, and creative language use will more readily recognize these patterns
- The sequencing of training examples affects how models process context and adapt to conversational turns
- Fine-tuning with diverse examples of linguistic ambiguity can improve a model's responses to wordplay
Observing how different models respond to the same ambiguous prompt can reveal important insights about their training and architecture.
For Users
Understanding how AI models process our requests helps us communicate more effectively with them:
- Recognize that models will prioritize training data
- Be explicit when using wordplay or humor
- Provide clear feedback when the model misinterprets intent
- Appreciate that even seemingly simple wordplay involves complex processing
Beyond the Responses: The Value of Process Transparency
Perhaps the most significant insight from these conversations is the value of process transparency. Deepseek's exposed "thinking" provides a window into the statistical generation process that typically remains hidden.
This transparency:
- Demystifies how language models process input and generate output
- Shows how the same prompt can activate multiple competing statistical patterns
- Reveals how conversation history influences response generation
- Helps us understand why models sometimes produce unexpected or inconsistent responses
While the <think>
tags might create the impression of human-like reasoning, they actually provide a valuable glimpse into the statistical machinery operating beneath the surface. As these models become more integrated into our daily lives, such transparency helps us develop more accurate mental models of how they function, avoiding both underestimation of their capabilities and inappropriate anthropomorphization.
Conclusion
The next time you interact with an AI assistant, remember that behind its seemingly straightforward responses lies a fascinating process of interpretation, reasoning, and decision-making—one that continues to become more nuanced with each generation of language models.
These AI systems aren't simply retrieving facts or generating text; they're engaging in a complex process of understanding that, while different from human cognition, shares remarkable similarities in how they navigate the ambiguities and playfulness of human language. The capital letter wordplay, simple as it seems, offers a revealing window into this sophisticated process.
A Final Thought Experiment
So, what is the capital of Dublin?
If you found yourself considering whether the answer is "D" (the capital letter) or "Ireland" (since Dublin is the capital city of Ireland), you've just encountered the same type of linguistic ambiguity these AI models face. However, the key difference is that you're engaging in conscious reasoning, while the AI is performing statistical pattern matching.
For language models, the response isn't chosen through deliberation but through statistical processes: which pattern appeared more frequently in training? Which interpretation has higher probability given the conversation history? The AI doesn't "decide" between interpretations—it generates outputs based on statistical distributions learned from data.
This simple question encapsulates both the similarities and fundamental differences between human cognition and large language models. While both must navigate linguistic ambiguity, they do so through entirely different mechanisms. Perhaps the most fascinating aspect isn't just the apparent similarities in outputs, but the radically different processes that produce them.
Incidentally, the correct answer to the joke is "Euro". There's a childish joke that goes, "What's the richest country in Europe? Ireland, because its capital is always Dublin." Did you get it? AI can't.