
How does Generative AI work?
I Asked ChatGPT One Simple Question... Then Fell Down the AI Rabbit Hole
Like many people, I've been using AI for months without really understanding what happens after I press Send.
I knew ChatGPT could answer questions, write emails and even create images, but I assumed* there must be a giant database somewhere containing all the answers.
It turns out I was completely wrong.
[*This post was written by ChatGPT following a conversation on this very topic... However I never made that assumption about a giant database, Chat GPT just made that up to create a more entertaining post.]
What followed was one of the most fascinating conversations I've had with an AI, and it changed the way I think about the technology that's rapidly becoming part of our everyday lives.
It doesn't look words up
I started by asking a simple question:
"How many tokens were used in creating this question?"
I'd heard people talk about "tokens" before. Many AI services even limit how many tokens you can use, but I'd never really understood what they were.
The explanation was surprisingly simple.
Before an AI can understand your question, it first breaks it into lots of tiny pieces. These pieces aren't always whole words - common words might stay together, while longer or unusual words can be split into several smaller parts.
Those pieces are then turned into numbers so the computer can work with them. At that point, the AI isn't looking at English any more - it's looking at mathematics.
How does it know that dogs and puppies are related?
This was my next question.
The answer introduced another new idea.
Each piece of a sentence is placed into a huge mathematical space where similar ideas naturally end up close together.
For example:
- Dog
- Puppy
- Bark
- Collar
would all end up relatively close to one another.
Meanwhile:
- Table
- Banana
- Spaceship
would be much further away.
The clever part is that nobody manually tells the AI where to put everything. During training it gradually learns these relationships by reading enormous amounts of text and constantly correcting itself whenever it predicts the wrong next word.
The taxi driver analogy
One of the biggest breakthroughs for me came when I suggested that "transformers" - the technology behind ChatGPT - sounded a bit like taxi drivers.
Imagine every word starts in its normal location.
Then the transformer picks it up and moves it depending on the rest of the sentence.
Take the word "bank."
If the sentence is:
"I deposited money in the bank."
the meaning moves towards finance.
If the sentence says:
"We sat on the bank of the river."
the same word moves towards rivers, grass and water instead.
The word hasn't changed.
Its meaning has.
That simple analogy suddenly made one of AI's most famous buzzwords much easier to understand.
So how does AI create pictures?
Next I asked something completely different.
If I type:
"Create an image of a shark jumping through a snooker table."
where does the picture actually come from?
Surely it has a photograph of a shark stored somewhere?
Again, the answer surprised me.
It doesn't.
The image generator begins with what is essentially television static - complete random noise.
It then gradually improves that random noise over dozens of tiny steps until the picture begins to emerge.
First vague blobs.
Then shapes.
Then fins.
Then a snooker table.
Eventually it reaches an image that matches the description I typed.
It isn't finding a picture.
It's creating one.
Why do AI pictures sometimes have six fingers?
That led to another question.
If AI is so clever, why do people joke about images with six fingers?
The answer is surprisingly logical.
The AI isn't counting fingers.
It's trying to predict what hand-like pixels should look like.
Hands are incredibly complicated.
They bend.
They twist.
They hold things.
They disappear behind objects.
They overlap.
Most of the time the prediction is correct.
Occasionally the tiny errors add up and you end up with an extra finger or a thumb that doesn't quite belong.
Modern image generators have improved dramatically, but hands remain one of the hardest things to draw convincingly.
An experiment with Google
I decided to try something.
I asked ChatGPT:
"I need to boil an egg but don't know how."
Then I asked exactly the same question to Google AI on two different devices.
Finally, a friend asked exactly the same question on her phone.
Four identical questions.
Four different answers.
Not wildly different - they all explained how to boil an egg - but the wording and structure varied.
That makes sense once you realise modern AI isn't simply retrieving an answer from a database.
It's generating a fresh explanation every time.
But then something strange happened...
We repeated the experiment with a different question.
"I think I might be having a heart attack."
This time every answer was effectively identical.
Why?
Because for high-stakes situations like medical emergencies, AI systems are designed very differently.
Instead of producing a creative explanation, they prioritise safety, clarity and consistency.
The underlying AI still understands the question, but the system around it is likely to tightly constrain the response so people receive reliable emergency advice.
My biggest takeaway
Before this conversation, I imagined AI as an incredibly fast search engine.
Now I think of it differently.
It doesn't "know" facts in the way people do.
It doesn't search through a giant filing cabinet looking for the right answer.
Instead, it has learned patterns from huge amounts of information.
Every response is built one tiny piece at a time, guided by mathematics, probabilities and context.
That might sound less impressive than having a giant digital brain.
Oddly, I think it's even more impressive.
The biggest surprise wasn't discovering how AI works.
It was discovering that once somebody explains it in plain English, it's far less mysterious than I ever imagined.
And, if I'm honest, far more fascinating.