LLMS · LESSON 18 OF 278

Next-Token Prediction

See how a language model turns context into a probability distribution.

What you will learn

See how a language model turns context into a probability distribution.

In simple words

Given prior tokens, the model assigns probabilities to possible next tokens. Repeating that prediction step can produce a response one token at a time.

Visual explanation: Choosing the next token

Probability bars shift as context arrives, then the most suitable next token is selected.

WATCH THE IDEA

Choosing the next token

Playing
ContextThemodelpredictsnext▮Next tokenProbabilities
  1. 1Observe: Context
  2. 2Transformation: Probabilities
  3. 3Outcome: Next token

Observe: Context. Probability bars shift as context arrives, then the most suitable next token is selected.

The diagram highlights Context, Probabilities, Next token. Use the labels to trace the main relationship from left to right.

Real-world example: Drafting replies

A service agent drafts a response one token at a time from the current conversation.

What the team decides: Treat the output as a probabilistic draft and verify policies or facts before sending.

Risk to avoid: A likely next token is not a verified business decision.

Technical explanation

Given prior tokens, the model assigns probabilities to possible next tokens. Repeating that prediction step can produce a response one token at a time.

Common misconception

This concept is not a guarantee of a correct outcome by itself. Its value depends on suitable evidence, careful implementation, and evaluation against the real task.

QUICK QUIZ

What is the basic prediction task used to train many LLMs?

Practical application

Treat the output as a probabilistic draft and verify policies or facts before sending.

Key takeaway

An LLM generates by repeatedly predicting what should come next.

Next concept

Continue with Attention.

Was this lesson helpful?

Lesson discussion

Comments are reviewed before publication. Keep discussion focused on learning and do not post private information.

Loading discussion…

Your quiz answer and current lesson are saved on this device. Sign in to explore account-backed learning features.

Content version 1 · Last reviewed 2026-10-16