LLM Library
FoundationsAnimated
What is a Large Language Model?
A neural network trained to predict the next piece of text.
The idea
An LLM reads a sequence of tokens and outputs a probability for every possible next token. Trained on huge amounts of text, predicting the next token well forces it to learn grammar, facts and patterns of reasoning.
Watch it work
Press play, pause, or step through. Some animations have settings you can change.
- candidates kept
- chosen
The model produces a raw score (logit) for every word in its vocabulary. Only eight are shown here.
1/4
Temperature reshapes the probabilities; top-k and top-p cut the tail.
Step by step
- 1Text is split into tokens
- 2The model scores every possible next token
- 3One token is chosen and appended
- 4The process repeats to build a whole answer
Where it is used
Chat assistants, coding tools, search, translation, summarising.
Watch out for
It predicts plausible text, not guaranteed truth, so it can be confidently wrong.