# Next Token Prediction

- **Canonical URL:** https://getaimath.com/dictionary/next-token-prediction/
- **Topics:** [LLM Fundamentals](https://getaimath.com/dictionary/category/llm-fundamentals/)
- **Last updated:** 2026-11-25

## What is Next Token Prediction?

**In one sentence:** Next token prediction is the simple training game behind LLMs: look at some text and guess which token comes next.

The model sees "The capital of France is" and tries to guess "Paris." If it is wrong, it adjusts. By doing this trillions of times on all kinds of text, it picks up grammar, facts, reasoning patterns and writing styles, all from this one guessing game.

![How ChatGPT & Claude Talk: Super-Powered Autocomplete — Simple cartoon diagram showing a sentence chopped into Lego word blocks (tokens), an AI brain weighing the odds of the next word ("mat" 75%, "couch" 18%, "roof" 5%), and snapping "mat" onto the end of the sentence.](https://getaimath.com/diagrams/llm-fundamentals.png)
*Napkin Diagram (LLM Fundamentals): Language models don’t plan whole essays at once—they play a super-smart game of "guess the very next word" over and over.*

## What is an example of Next Token Prediction?

Your phone suggesting the next word while you text is a tiny version of next token prediction.

## Why does Next Token Prediction matter?

This one idea is the foundation of how large language models learn and how they write.

## Related Concepts

- [Masked Language Model](https://getaimath.com/dictionary/masked-language-model/): A masked language model learns by filling in blanks: some words in a sentence are hidden and the model guesses them using words on both sides.
- [Token](https://getaimath.com/dictionary/token/): A token is a small chunk of text, like a word or part of a word, that a language model reads and writes.
- [Causal Language Model](https://getaimath.com/dictionary/causal-language-model/): A causal language model predicts the next word using only the words that came before it, never the ones after.
- [Tokenizer](https://getaimath.com/dictionary/tokenizer/): A tokenizer is the tool that chops text into tokens and turns each token into a number the model can use.
- [Autoregressive Model](https://getaimath.com/dictionary/autoregressive-model/): An autoregressive model creates output one piece at a time, using everything it has created so far to choose the next piece.
- [Vocabulary](https://getaimath.com/dictionary/vocabulary/): A model's vocabulary is the complete list of tokens it knows, each with its own ID number.

---
Source: The AI Math Dictionary (https://getaimath.com/dictionary/next-token-prediction/)
