LESSON 2 of 6 Beginner

How ChatGPT Actually Works

No jargon, no code. Understand how AI chatbots generate responses, what a 'token' is, and why AI sometimes makes things up.

3 min read 4 quiz questions

The Simple Version

Here’s how ChatGPT works in one sentence: it predicts the next word, over and over, until it finishes a response.

That’s really it. No magic, no consciousness — just very sophisticated word prediction.

How It Learned

Before you ever chatted with it, ChatGPT was trained by reading an enormous amount of text — books, articles, websites, conversations. From all that reading, it learned patterns:

  • How sentences are structured
  • What topics relate to each other
  • How questions are typically answered
  • What different writing styles look like

Think of it as someone who has read millions of books but doesn’t truly understand any of them — they just got really good at sounding like they did.

Tokens: How AI Reads Text

AI doesn’t read words the way you do. It breaks text into small pieces called tokens. A token is roughly one word, but longer words get split into pieces.

For example: “I love artificial intelligence” = about 4 tokens.

Why does this matter? Because AI tools have a context window — a limit on how many tokens they can handle at once. Think of it as the AI’s short-term memory.

Why AI “Hallucinates”

Sometimes AI confidently states things that are completely wrong. This is called hallucination.

It happens because AI is a prediction machine, not a fact-checking machine. If a pattern suggests a certain answer sounds right, it will generate it — whether or not it’s actually true.

Pro tip: Always verify important facts from AI. Treat it like a very helpful but sometimes unreliable colleague.

The Temperature Dial

Most AI tools have a setting called temperature:

  • Low temperature = more predictable, focused answers
  • High temperature = more creative, varied (but sometimes wild) responses

When you ask ChatGPT to be “more creative” or “more precise,” you’re essentially adjusting this dial.

Quick Quiz

Test what you just learned. Pick the best answer for each question.

Q1 How does ChatGPT generate a response?

Q2 What is a 'token' in AI?

Q3 Why does ChatGPT sometimes make things up (hallucinate)?

Q4 What is a 'context window'?