Skip to content
AGI Fans

What is an LLM? A plain-language explanation

A large language model predicts the next piece of text, over and over. How that works, how models are trained, and why they can be fluent and wrong at once.

Updated · 4 min read · How guides are written

A large language model, or LLM, is a program that has learned to predict what text comes next. Give it some text and it produces a likely continuation, one small piece at a time. Chatbots such as ChatGPT, Claude and Gemini are LLMs wrapped in an application. Everything else about them, including the parts that feel like reasoning, is built on that one trick, done at very large scale.

Predicting the next token

Models do not read letters or words. Text is first cut into tokens: common words, word fragments and punctuation. A model has a fixed vocabulary of tokens, typically tens of thousands to a few hundred thousand of them. (Tokens and context windows goes into what that means in practice.)

Given a sequence of tokens, the model calculates a probability for every token in its vocabulary being the next one. After “The capital of France is”, the token for “ Paris” gets a very high probability. One token is chosen, added to the sequence, and the whole calculation runs again for the next one. An answer of 500 words is that loop running several hundred times.

The choice is usually not strictly the most likely token. A setting called temperature controls how much randomness is allowed, which is why the same question can produce different answers.

What is inside

The model is a neural network: a very long chain of arithmetic whose behaviour is set by numbers called parameters or weights. Modern LLMs have billions of them. GPT-3, described in a 2020 paper, had 175 billion, and was ten times larger than any comparable model before it.

Almost all current LLMs use an architecture called the transformer, introduced by Google researchers in the 2017 paper Attention Is All You Need. Its key mechanism, attention, lets the model weigh every token in the input against every other token when deciding what comes next. That is how it keeps track of what “it” refers to three sentences back. The “T” in GPT stands for transformer.

Nobody writes the weights by hand. They are found by training.

How a model is trained

Pre-training. The model is shown enormous amounts of text: web pages, books, code, papers. Over and over, it is asked to predict the next token of a real passage, the prediction is compared with what actually came next, and every weight is nudged slightly in the direction that would have made the prediction better. Nothing tells the model about grammar, facts or logic. To predict text well across that much material, it ends up encoding a great deal of all three. This stage needs thousands of specialised chips running for weeks or months, which is why compute is such a large part of AI news.

Fine-tuning and feedback. A pre-trained model completes text; it does not yet behave like a helpful assistant. Further training on examples of good conversations, and on human judgements of which answers are better, shapes that behaviour. OpenAI’s 2022 paper on training models with human feedback describes the method, and the first ChatGPT, released in November 2022, was trained the same way.

When training ends, the weights are frozen. The model that answers you is not learning as it goes. The date its training data ends is its knowledge cutoff, and it knows nothing after it unless that information is put in front of it.

What happens when you send a message

Your message, the conversation so far and hidden instructions from the application (the system prompt) are joined into one long sequence of tokens. That sequence is the context. The model reads all of it and starts predicting. It has no other memory: if something is not in the context and was not in the training data, the model does not have it.

Much of what products add on top is ways of putting the right text into the context: search results, files you upload, notes saved from earlier chats. RAG vs fine-tuning vs long context explains those options. When a model is given the ability to call software and act on the results, it becomes an agent, covered in AI agents and MCP explained.

Why models are fluent and sometimes wrong

A model produces the text that is likely to follow, which is not the same as text that is true. For well-documented facts those usually coincide. For obscure details, recent events or exact figures, the model may produce something that has the right shape and is false: an invented citation, a plausible but wrong date. This is called hallucination, and it follows directly from how the model works. It is not a bug that a patch removes, though better training and looking things up reduce it.

Three practical consequences:

  • Confidence is not evidence. A model sounds equally sure when it is right and when it is wrong.
  • Wording matters. The model continues the text it is given, so how a question is framed changes the answer.
  • Sources help. Asked to work from a document that is in its context, a model is far more reliable than when answering from memory.

“Reasoning” models

Many current models can produce a private working-out before the visible answer: they generate intermediate steps, check them, and only then respond. Labs call this reasoning or thinking, and often let you choose how much of it to spend. Mechanically it is still next-token prediction, with the model’s own intermediate text added to the context. In practice it makes a real difference on multi-step problems, at the cost of time and tokens.

Is this intelligence?

That is disputed, and the answer depends on what you mean by the word. What is not disputed is the mechanism described above. Whether stacking that mechanism higher leads to AGI, or whether something else is needed, is one of the central arguments in the field, and you will see both sides in the Analysis lane most weeks.

Go deeper

If you want the mechanics properly, with pictures or code, Where to learn how LLMs work lists the best free and paid material. For individual terms, see the glossary.

Common questions

Does an LLM look things up when it answers?

Not by itself. A bare model answers from patterns stored in its weights during training. Products built on models often add web search or document retrieval, which puts looked-up text into the prompt for the model to read.

Does an LLM learn from my conversation?

Not while you are talking to it. The weights are fixed once training ends. A conversation only exists in the context window; whether a provider later uses conversations as training data is a matter of its policy, not of how the model works.

What does GPT stand for?

Generative pre-trained transformer: it generates text, it is pre-trained on a large body of text before any specific use, and it uses the transformer architecture.