How does a language model work? Explained in plain terms
How a language model like ChatGPT answers: tokens, probabilities, training, context window. And what your organisation derives from it for use and testing.
In short
A language model breaks your text into tokens and calculates which token most likely comes next, one at a time. Its knowledge comes from training and has a cut-off date. Extra input sits in the context window. It does not check truth, and the same question can get different answers. Govern data flows, test with many runs and verify references.
Auf Deutsch lesen: deutsche Fassung
You type a question, press Enter, and two seconds later a neatly worded paragraph appears on the screen. Very few of the people who use the tool every day can explain what happens in those two seconds. That is no criticism. You use a power drill without taking the motor apart. With a language model, a look under the bonnet still pays off. Almost every rule that applies in day-to-day operations follows from how it is built: what you may enter, how you check a result and what you will have to prove later.
I walk the route from your input to the answer in four steps. After that comes what a language model does not do, and at the end what your organisation derives from it. You need no mathematics for this. The sources are listed below: original papers and the vendors’ own documentation. As of November 2026.
Step 1: Your text becomes tokens
A language model reads text as a sequence of tokens. A token can be a whole word, part of a word, a punctuation mark or the start of a word including the space before it. Which pieces exist is set by a fixed vocabulary built before training. A widely used method for this comes from machine translation. In 2016, Sennrich and colleagues showed that rare and unknown words can be represented as sequences of smaller word pieces. Frequent character sequences become a single token, rare ones break into several.
OpenAI gives a rule of thumb for English text: one token is roughly four characters or three quarters of a word, and 100 tokens are about 75 words. The vendor adds straight away that other languages work out differently and that the same text yields a different number of tokens depending on the model. Anthropic is more specific. Its models from Claude 4.7 onwards use a newer method that produces roughly 30 per cent more tokens for the same text than the older models.
This has two consequences for your operations. First, cloud services bill by tokens, separately for input and output, and the context window is measured in tokens as well. Switching models can therefore make the same task more expensive even though the price per token stays the same. Second, long article numbers, amounts and names break into fragments for the model. That is exactly where transposed digits happen. So you always check numbers and identifiers in an AI output against the source.
The term in brief, with cost planning and checkpoints:
Glossary: tokenStep 2: The model calculates, token by token
At the heart of almost every large language model sits the transformer. Vaswani and colleagues introduced it in 2017 in the paper “Attention Is All You Need”, at the time for machine translation. What was new was that the network relies solely on an attention mechanism and does entirely without the recurrent and convolutional layers of older designs. Put simply, for each token the model calculates how strongly it should take the other tokens of the input into account. That is how “bank” gets one meaning in a sentence about a loan and another in a sentence about a river. The authors stressed that their model is easier to compute in parallel and needs significantly less training time.
At the end of each calculation step there is a probability distribution: which token is how likely to come next. One of them is selected and appended to the text, then everything runs through the model again. Then the next token. And the one after that. A paragraph of 150 English words takes about 200 such passes according to OpenAI’s rule of thumb.
How much chance is involved in the selection is controlled by a parameter called temperature. Low values stick to the most probable wording, high values allow rarer choices. Anthropic writes in its glossary that results are not fully deterministic even at a temperature of zero. Identical inputs can produce different outputs across calls. The foundational terminology standard ISO/IEC 22989:2022 says the same in general terms: AI outputs are error-prone, and a result has a certain probability of being correct rather than being absolutely true (7.4.1).
This leads to the most important sentence for any test: a single good result proves little. A screenshot of a successful answer shows what came out once. It does not show what will come out next time. If you approve a language model for a recurring task, you test it with many cases and several runs per case.
What a large language model is in legal terms and which evidence holds up in operations:
Glossary: large language modelStep 3: Where the knowledge comes from, and where it ends
Before a model answers even one question, it has gone through pre-training. Anthropic describes it like this: the model learns from very large amounts of unlabelled text to predict the next word. According to the vendor, a model pre-trained in this way is not yet good at answering questions or following instructions. Fine-tuning and learning from human feedback are added for that.
How much difference this makes was measured by Ouyang and colleagues at OpenAI in 2022. People wrote example answers and ranked the model’s outputs, and the model was trained further on that. In human evaluations, a model tuned this way with 1.3 billion parameters did better than GPT-3 with 175 billion, a model more than a hundred times larger. The authors note themselves that it still makes simple mistakes. What it mainly learned was to follow instructions and to answer the way people prefer. How these training stages work in detail is a topic of its own.
What the model knows from training is spread across its parameters. Lewis and colleagues described the catch in 2020: pre-trained models store factual knowledge in their parameters, yet their ability to access it precisely is limited. Providing provenance for a statement and updating that knowledge were open research problems, they wrote. There is no register in which the model looks things up, and no footnote it could supply from memory.
And the knowledge has a date. For its current models, Anthropic gives two figures: the training data cut-off and a reliable knowledge cut-off, both June 2026 for Claude Opus 5.5. What happened after that, the model does not know from training. For a law amended in July or a standard published in October, it needs a source from outside.
Step 4: The context window is the working memory
Whatever else the model sees for a request is in the context window. Anthropic calls it the model’s working memory and explicitly distinguishes it from the training data. Everything that belongs to the request counts towards it: the application’s base instruction, the conversation so far, attached documents, results from tools and the answer currently being written. The size depends on the model, and for current Claude models it is up to one million tokens.
Two properties surprise many people. First, the model has no memory from one request to the next. According to its documentation, Anthropic’s programming interface is stateless, and the entire conversation history is sent again with every request. What feels like a conversation is a text that grows longer with every round. If an assistant such as ChatGPT offers a memory, that is a feature of the application. OpenAI describes that, depending on plan, region and settings, it draws on past chats, saved memories and connected services. The model itself is not retrained in the process.
Second, more context does not automatically mean better answers. Anthropic writes that accuracy and recall degrade as the number of tokens grows. Liu and colleagues measured in 2023 that models use information at the beginning and the end of long inputs best and do significantly worse in the middle. For an 80-page framework agreement, this means the clause on page 41 is the real test.
What counts towards the context window and what that means for evidence:
Glossary: context windowThe context is also where the model’s greatest strength lies. In 2020, Brown and colleagues showed with GPT-3 that a model can solve new tasks purely from instructions and a few examples in the text, without its parameters being changed. That is why it pays to give a prompt two good examples. And that is why methods such as RAG bring your own documents into the window instead of retraining the model.
How to connect your own documents to a language model via RAG and what permissions, deletion and testing require:
RAG: connecting company dataWhat a language model does not do
The four steps show what none of them contains. It is worth writing this down explicitly once, because the interface of an assistant suggests the opposite:
- It does not check truth. A continuation that sounds probable can be wrong and still sounds just as certain as a correct one.
- It does not look anything up. Without a connected search, there is only what sits in the parameters, as of the training date.
- It does not remember. Whatever is not in the context window does not exist for the request.
- It does not act on its own. An email, a booking or an order only comes about once an application gives it tools and executes its output.
Many assistants build around the model precisely at these gaps: web search, search in company documents, execution of program code. That helps. The answer then depends on what the search found, and you have to look at the source yourself. Why models invent sources and numbers, and what helps against it, is covered in a separate article.
Why AI invents facts, what courts have said about it and how to catch it:
AI hallucinationsA note for anyone who looks things up in standards. ISO/IEC 22989:2022, the foundational terminology standard for AI, does not yet know the language model. I counted: the words “language model” and “transformer” appear in it zero times. Its general framework still holds, for example the stages from prediction through recommendation and decision to action (7.4). For everything specific to language models, original papers and vendor documentation remain the source.
What your organisation derives from this
Each step leads to a rule. I map them to the places in ISO/IEC 42001 where an auditor will ask about them. The mapping is my own:
- Inputs are data flows. Everything in the context window goes to the provider, including the attachment and the conversation history. What may go into which tool belongs in a rule everyone knows (A.9.2, processes for responsible use).
- Model and version carry an identifier. Record which model in which version runs for which task. A switch changes tokens, costs and behaviour (A.4.4, tooling resources, and A.6.2.6, operation and monitoring).
- Testing accounts for variation. Before approval, twenty real cases with a known solution, each run several times, against criteria set in advance (A.6.2.4, verification and validation).
- Numbers, names and references are checked against the source. For anything with a date, the first question is: as of when?
- Long documents are split or queried in a targeted way, and the check also looks at the middle.
- What sat in the window is logged: prompt, documents, model version, result and the person who checked it (A.6.2.8, recording of event logs).
In legal terms, Article 4 of the AI Act as amended by Regulation (EU) 2026/1744 requires deployers to take measures to support the development of AI literacy of their staff. The article does not prescribe any particular training, and you do not have to guarantee a specific level for anyone. If people on your team can explain why the same question gets two answers and why the clause on page 41 is missing, you have already done a good part of it. This is my interpretation from practice. For legal advice, please turn to the appropriate professionals.
On Monday, run three trials with the assistant your team uses. Ask the same specialist question three times in new conversations and compare the answers. Upload a long document and ask about a passage from the middle. Ask about something that changed in the last month. It takes half an hour, and afterwards you know where testing has to start in your organisation. Who on your team could explain today what happens between Enter and the answer?
How your team gets good results from AI assistants, checks them and sticks to clear rules:
Copilot trainingPrimary sources
- Vaswani et al.: Attention Is All You Need, arXiv:1706.03762, June 2017 (accessed on 25 November 2026)
- Sennrich, Haddow, Birch: Neural Machine Translation of Rare Words with Subword Units, arXiv:1508.07909, 2016 (accessed on 25 November 2026)
- Brown et al.: Language Models are Few-Shot Learners, arXiv:2005.14165, May 2020 (accessed on 25 November 2026)
- Ouyang et al.: Training language models to follow instructions with human feedback, arXiv:2203.02155, March 2022 (accessed on 25 November 2026)
- Lewis et al.: Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks, arXiv:2005.11401, May 2020 (accessed on 25 November 2026)
- Liu et al.: Lost in the Middle: How Language Models Use Long Contexts, arXiv:2307.03172, July 2023 (accessed on 25 November 2026)
- OpenAI Help Center: Understanding and counting tokens, rules of thumb for English text (help.openai.com, accessed on 25 November 2026)
- OpenAI Help Center: Memory in ChatGPT, sources of the memory feature (help.openai.com, accessed on 25 November 2026)
- Anthropic documentation: Glossary, entries on pretraining, RLHF, temperature and tokens (platform.claude.com, accessed on 25 November 2026)
- Anthropic documentation: Context windows (platform.claude.com, accessed on 25 November 2026)
- Anthropic documentation: Using the Messages API, stateless interface (platform.claude.com, accessed on 25 November 2026)
- Anthropic documentation: Models overview, reliable knowledge cut-off and training data cut-off (platform.claude.com, accessed on 25 November 2026)
- ISO/IEC 22989:2022, Artificial intelligence concepts and terminology, clauses 7.4 and 7.4.1 (iso.org)
- ISO/IEC 42001:2023, AI management systems, Annex A, controls A.4.4, A.6.2.4, A.6.2.6, A.6.2.8 and A.9.2 (iso.org)
- Regulation (EU) 2024/1689 (AI Act), consolidated version of 27 July 2026, Article 4 (EUR-Lex, text retrieved via the Publications Office on 25 November 2026)
Frequently asked questions
Why do I get different answers to the same question?+
Because at every step the model selects from a probability distribution, usually with an element of chance. Anthropic writes that results are not fully deterministic even at a temperature of zero. For reliable results you therefore need test criteria and, for important tasks, several runs.
Does a language model learn from my inputs?+
Not while it answers: the model’s parameters do not change during a request. Memory features belong to the application. Whether the provider stores inputs or later uses them for training is governed by the contract and the settings. You clarify that before approval.
What is the difference between training knowledge and the context window?+
Training knowledge sits in the parameters and has a cut-off date. The context window contains what the model also sees for this one request: instructions, conversation history, documents and results from tools. Only the context lets you trace an answer back to a source.
How many tokens does a German text have?+
That depends on the model. OpenAI’s rule of thumb of about four characters per token applies to English; according to the vendor, other languages work out differently. The exact figure comes from the vendors’ counting tools for the model you intend to use.
Author & expert review: Lars Zimmermann · ISO/IEC 42001 Senior Lead Auditor & Senior Lead Implementer · ISO 9001 Senior Lead Auditor · ISO/IEC 27001 Lead Auditor & Lead Implementer (PECB)
An auditor with shop-floor experience and managing director of a manufacturing company, who audits and builds AI management systems and information security. Author of “Stallgeruch” (in German). Verify the credential on Credly · More about me.
Last updated: 02 December 2026. Researched and reviewed to the best of my knowledge. This is my interpretation from practice. For legal advice, please turn to the appropriate professionals.
Questions about your own case?
In a free 15-minute intro call we assess where you stand on ISO 42001, ISO 27001 and the EU AI Act, honestly and without a sales pitch.