AlgoPlus//machine learning / language-modeling
Read the theory

Language Modeling

Predict the next token, append it, repeat — the autoregressive loop behind every LLM.

Generated
Picked
Legend
Prompt
Generated
Chosen token
AI Tutor Workspace
In a nutshell
A language model does one thing over and over: given the text so far, it produces a probability for every possible next token — a tiny chunk of text, roughly a word or word-piece — and those probabilities add up to 1. It picks one, appends it, and repeats, so a whole paragraph is just that one prediction run again and again. Training shows it mountains of real text and tunes it to give high probability to the word that actually came next; the better it gets, the lower its perplexity.
Ready
Press play to begin the cinematic walkthrough.
Autocomplete all the way down. Guess the next token, write it, then guess again with your own words added — every essay is just that loop run thousands of times.
Key terms
Go deeper in the lesson
Read the full theory, intuition & complexity for Language Modeling.