Free sample lesson ยท AI Foundations

Inside ChatGPT

How do AI chatbots like ChatGPT work?

Lesson 1 of the Wondering course AI Foundations

The Lyrics Sheet Mystery

Imagine finding a lyric sheet for a song, but half the lyrics have been torn away.

How would you complete it?

You'd need to predict what comes next, word by word, based on what you already have.

This is exactly how chatbots like ChatGPT work.

The Prediction Machine

Think of chatbots as powerful prediction machines. You feed them incomplete text, and they guess what word should come next.

Diagram Version 1

It's not magic or thinking. It's pattern recognition on a massive scale.

The AI has learned from billions of conversations what words typically follow others in similar contexts.

Prediction through patterns

See how incomplete text is matched against learned patterns to select a likely next word.

Word by Word Creation

But how does this prediction machine generate responses?

Click the button to see how it works:

It's iterative autocomplete, not instant comprehension.

Chatbots build responses one word at a time based on all the words that have come before.

Diagram Version 2

First, they predict the opening word. Then they add that word to the conversation and predict the _next_ word.

They repeat this process over and over until they've constructed a complete response.

Building a response one word at a time
  • Start: The chatbot predicts the opening word.
  • Add: It adds that word to the conversation.
  • Predict: It predicts the next word using all the words that have come before.
  • Repeat: It repeats the process until it has constructed a complete response.

Not Really "Thinking"

When you chat with an AI, it's not sitting there pondering your question like a human would.

Diagram Version 3 Improved

There's no internal voice saying, "Hmm, what should I say?"

Instead, it's running a sophisticated text completion algorithm that predicts probable next words based on patterns it learned during training.

Pondering versus text completion
  • Human pondering
  • Text completion

Check yourself

Does ChatGPT generate a response by predicting likely words from learned patterns?

  • Predicts likely words from learned patterns
  • Thinks through the answer like a person

Answer: Predicts likely words from learned patterns

ChatGPT predicts text from patterns in the words it has received. It does not understand the text in the same way a human does.

ChatGPT uses _____ to identify likely word sequences, rather than actual _____.

Answer: ChatGPT uses pattern recognition to identify likely word sequences, rather than actual comprehension.

Pattern recognition means finding regularities in data. Comprehension means understanding meaning, which the description says ChatGPT does not actually have.

Why can ChatGPT produce a response that seems relevant even though it is not thinking like a human?

  • It recognizes patterns in large amounts of learned text.
  • It has a human-like inner voice that understands every answer.
  • It selects every response from a fixed list of stored sentences.
  • It waits for a person to write each word for it.

Answer: It recognizes patterns in large amounts of learned text.

ChatGPT can produce a relevant-sounding continuation because it has learned patterns from very large amounts of text. This does not mean it is consciously thinking or understanding the meaning.

Keep going

This is lesson 1 of 36 in AI Foundations. Next up:

  1. How Prompts Work
  2. Probability & Randomness
  3. Temperature
  4. Training Data Scale
  5. Generalization

Start this course free

Wondering turns any topic into short lessons you can read, watch, or listen to, with practice questions and an AI tutor.