- Developer Data
- Posts
- What actually happens when you type into ChatGPT.
What actually happens when you type into ChatGPT.
Hey,
You use ChatGPT every day.
But if someone asked you to explain how it actually works, could you?
A few weeks ago, I couldn't. And honestly, that bothered me. I'm a developer. I don't like using tools I can't explain.
So I went and learned it properly. Then I made a video breaking it down into 3 layers - simply, no fluff.
Here's the short version.
Layer 1: Deep Learning
Old computers followed rules. A programmer wrote: if user types X, return Y. Clean, predictable — but completely rigid.
Language doesn't work that way. "I'm fine" can mean happy. Or the complete opposite.
So AI takes a different approach entirely. It doesn't follow rules. It learns from examples. Millions of them. Show it enough sentences, and patterns emerge on their own — like a child learning to speak before they ever learn grammar.
That's deep learning.
Layer 2: The Transformer
Even with deep learning, early models had a problem. They read sentences word by word, left to right. By the end of a long sentence, they'd almost forgotten the beginning.
In 2017, researchers at Google asked: what if the model could read everything at once? What if every word could ask — which other words in this sentence actually matter to me right now?
That idea became a paper called Attention Is All You Need. It's been cited over 170,000 times. One of the ten most cited papers of the 21st century.
And it gave birth to the Transformer.
GPT. Generative. Pre-trained. Transformer. The name tells you exactly what it is.
Layer 3: ChatGPT
Understanding language is one thing. Being helpful is another.
After training GPT on massive amounts of text, OpenAI brought in human trainers to rate responses. Helpful. Harmful. Makes no sense. The model learned from those ratings.
That process — RLHF, Reinforcement Learning from Human Feedback — is what turned a language model into a useful assistant.
One more thing worth knowing: ChatGPT doesn't look up facts. It predicts what word comes next, based on everything it learned. When it's right, it seems intelligent. When it's wrong, it sounds completely confident anyway. That's why it hallucinates.
Not because it's broken. Because it's always predicting — never looking up.
The moment you hit send
Your message → broken into tokens → each token becomes a number → transformer runs attention across all tokens → model predicts the next word → then the next → until the response is complete.
No magic. No consciousness. No internet lookup.
Just patterns. Attention. Prediction.
I made a full video walking through all of this with visuals. If you want to actually see the pipeline, and be able to explain it to someone else after, it's worth 9 minutes.
And if you're not subscribed to this newsletter yet — this is what every issue looks like. One concept, simply explained, from a developer actually learning it.
👉 Subscribe at developer-data.beehiiv.com
See you in the next one.
— Rajon