Explain to me how ChatGPT works underneath like I'm 65.
- User
Explain to me how ChatGPT works underneath like I'm 65.
- Assistant
Here’s a plain-language tour of what’s happening “under the hood” when you chat with ChatGPT. Think of it like walking through a very large, very fast library staffed by an eager—but literal-minded—librarian.
- First, the modellearned a giant vocabulary
Reading the library.During training, engineers let the system read billions of pages from books, websites, newspapers, Wikipedia, and more. As it read, it chopped every sentence into tiny pieces calledtokens(roughly words or word-fragments) and counted how often each piece tends to follow another.zapier.comhelp.openai.com
Building a mental map.From those counts it constructed a huge “probability map” that says, “After the tokenrainthe tokencoatis fairly likely; afterquantumthe tokenphysicsis very likely,” and so on. Every nook of that map lives as numbers inside a neural network withbillionsof adjustable knobs (called parameters).aws.amazon.com
Reading the library.During training, engineers let the system read billions of pages from books, websites, newspapers, Wikipedia, and more. As it read, it chopped every sentence into tiny pieces calledtokens(roughly words or word-fragments) and counted how often each piece tends to follow another.zapier.comhelp.openai.com
Building a mental map.From those counts it constructed a huge “probability map” that says, “After the tokenrainthe tokencoatis fairly likely; afterquantumthe tokenphysicsis very likely,” and so on. Every nook of that map lives as numbers inside a neural network withbillionsof adjustable knobs (called parameters).aws.amazon.com
- TheTransformer: ChatGPT’s special reading lamp
Traditional neural networks struggled with long sentences. (invented in 2017) added an “attention” mechanism—like a reading lamp that lets the model glance back at any earlier word, no matter how far away, whenever it decides that word might matter. This lets it track meaning over paragraphs, not just a few words.truefoundry.comibm.com
3.Fine-tuningfor manners and safety
After the broad reading phase, OpenAI showed the model thousands of example conversations that illustratehelpful, harmless, and honestreplies. Human reviewers scored sample answers; a second training pass (calledreinforcement learning from human feedback, RLHF) nudged the knobs so replies that humans liked became more likely next time. Think of it as a charm-school layer on top of raw knowledge.help.openai.com
- What happens whenyouask a question?
Your prompt becomes tokens.“Explain photosynthesis” turns into a numbered list of tokens.
The model looks left to right.Starting with the prompt and an internal “conversation memory” (just what’s on screen), it uses the Transformer’s attention to weigh which previous words matter most at this moment.
One token at a time.It calculates the probabilities for every possible next token (there are about 100 000 choices). Higher-probability options rise to the top.