What Is an LLM?
Understand how language models generate text, how training differs from inference, and what an AI application adds.
Try it before reading further
A likely continuation is not a verified fact · 5 minOn this page
A large language model (LLM) is a model trained on large amounts of language data. It can help draft, summarize and work with text. This lesson focuses on a common text-generation mechanism: predicting the next token.
Watch a reply grow
Start with The capital of France is. A causal language model scores possible next tokens using the available context. A decoding step chooses a token, adds it to the text, and repeats. This is autoregressive generation. The model does not need to reprocess every earlier token from scratch; implementations can reuse cached computations.
Try it: Open the daily short lessons and choose “Build a continuation one step at a time.” The experiment uses handcrafted choices to show the loop, not a real model's probabilities.
Training and answering are different
Training adjusts a model's numerical parameters using data. During ordinary inference, it uses those parameters and the current context to produce an output. Adding a correction to the conversation changes the context; it does not by itself update the model's parameters.
Next-token prediction is a common pretraining objective for generative models, not the complete training recipe for every LLM. Further training can shape instruction-following behavior. Other language models use objectives such as predicting masked text. See base and instruction-tuned models.
A model and an AI product are different
| What you see | What may make it possible |
|---|---|
| A reply uses an earlier message | Conversation context |
| An answer includes retrieved documents | Retrieval or search tools connected to the model |
| An assistant remembers a preference | Stored application memory brought into context |
| A task starts with an outline | A generated planning step or a multi-step workflow |
Tools, memory and workflow choices depend on the product. “Generates tokens” does not mean “cannot search or plan.”
Check understanding
A fluent answer contains a precise date. Is the date verified?
No. A plausible continuation can still be wrong. Check the relevant source; token likelihood is not a truth score. Explore hallucination for examples.
Remember: separate how text is generated, how a model was trained, and what the application adds.
Read further
- Hugging Face: causal language modeling
- Hugging Face: training and Transformer architectures
- Anthropic: models with retrieval, tools and memory
Next: What is an embedding?