How AI Tools Work

What a Large Language Model Is

A plain explanation of large language models: how next-word prediction works, what training teaches them, and why fluent text is not the same as understanding.

On this page
  1. The short version
  2. Predicting the next piece of text
  3. Tokens
  4. What the model is trained to do
  5. From predictor to assistant
  6. The architecture, briefly
  7. What fluency does and does not mean
  8. What an LLM is not
  9. How to think about it

The short version

A large language model, often shortened to LLM, is a computer program trained to work with text. At its core it does one thing: given some text, it estimates what is likely to come next. Chatbots, writing assistants and many coding helpers are built around this ability. Everything they appear to do, from answering questions to drafting emails, comes from repeating that prediction many times.

The word “large” refers to the size of the model and of the data it learned from. The word “language” reflects what it works on. The word “model” means a mathematical system that represents patterns, not a physical thing or a database of facts.

Predicting the next piece of text

Take the unfinished sentence “The cat sat on the”. Most people would expect “mat”, “sofa” or “floor”, and would be surprised by “volcano”. A language model makes a similar judgement, but it assigns a probability to every option it knows about and then chooses one, often with some controlled randomness so that replies are not identical each time.

Then it adds the chosen piece to the text and predicts again. A paragraph is simply this step repeated. The model is not planning an essay and then writing it out in a hidden form, although larger models can behave as if they track structure, because the patterns they learned include structure.

Tokens

Models do not read words the way we do. Text is first split into tokens, which are chunks such as whole short words, parts of longer words, punctuation or spaces. Each token is converted into a list of numbers. A rough rule of thumb is that a token is often a bit less than a full word in English, but this varies between models and languages.

Tokens matter in practice because models have a limit on how much text they can handle at once, usually called the context window. That limit includes your messages and the replies. In a long conversation, the earliest parts may fall outside what the model can use.

What the model is trained to do

During training, the model is shown huge numbers of text passages with a piece hidden. It guesses the missing piece, compares its guess with the real text, and adjusts its internal numbers a little so that next time it would do slightly better. This is repeated an enormous number of times. Those internal numbers are called parameters, and modern models have a very large count of them, often described in billions.

Notice what the goal is. It is to predict text well, not to be truthful, kind or helpful. To predict text well, the model ends up learning grammar, common facts, styles, how arguments are laid out and much else, because those all help with prediction. But the training target is still a statistical match to human writing. The material it learns from is discussed in the article on training data.

From predictor to assistant

A raw model trained only to continue text would not behave like a helpful chat assistant. It might continue your question with more questions. Developers therefore add further stages:

  • Fine-tuning on examples of good conversations, written or selected by people.
  • Feedback from human raters who compare replies and indicate which are better, which is used to steer the model toward answers people prefer.
  • Hidden instructions that tell the model how to behave in a given product.
  • Safety filters that try to block certain content.

These steps shape tone and behaviour. They do not give the model a reliable way to check facts.

The architecture, briefly

Most current models use a design called a transformer, introduced in a research paper published in 2017. Its key feature is a mechanism called attention, which lets the model weigh how relevant each earlier token is when predicting the next one. In “The trophy would not fit in the suitcase because it was too big”, attention helps connect “it” with “trophy”. You do not need the mathematics to use a chatbot, but the idea explains why these systems handle context better than older autocomplete.

Running these models involves a great deal of arithmetic done in parallel, which is why specialised chips similar to those in a graphics card are used, in data centres and sometimes on personal devices.

What fluency does and does not mean

Because the output reads smoothly, people tend to assume understanding. Whether these systems understand anything in a human sense is debated, and the careful position is that they are very good at language patterns and can be useful, while their inner workings are hard to interpret.

What is clear from how they work is that they are tuned to produce plausible text. If the most plausible continuation is wrong, the model may still produce it with confidence. That is the source of invented facts, covered in the article on AI hallucinations. The practical consequences:

  • Facts can be wrong, especially names, numbers, dates and citations.
  • Arithmetic and logic can slip, particularly in long chains of steps.
  • Knowledge has a cut-off, unless the product adds search or other tools.
  • Wording affects results, which is why advice on AI prompts is worth reading.
  • Inherited bias is possible, because the model learns from human writing.

What an LLM is not

It is not a search engine, though some products combine the two. It is not a database that stores documents to be retrieved word for word. It is not a person, and it does not have experiences or intentions, even when it says “I think”. And it is not the whole of artificial intelligence, which includes many other techniques.

How to think about it

A useful mental picture is a very well-read autocomplete that has been taught to follow instructions. It is strong at drafting, rephrasing, summarising and explaining familiar ideas, and weaker as a source of verified facts. Use it for the first, check anything that matters for the second, and keep in mind that the details of specific products change quickly while this basic principle has stayed the same.

The complete guide to how ai tools work

How AI Chat Tools Work in Plain Words
Read the guide

Keep exploring

Guides from other topics

All topics →