Skip to content

How Does ChatGPT Actually Work

Covers Tokens: The Building Blocks, Prediction: The Next-Word Game, Training as Compression and Learning and more.

Lessons4 lessons
Media

1 · Tokens: The Building Blocks

Quiz
Final assessmentAfter the last lesson, for your diploma
About

“How Does ChatGPT Actually Work” is a 4-lesson course at Teen level, created with soclever, a personal AI teacher. Each lesson takes a few minutes and ends with a check-in question; finish the curriculum and you can take a certificate test to earn a diploma. Try the first lesson without an account — or make your own course on any topic.

What you'll learn

  1. Tokens: The Building Blocks. You type "What's the weather?" into ChatGPT. Before it can answer, it has to break your question into pieces it can actually work with. Those pieces are called tokens.
  2. Prediction: The Next-Word Game. You type "The capital of France is" and ChatGPT immediately outputs "Paris." But it didn't look anything up. It didn't consult a database or understand geography the way you do.
  3. Training as Compression and Learning. Back in 2017, researchers at Google noticed something odd: when they fed neural networks huge amounts of text, the networks weren't just memorizing sentences word-for-word.
  4. Putting It All Together End-to-End. ChatGPT works by turning your words into numbers, then repeatedly guessing the next number based on patterns it learned during training.

Lesson 1: Tokens: The Building Blocks

You type "What's the weather?" into ChatGPT. Before it can answer, it has to break your question into pieces it can actually work with. Those pieces are called tokens.

A token is roughly a word, but not exactly. A common word is often a single token; rarer or longer words split into several pieces, and spaces and punctuation are part of tokens too. Exactly how text splits depends on the model. ChatGPT doesn't think in words the way you do—it thinks in these numbered chunks.

Why does this matter? Three practical reasons. First, tokens are how ChatGPT measures length. When you hit a limit on how long a response can be, you're hitting a token limit, not a word limit. Second, longer words or rare words use more tokens, which affects cost if you're paying per token. Third, understanding tokens helps you see why ChatGPT sometimes fumbles on things that seem simple to humans—it's working with statistical patterns across tokens, not meanings.

Here's the concrete payoff: if you're trying to fit a lot of information into one message, you're really trying to fit it into a token budget. Knowing that a rare word like "tokenization" usually costs more tokens than a common word like "the" won't change your life, but knowing that tokens exist and that ChatGPT counts them changes how you understand what's actually happening inside the system.

Questions this course answers

What is a token?

A token is roughly a word, but not exactly, where a common word is often a single token and rarer or longer words split into several pieces.

How does ChatGPT generate a response?

It is playing a probability-based guessing game where it sees the pattern of words, calculates the statistical probability of what comes next, and outputs the word it predicts is most likely to follow.

What happens to the model's weights during training?

It reads through billions of words from the internet, and each time it tries to predict the next word, it adjusts its weights a tiny bit.

More courses to explore

Or browse all public courses.