What Is an LLM? The Facts Agent Users Need
Understand language models, tokens and context, with a worked Transformer and BERT example. Separate model behavior from the application around it.
Updated · Markdown version
A large language model is a statistical model with very many learned parameters that estimates probabilities of text tokens or token sequences from context. Text generation, question answering and summarization are common applications, rather than requirements shared by every language-modeling design.
For the short definition, see large language model. This guide explains what that distinction means when you use an assistant or coding agent.
The model and the application do different work
A text-generating model supplies a response. The surrounding application decides which documents and conversation history to supply, which tools to expose and how to save state. A saved chat memory or a handoff file is different from the parameters learned during model training.
Do not assume every language model is an ordinary next-token generator. BERT, for example, uses masked bidirectional pretraining; its original paper also includes a next-sentence-prediction objective. A Transformer is an architecture, whereas next-token prediction and masked-token prediction describe different modeling objectives.
A worked Transformer example
Imagine translating Le chat dort into The cat sleeps. This is a simplified illustration, not a model run. Words stand in for tokens; it does not specify a real tokenizer's segmentation.
In the original Transformer, encoder positions can attend across the source sentence. The representation at chat can use information from both Le and dort. The encoder also contains position-wise feed-forward layers; the paper's attention-based design does not mean the network contains nothing except attention.
The decoder generates the translation one token at a time. When predicting sleeps, it can use the earlier output The cat and the encoded French sentence. During training, causal attention masking and shifted decoder inputs prevent it from consulting the answer token or later target tokens.
BERT instead uses a bidirectional encoder. In the illustrative input The [MASK] sleeps, a masked-token prediction can use both The and sleeps. Cat is one plausible completion, not a measured prediction. BERT's original corruption procedure does not replace every selected training token with [MASK].
These are different uses of masking: causal masking blocks attention connections, while the masked-token example hides an input token. See the original Transformer paper, sections 3.1 and 3.2.3, and the BERT paper, section 3.1. The Transformer definition summarizes the architecture separately from its training objective.
What tokens and context mean for an agent
Text is processed in tokens, which need not be whole words. Anthropic documents that counts depend on the model and the supplied input; use the token-counting endpoint for the model you plan to use instead of a fixed words-to-tokens conversion.
For Claude, the context window includes the request and the new output, including thinking. System instructions, tool definitions and returned documents consume space too. Output also has a separate maximum. Compaction summarizes earlier material so a conversation can continue; it does not enlarge the underlying window or promise perfect preservation.
A practical check is to compare the supplied documents with the answer: was the relevant passage included, and does it support the result? A larger window alone does not guarantee reliable recall. The context-window documentation describes degradation with longer context as context rot.
Avoid these common mistakes
- Treating the architecture as a product name. A model family, a chat application and a coding agent are different things; identify the component you mean.
- Treating saved application state as retraining. Passing a note in the next request changes available context, not by itself the learned parameters.
- Assuming every service bills in the same way. Check the service's published pricing and reported usage. The token-counting documentation distinguishes estimated counts from billed usage.
- Confusing supplied and newly generated thinking. In Anthropic's counting requests, supplied assistant thinking can count as input. Newly generated thinking is output; preservation of older thinking depends on the model and configuration.
- Treating fluent wording as verification. Compare important output with the underlying documents or other suitable evidence.
A practical next step
Try the context-window packer to examine a proposed prompt budget, or the LLM cost estimator with a supplied usage profile and price table. These are illustrative catalog connections, not claims that either skill was executed or shown to improve a run for this guide.
For the retrieval-versus-training distinction, continue with retrieval-augmented generation. For connections between an application and external tools, see Model Context Protocol.
Related skills in this catalog
Platform Score is our assessment under a published method. It is not a safety guarantee.
Related guides
Terms this guide uses
This item is a worked example in the AI glossary for:
- AI consciousness (debate)
- AI fairness
- ARC-AGI
- Attention mechanism
- Autoregressive model
- Backpropagation
- Beam search
- BERT
- Byte-pair encoding (BPE)
- Compute (AI)
- Constitutional AI
- Context rot
- Context window
- Cross-entropy loss
- Deep learning
- Direct preference optimization (DPO)
- Encoder-decoder
- FlashAttention
- FLOPS (floating-point operations per second)
- Foundation model
- Generative model
- GPQA
- GPU for AI
- HuggingChat
- InstructGPT
- Interpretability
- KV cache
- Language model
- Large language model (LLM)
- Llama (Meta)
- Long short-term memory (LSTM)
- Machine learning model
- MLOps
- Multi-head attention
- N-gram
- Narrow AI
- Natural language processing (NLP)
- Natural language understanding (NLU)
- Neural network
- Poe (Quora)
- Positional encoding
- Pretraining
- Reasoning model
- Recurrent neural network (RNN)
- Reward model
- RLAIF (reinforcement learning from AI feedback)
- Scaling laws
- Self-supervised learning
- Sequence-to-sequence model (seq2seq)
- Softmax
- Sparse attention
- Text generation
- Tokenization (NLP)
- Top-k sampling
- Top-p sampling
- Transformer
- Types of AI
Sources
- https://developers.google.com/machine-learning/glossary#large-language-model (accessed 2026-11-25)
- https://arxiv.org/html/1706.03762v7 (accessed 2026-11-25)
- https://arxiv.org/html/1810.04805v2 (accessed 2026-11-25)
- https://platform.claude.com/docs/en/build-with-claude/context-windows (accessed 2026-11-25)
- https://platform.claude.com/docs/en/build-with-claude/token-counting (accessed 2026-11-25)