What is a LLM?
Understand Large Language Models: how they learn, how they work, and what they can (and can't) do.
If you've used ChatGPT, Claude, Gemini, or Copilot, you've interacted with a Large Language Model (LLM). These systems have transformed how millions of people write, code, research, and learn. But what exactly is an LLM, and how does it work?
This guide breaks down the technology in plain language — with diagrams to show how text becomes understanding (of a sort) and how a prompt becomes a response.
What is a Large Language Model?
A Large Language Model is a type of AI trained on enormous amounts of text — books, websites, articles, code, conversations — to understand and generate human language.
The "large" refers to two things:
- Large training data — Trillions of words from across the internet and licensed datasets.
- Large number of parameters — The internal settings the model adjusts during training. Modern LLMs have billions or even trillions of parameters.
The core idea
An LLM learns to predict the next word (or token) in a sequence. By doing this billions of times across vast text, it develops an internal representation of language, facts, reasoning patterns, and even coding syntax.
What are tokens?
Before an LLM can process text, it breaks it into small pieces called tokens. A token might be a whole word, part of a word, or a punctuation mark.
For example, the sentence "Large language models understand text" might become 8 tokens. Each token is then converted to a number that the model can work with mathematically.
As a rough guide, 1 token ≈ 4 characters in English. So a 1,000-word article is roughly 1,300 tokens. This matters because LLMs have a context window — a maximum number of tokens they can process at once (ranging from 8,000 to over 1 million in modern models).
Inside the model: transformers
Most modern LLMs are built on a neural network architecture called the transformer, introduced in a landmark 2017 paper titled "Attention Is All You Need."
The key innovation is self-attention — a mechanism that lets the model weigh the importance of every word in relation to every other word. When processing "The cat sat on the mat," the model learns that "cat" and "sat" are closely related, while "the" is less important for understanding the action.
Transformers stack many layers of attention and processing, which is why they're called "deep" neural networks. Each layer captures increasingly abstract patterns — from grammar to facts to reasoning.
How LLMs are trained
Training an LLM is a multi-stage process that takes months and costs millions of dollars in computing power.
Stage 1: Pre-training
The model is fed enormous amounts of raw text and learns to predict the next token. If the input is "The capital of France is," the model learns to predict "Paris." By doing this across trillions of examples, it absorbs grammar, facts, reasoning patterns, and writing styles.
Stage 2: Fine-tuning
The pre-trained model is further trained on curated datasets — often question-answer pairs, instructions, and demonstrations of helpful behaviour. This teaches the model to follow instructions and respond in a conversational format rather than just completing text.
Stage 3: RLHF (Reinforcement Learning from Human Feedback)
Human evaluators rank different model responses from best to worst. The model is then adjusted to prefer responses that humans rated highly. This is how models learn to be helpful, honest, and safe — and to refuse harmful requests.
How a prompt becomes a response
When you type a question into ChatGPT, here's what happens behind the scenes:
The model generates its response one token at a time, each prediction informed by everything that came before. This is why you see responses appear word by word — the model is literally constructing the answer token by token.
What LLMs are good at
- Writing and editing — Emails, essays, reports, creative fiction, marketing copy.
- Coding — Writing, explaining, and debugging code in dozens of programming languages.
- Research and summarisation — Condensing long documents, explaining complex topics, comparing ideas.
- Translation — Converting text between languages with high fluency.
- Analysis and reasoning — Breaking down problems, suggesting approaches, identifying patterns.
- Conversation — Answering questions, tutoring, brainstorming, role-playing scenarios.
What LLMs struggle with
Understanding limitations helps you use LLMs more effectively:
- Hallucinations — LLMs can generate confident, plausible-sounding information that is factually wrong. Always verify important facts.
- Knowledge cutoff — Models only know what was in their training data. They don't know about events that happened after training (though some tools connect to the web to compensate).
- Math and precise calculation — While improving, LLMs can make arithmetic errors. For critical calculations, use a calculator.
- Long-term memory — Within a conversation, context is limited to the context window. The model doesn't truly "remember" past conversations unless the application provides that feature.
- Real-world interaction — An LLM can't browse the web, send emails, or take actions unless specifically connected to tools that enable this (called "agents" or "tool use").
The hallucination problem
LLMs are trained to produce plausible text, not guaranteed-true text. They don't have a built-in fact-checker. Think of them as extremely well-read assistants who occasionally misremember — always double-check important claims.
Popular LLMs in 2026
Several major LLMs are widely available:
- GPT-4o / GPT-4 (OpenAI) — Powers ChatGPT. Known for strong general reasoning and coding.
- Claude (Anthropic) — Known for nuanced writing, long context windows, and safety focus.
- Gemini (Google) — Integrated across Google products. Strong multimodal capabilities.
- Llama (Meta) — Open-source models that can be run locally or customised.
- Mistral (Mistral AI) — Efficient European models, both open and commercial.
Further reading
- Anthropic Research — Papers on AI safety, scaling, and capabilities.
- OpenAI Research — Foundational papers including the original GPT series.
- "Attention Is All You Need" — The 2017 paper that introduced the transformer architecture.
- The Illustrated Transformer — Visual explanation of how transformers work.
- OpenAI Tokenizer — Interactive tool to see how text is split into tokens.
Continue learning
Now that you understand how LLMs work, explore the current AI landscape to see how these models fit into the broader ecosystem of tools, companies, and applications.
Or go back to basics with What is AI exactly? for a broader introduction to artificial intelligence.