Large language model (LLM)
At a glance
Definition
A large language model (LLM) is a neural network — typically a Transformer — trained on very large text corpora with the objective of predicting the next token given the previous ones. That objective, applied at scale, produces models with broad capabilities: answering questions, writing code, translating between languages, summarizing documents, reasoning through problems, and holding conversations.
The term 'large' has evolved. Early LLMs like GPT-2 (2019) had 1.5 billion parameters. GPT-3 in 2020 had 175 billion and popularized the term. In 2026, frontier models routinely have hundreds of billions to over a trillion parameters. But 'large' is about behavior as much as size — a modern 8B-parameter open-weight model like Llama outperforms 175B models from 2021 by every measure. What matters is capability, not just parameter count.
LLMs are pretrained on massive corpora (Common Crawl, books, code, curated datasets — often 10-20 trillion tokens). This pretraining gives them a broad statistical model of language. Modern LLMs are then post-trained with instruction tuning, RLHF, and safety training to make them helpful, harmless, and honest — turning a base 'text completer' into a chat assistant.
Every conversational AI product you've used — ChatGPT, Claude, Perplexity, Copilot, Gemini, and countless others — is an interface to one or more LLMs. Developer APIs (Anthropic, OpenAI, Google) let you build products directly on LLMs. This is the substrate the entire modern AI industry runs on.
Real-world example
What "predict the next token" actually looks like
When you send the prompt The capital of France is to an LLM, the model computes a probability distribution over its entire vocabulary for the next token. In a well-trained model, Paris gets the highest probability. The model outputs 'Paris', then repeats the process with The capital of France is Paris to generate the next token, and so on. This continues token by token until the model produces a stop sequence or hits max_tokens. Every complex behavior you see — coding, reasoning, conversation — emerges from doing this well.
# Talking to an LLM via the Anthropic API
from anthropic import Anthropic
client = Anthropic()
response = client.messages.create(
model="claude-opus-4-8",
max_tokens=1024,
messages=[
{"role": "user", "content": "Explain LLMs in one sentence."}
]
)
print(response.content[0].text)
# The model returns a natural-language response,
# generated one token at a time.When you'll encounter this
- You're building any conversational AI product — LLMs are the underlying engine.
- You're writing prompts — understanding that LLMs are next-token predictors explains why certain prompting techniques (few-shot, chain-of-thought) work.
- You're evaluating AI capabilities — every provider announcement is about a specific LLM's benchmark results.
- You're designing production systems — LLM cost, latency, context window, and rate limits all shape architecture decisions.
- You're choosing between RAG and fine-tuning — both are ways to specialize an LLM to your use case. See our comparison.
How it works
Tokenization
Text is broken into tokens using a tokenizer (usually Byte-Pair Encoding). One token is roughly 3-4 characters or 0.75 words in English.
Embedding
Each token is mapped to a dense vector (typically 4096-16384 dimensions in frontier models). Positional information is added via RoPE or similar.
Transformer layers
The embeddings pass through 60-100+ transformer blocks, each computing attention and feed-forward transformations. Modern LLMs often use Mixture of Experts to scale to trillions of parameters.
Output projection
The final layer projects the last hidden state to vocabulary size. Softmax gives a probability distribution over what the next token should be.
Sampling
A next token is sampled from the distribution. Temperature, top-p, and other parameters control randomness. Token added to the sequence.
Repeat
The whole process runs again for the next token. This is why generation is slower than the prompt fill: prompt tokens can be processed in parallel, but generation is inherently sequential.
Stop
Generation ends when the model produces a stop sequence, hits max_tokens, or you cancel the request. The complete response is returned.
Common misconceptions
LLMs don't have a knowledge base they look things up in. They have parameters — billions of numbers — that encode statistical patterns from their training data. When you ask a factual question, they generate what a plausible answer looks like based on those patterns. This is why hallucination happens: a plausible-looking answer isn't always a correct one.
The 'autocomplete' comparison captures the training objective but understates what emerges. Next-token prediction at scale produces genuine reasoning ability, in-context learning, and increasingly, tool use. Whether that constitutes 'understanding' is philosophical; the practical capabilities are real.
ChatGPT is a product (a chat interface with memory, tools, and features) built on top of LLMs. The underlying LLMs (GPT-4o, GPT-5, o-series) are different from the product. Similarly, Claude.ai is the product; Claude Opus 4.8 is one of the LLMs behind it.
Related terms
Related in LLMs & Language Models
Narrower / specific concepts
Head-to-head comparisons
Where you'll see this in practice
Related tools
Related models
Learn more
- Start the AI for Developers path
- Read: How Transformers Work (the architecture underneath)
- Understanding Context Windows
- Browse LLMs & Language Models category
Sources & further reading
- Language Models are Few-Shot Learners — Brown et al., 2020 (GPT-3 paper). Read →
- Attention Is All You Need — Vaswani et al., 2017 (Transformer). Read →
- InstructGPT: Training language models to follow instructions — Ouyang et al., 2022 (RLHF for LLMs). Read →
- Training Compute-Optimal Large Language Models — Hoffmann et al., 2022 (Chinchilla scaling). Read →
Frequently asked about Large Language Model
There's no strict cutoff. Historically, "LLM" was applied to models above 1 billion parameters. In 2026 the term is used more loosely — high-quality 3B and 8B models are often called LLMs. What matters is whether they exhibit LLM-like capabilities (in-context learning, instruction following, reasoning) rather than crossing a specific parameter threshold.
Essentially all frontier LLMs in 2026 are Transformers or Transformer-hybrid variants. Alternatives like Mamba and state space models are showing promise but haven't yet displaced Transformers in production. See our modern architectures category.
Because they generate what plausible answers look like based on statistical patterns, not what is factually true. When a model doesn't know something, it may still produce a confident-sounding answer that's wrong. Techniques like RAG, citations, and chain-of-thought reduce hallucination but don't eliminate it.
ChatGPT is a product — a chat interface with memory, custom instructions, tools, voice mode, and other features. The underlying LLMs (GPT-4o, GPT-5, o-series) are the neural networks that produce responses. Similarly, Claude.ai is the product; Claude Opus 4.8 is one LLM inside it.
Depends on scale. Small LLMs (1-3B params) can be trained for tens of thousands of dollars on cloud GPUs. Frontier LLMs cost tens to hundreds of millions of dollars — thousands of H100 GPUs running for months, plus dataset curation and post-training. Only a handful of organizations can afford frontier training. See Datasets, Infra & Companies.
Technically reviewed by the AI Terms Guide editorial team on August 6, 2026. Last updated: August 6, 2026. Spotted an error? Let us know — corrections ship within 24 hours.
Building with AI? Try our sister sites
Deep coverage of AI errors, code patterns, and pricing you won't find in the reference.
AI Terms Weekly
One deep term, three new models, one comparison — every Tuesday.