How Large Language Models Work: A Plain-English Guide
A plain-English explanation of how large language models work: tokens, training, next-token prediction, context windows, fine-tuning and hallucinations.

Large language models (LLMs) power ChatGPT, Claude, Gemini and many other AI tools, yet the way they work is often described either as magic or as glorified autocomplete. Neither description is quite right. At their core, LLMs are statistical models trained to predict the next piece of text, and that simple objective, applied at very large scale, produces systems that can write, summarise, translate and work through problems with surprising competence. Understanding the mechanics, even at a high level, helps you use these tools more effectively and recognise their limits.
Tokens: how models read text
LLMs do not read words the way people do. Text is first split into tokens: chunks that may be a whole word, part of a word, a punctuation mark or a space. Common words often map to a single token, while rare or long words are broken into several pieces. Each token is converted into a number, and then into a list of numbers called a vector that the model can process mathematically.
Tokens matter in practice because usage limits, context sizes and API pricing are usually measured in tokens rather than words. The ratio between the two depends on the tokeniser, the language and the content; code, numbers and less widely used languages generally need more tokens per word.
Training: learning patterns from text
A model starts as a large neural network whose adjustable parameters, often numbering in the billions, begin as essentially random values. During pre-training, it is shown an enormous collection of text, typically drawn from sources such as public web pages, books, code and licensed or curated datasets, and it learns by repeatedly trying to predict the next token.
Each time a prediction is wrong, a process called backpropagation nudges the parameters slightly so that the correct answer becomes more likely next time. Repeated across a vast number of examples, these small adjustments encode patterns of grammar, facts, writing styles, reasoning steps and relationships between concepts.
Most modern LLMs use the transformer architecture. Its key mechanism, called attention, lets the model weigh how relevant each earlier token is to the one it is currently processing. That is how it links a pronoun to the right noun several sentences back, or a closing bracket to the code that opened it.
Next-token prediction: how responses are generated
When you send a prompt, the model calculates a probability for every token in its vocabulary as a candidate for what comes next. It selects one, appends it to the text and repeats the process, one token at a time, until the response is complete.
The selected token is not always the single most likely one. A setting usually called temperature controls how much randomness is allowed: lower values produce more predictable, focused text, while higher values produce more varied output. This is one reason the same prompt can return different answers on different attempts.
It can seem unlikely that predicting the next token could produce coherent essays or working code. But to predict text well across so many subjects, a model has to capture a great deal about how language, facts and logic fit together. Its abilities emerge from that training pressure rather than from rules written by engineers.
Context windows: the model's working memory
The context window is the maximum amount of text, measured in tokens, that a model can consider at once. It includes your instructions, any documents you paste or upload, the conversation so far and the response being generated.
- Within a conversation, the model can only use what fits in the context window. In very long chats, earlier material may be dropped or condensed by the app.
- Between conversations, the model itself retains nothing. Memory features in some apps work by saving notes and inserting them into later contexts.
- Larger windows let you work with long documents in one pass, although models can still overlook details buried deep inside very long inputs.
Fine-tuning and RLHF: from text predictor to assistant
A pre-trained model is good at continuing text but not at following instructions or holding a helpful conversation. Developers shape it further through additional training stages, which at a high level look like this:
- Supervised fine-tuning: the model is trained on curated examples of prompts paired with high-quality responses, which teaches it the format and behaviour of an assistant.
- Reinforcement learning from human feedback (RLHF): people compare and rank alternative responses, those preferences train a reward model, and the assistant is then optimised to produce responses the reward model scores highly.
- Further alignment work: developers also use methods such as written guiding principles, AI-generated feedback and targeted safety training to make models more helpful and honest, and less likely to produce harmful content.
Organisations can also fine-tune models on their own data for specialised tasks. For many business needs, though, supplying relevant documents alongside the prompt, an approach known as retrieval-augmented generation (RAG), is simpler and easier to keep up to date.
Why hallucinations happen
A hallucination is a confident, fluent statement that is false: an invented citation, a wrong date or a product feature that does not exist. It follows directly from how LLMs work. The model generates text that is statistically plausible, and plausible is not the same as true.
- The model has no built-in fact database to check against; it reconstructs information from learned patterns.
- Gaps in training data, outdated information and niche topics leave the model with weak patterns to draw on.
- Training that rewards helpful-sounding answers can encourage a confident guess over an admission of uncertainty.
- Specific details such as names, numbers, quotations and references are especially easy to get wrong.
Key takeaways
- LLMs process text as tokens and generate responses one token at a time.
- Pre-training on large text collections teaches statistical patterns, not a verified store of facts.
- The context window limits how much the model can consider at once, and the model keeps no memory between sessions unless an app adds one.
- Fine-tuning and RLHF turn a raw text predictor into a helpful assistant.
- Hallucinations are a natural by-product of prediction, so human verification remains essential.
To see how these ideas play out in real products, read our comparison of ChatGPT, Claude and Gemini. For the wider business context, start with machine learning basics for business.
- #Large language models
- #AI fundamentals
- #Hallucinations
- #Explainers
WebAIAutomation Research Desk
Research & Analysis
The research desk tracks the AI and automation landscape, compares products side by side and explains the technology behind them.
Related articles

Responsible AI Use at Work: A Practical Guide for Teams
How to use AI tools responsibly at work: protect sensitive data, verify outputs, disclose AI use, watch for bias and set a simple acceptable-use policy.

Best AI Writing Tools Compared: Which One Fits Your Work?
We compare Claude, ChatGPT, Grammarly, QuillBot, Jasper and Copy.ai by use case — drafting, editing and marketing copy — so you can pick the right fit.

Machine Learning Basics for Business: A Practical Primer
A plain-English primer on machine learning for business teams: how models learn, how to judge them, and where they help with forecasting and churn.
Newsletter
Stay ahead of AI and automation
A concise weekly brief with new tools worth trying, practical workflows and the technology shifts that matter.