Core Concepts Entry

Large language models, explained

Reviewed August 2026

TL;DR: A large language model (LLM) is a neural network trained on enormous amounts of text to do one thing: predict the next token. That single skill, applied at massive scale, turns out to cover writing, translation, coding, summarization, and question answering. Every chatbot, coding assistant, and AI agent you use is an LLM with scaffolding around it.

How it works

Training an LLM starts with a simple game played billions of times: show the model a stretch of text with the ending hidden, ask it to guess the next piece, and nudge its internal weights toward the right answer. The pieces are tokens - chunks of a few characters each - and the guessing machinery is the transformer architecture. After enough of this, the model has absorbed grammar, facts, idioms, code syntax, and a surprising amount of reasoning, because predicting text well requires modeling the world that produced it.

A concrete example: given "The capital of France is", the model assigns a probability to every token it knows. "Paris" scores highest, so that is what you get. Generation is just this step repeated - each new token is appended to the input and the model predicts again, one token at a time, until it produces a stop signal. Nothing in the loop looks up facts in a database; everything comes from patterns compressed into the weights during training.

Raw next-token prediction alone produces a model that continues text rather than helping you. A second phase - instruction tuning plus RLHF - teaches the model to behave like an assistant: follow directions, answer questions, refuse harmful requests. The "chat" models you actually use have been through both phases.

Two practical consequences follow from this design. First, an LLM's knowledge is frozen at its training cutoff, which is why systems bolt on retrieval to supply current or private information. Second, the model always produces a plausible answer whether or not it knows the truth - the failure mode called hallucination. Both are properties of the mechanism, not bugs a bigger model automatically fixes.

Where it sits in the AI stack

The LLM is the engine at the center of the stack. Everything upstream prepares its input; everything downstream consumes its output:

Key tools and implementations

  • Claude

    Anthropic's family of frontier models, widely used for coding, agents, and long-document work.

  • GPT

    OpenAI's model family, the line that made LLMs mainstream through ChatGPT.

  • Gemini

    Google's multimodal model family, built to handle text, images, audio, and video together.

  • Llama and other open-weights models

    Downloadable model families you can run and fine-tune on your own hardware.