Stop Calling it “Magic”: How AI Actually Understands Language Through Geometry
Moving beyond the black box — understanding the math that powers LLMs.
Stop Calling it “Magic”: How AI Actually Understands Language Through Geometry
Moving beyond the black box — understanding the math that powers LLMs.
Let’s get this out of the way:
AI is not magic.
I know it feels like magic when you type something into ChatGPT and it replies like a slightly overconfident intern who somehow knows everything.
But under the hood? It’s doing math.
Weird, high-dimensional, slightly mind-bending math — but still just math.
There’s this famous example:
King − Man + Woman ≈ Queen
The first time I saw this, I had two reactions:
- “That’s insane.”
- “Okay… what kind of magic is this?”
Spoiler: no magic.
Just geometry.
The Problem with Words
Computers don’t understand words. At all.
To us, “king” carries meaning, history, imagery.
To a machine? It’s basically:
010101010101
No meaning. No context. No vibe.
So if we want machines to “understand” language, we have to translate words into something they can work with.
Numbers.
Turning Words into Coordinates
Instead of treating words as symbols, we turn them into vectors.
Think of it like this:
- “King” → a list of numbers
- “Queen” → another list of numbers
- “Apple” → a completely different list
Each word becomes a point in a massive space (often 1,000+ dimensions).
Yeah… not something you can draw on paper.
A Simpler Mental Model
Let’s shrink it down to something we can visualize.
Imagine a 2D graph:
- X-axis → Age
- Y-axis → Gender
Now plot a few words:
- Man → (Adult, Male)
- Boy → (Young, Male)
- Woman → (Adult, Female)
- Girl → (Young, Female)
Suddenly:
- Man → Boy = move along the Age axis
- Man → Woman = move along the Gender axis
That “King − Man + Woman” thing?
It’s basically doing this kind of movement — but in a space with hundreds of hidden features.
[embed]
So How Does the Model Learn This?
This is where things get interesting.
There’s a concept called the Distributional Hypothesis:
“You shall know a word by the company it keeps.”
In plain English:
If two words appear in similar contexts, they probably mean similar things.
For example:
- “Doctor” and “Nurse” often show up in similar sentences
- “King” and “Queen” appear in similar contexts
- “Apple” shows up with… fruit, tech, or lunch
Over time, the model learns:
- Which words hang out together
- Which words don’t
- Which words are subtly different
And it builds a map of meaning.

What’s Actually Happening Under the Hood
When you type a sentence into an LLM:
- It converts your words into vectors
- It processes them through layers (transformers, attention, etc.)
- It predicts the next word based on patterns
But the key part is this:
It’s not reasoning in English.
It’s operating in vector space.
Why Developers Should Care (This Is Where It Gets Practical)
If you’re building anything with:
- RAG (Retrieval-Augmented Generation)
- AI agents
- Semantic search
- Recommendation systems
Then this is not optional knowledge.
Because you’re not doing: Keyword matching but Geometry over meaning
When you query a vector database, you’re basically asking:
“Which stored vectors are closest to this one?”
And “closest” is usually measured using: Cosine similarity
- Small angle → similar meaning
- Big angle → unrelated
So when your RAG system “finds relevant documents,” it’s not reading them.
It’s comparing angles between ideas.

The Part That I Personally Find Wild
There’s a concept in neuroscience called population coding.
Instead of one neuron representing one idea, meaning is distributed across many neurons. That’s basically what embeddings are doing.
Not saying LLMs are brains.
So What’s the Big Takeaway?
Once you understand embeddings, a lot of things click:
- Why RAG sometimes fails (bad embeddings or poor similarity search)
- Why prompt wording matters (you’re nudging position in vector space)
- Why synonyms work surprisingly well
- Why completely unrelated queries fail hard
You stop thinking in terms of:
“What words should I use?”
And start thinking:
“What concept am I trying to land near?”
Jokes Apart… A Few Things Worth Knowing
Before this turns into “AI = magic geometry”, let me level with you for a second.
This isn’t really “understanding”
We say models “understand” language… but that’s not quite true.
They’re not aware. They don’t have intent.
They’re just extremely good at picking up patterns in language — trained on massive amounts of text. That’s it.
Words don’t have fixed meanings inside these models
That famous:
King − Man + Woman ≈ Queen
…comes from older models.
Today’s systems work differently. The meaning of a word changes based on context.
So “king” in:
- “The king ruled the empire”
- “He’s the king of pop”
…won’t be treated the same way.
Same word. Slightly different meaning. Different position.
“It’s just math”… but also not just math Yes, under the hood, it’s math.
But saying that is like saying:
“A plane flies because of physics.”
True… but that’s not the whole story.
What’s actually impressive is the scale:
- Huge models
- Trained on massive data
- Smart architectures like transformers
The math is the base. The engineering is what makes it crazy.
Cosine similarity is just one way to measure things
I used cosine similarity because it’s easy to imagine (angles and all that).
But in real systems, there are other ways too — dot product, distance metrics, and so on.
Different methods, same idea:
Find what’s closest in meaning.
Why this still matters
Even with all that said, the main idea doesn’t change.
You’re not really working with words anymore.
You’re working with meaning in space.
And once that clicks, you start building things differently. Better prompts. Better RAG systems. Better AI overall.
메타데이터
- post_id
- f3f9dad92cd5
- slug
- stop-calling-it-magic-how-ai-actually-understands-language-through-geometry-f3f9dad92cd5
- url
- https://medium.com/@rb96/stop-calling-it-magic-how-ai-actually-understands-language-through-geometry-f3f9dad92cd5
- canonical_url
- https://medium.com/@rb96/stop-calling-it-magic-how-ai-actually-understands-language-through-geometry-f3f9dad92cd5
- author_url
- https://medium.com/@rb96
- status
- ok
- fetched_at
- 2026-06-09 18:04:40