Index Ai Academy
Glossary · Phase 1 · Building with LLMs

Next-token prediction

Also written: next-word prediction

The one task a language model is trained on: guess the next piece of text from everything before it.

Try it now

Watch the text grow by one word per pass. Each pass looks up the options for the last word, keeps the one with the highest probability and adds it to the end. It stops when "<end>" wins.

Learn it properly

What an LLM actually does · Next-token prediction, and why that produces useful behavior. About 25 minutes.

Start this free lesson

Other terms from the same lesson

Never trained an AI?

Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.

Teach it to write