Large Language Model (LLM) — Complete Guide with Examples | AI Terms Guide
Category: LLMsDifficulty: BeginnerFirst widely used: 2020 (GPT-3)Last updated: Aug 6, 2026

Large language model (LLM)

A large language model is a neural network trained on massive text corpora to predict the next token — the technology that powers ChatGPT, Claude, Gemini, and every modern chat AI.
Built on the Transformer architecture and trained on trillions of tokens of text, LLMs learn to model the statistical structure of language. This simple objective — predict the next token — turns out to teach them an astonishing range of capabilities: answering questions, writing code, translating, summarizing, reasoning. Modern frontier LLMs like Claude Opus 4.8 and GPT-5 have hundreds of billions to trillions of parameters.

At a glance

Also known as
LLM, Foundation Language Model
Category
AI System
First widely used
2020 (GPT-3 popularized the term)
Difficulty
Beginner

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.

PYTHON
# 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.
Notice: Under the hood, this API call is passing your message through a transformer, computing next-token probabilities layer by layer, and sampling tokens until it produces a complete response. Everything else (streaming, tool use, thinking) builds on this foundation.

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

1

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.

2

Embedding

Each token is mapped to a dense vector (typically 4096-16384 dimensions in frontier models). Positional information is added via RoPE or similar.

3

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.

4

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.

5

Sampling

A next token is sampled from the distribution. Temperature, top-p, and other parameters control randomness. Token added to the sequence.

6

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.

7

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

Misconception #1: LLMs 'know' or 'remember' things.
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.
Misconception #2: LLMs are just fancy autocomplete.
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.
Misconception #3: LLMs and ChatGPT are the same thing.
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.

Where you'll see this in practice

Learn more

Sources & further reading

  1. Language Models are Few-Shot Learners — Brown et al., 2020 (GPT-3 paper). Read →
  2. Attention Is All You Need — Vaswani et al., 2017 (Transformer). Read →
  3. InstructGPT: Training language models to follow instructions — Ouyang et al., 2022 (RLHF for LLMs). Read →
  4. Training Compute-Optimal Large Language Models — Hoffmann et al., 2022 (Chinchilla scaling). Read →
FAQ

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.

Share with