Boards are approving significant AI budgets while, in many cases, nobody in the room can explain what the technology actually does. That gap matters. If you cannot describe how a large language model produces an answer, you cannot properly interrogate its risks, its costs, or the claims your vendors make about it. So how does an LLM work? This guide walks through the LLM pipeline from raw data to generated response, in plain language, and then draws out what each stage means for the people who sign the cheques.
I have spent the last few years deploying AI and automation into real organisations, including programmes that released around 75,000 hours of annual capacity through RPA and AI. The single biggest predictor of success I have seen is not the model chosen. It is whether the leadership team understood, at a working level, what the technology was doing. This article is designed to give you that working level.
The LLM Pipeline at a Glance
Every large language model, whether it sits behind ChatGPT, Claude, Copilot or a private enterprise deployment, follows broadly the same pipeline. It splits into two halves.
The first half is how the model is built: data collection, data cleaning, tokenisation, embedding, pretraining and fine-tuning. This happens once, at enormous cost, usually by the model vendor.
The second half is how the model answers you: your prompt goes in, relevant information is assembled into a context window, the attention mechanism weighs what matters, and the model generates a response one token at a time before the output is evaluated for quality and safety. This happens every single time anyone in your organisation types a question.
Understanding both halves is what separates informed oversight from hopeful procurement.
How a Large Language Model Is Built
Data collection and cleaning
Models begin with vast quantities of text: books, websites, research papers and code. Before any learning happens, that raw material is cleaned. Duplicates are removed, noise is stripped out, and low-quality content is filtered.
The board-level point here is provenance. The data a model was trained on shapes what it knows, what it gets wrong, and where the intellectual property and privacy exposures sit. When you assess an AI vendor, questions about training data governance are not academic. They are the equivalent of asking a supplier where their raw materials come from.
Tokenisation and embeddings
Models do not read words. Text is broken into tokens, small chunks of characters, so "Hello World" becomes something like "Hello" and "World". Each token is then converted into an embedding, a long list of numbers that captures its meaning. Text becomes mathematics.
This is also why AI pricing is denominated in tokens. Every document your teams feed in and every answer that comes back is metered this way, which is why costs can drift far beyond the licence fee if usage is ungoverned. I covered the commercial side of this in Which AI Model Is Right for Your Organisation: Microsoft Copilot or Claude?.
Pretraining and fine-tuning
Pretraining is where the heavy lifting happens. The model processes its training data through a neural network billions of times, gradually learning the statistical patterns of language. This is the expensive part, and it is why frontier models are built by a handful of firms with the capital to do it.
Fine-tuning comes afterwards. The general model is adapted for specific behaviours: following instructions, refusing harmful requests, or specialising in a domain such as legal drafting or customer service. For most organisations, fine-tuning or configuring an existing model is where the practical opportunity lies, not building one from scratch.
How an LLM Generates a Response
Prompts and the context window
When someone asks a question, the prompt is combined with whatever supporting information the system supplies, such as retrieved documents, prior conversation and system instructions. All of it must fit into the context window, the model's working memory for that exchange.
The context window is finite. Anything outside it simply does not exist for the model in that moment. This is why enterprise AI tools lean on retrieval, fetching the most relevant internal documents and placing them into the window at the moment of the question. When a vendor talks about the model "knowing your business", this is usually what they mean, and it is worth probing exactly what data is being retrieved, from where, and under what access controls.
Attention, inference and next-token prediction
Inside the model, the attention mechanism works out which parts of the input matter most to which other parts. In the sentence "the cat sat on the mat", attention is what links "sat" to "cat" rather than to "mat".
Then comes inference: the model predicts the next token, then the next, then the next, each choice conditioned on everything before it. There is no database lookup and no reasoning engine in the conventional sense. A fluent, confident paragraph is assembled one probabilistic prediction at a time.
That mechanism is the source of both the magic and the risk. It is why LLMs are extraordinarily capable with language, and why they can be confidently wrong.
Why LLMs Hallucinate
An LLM hallucination is a fluent answer that is factually false. It happens because the model is optimised to produce plausible next tokens, not verified facts. If the training data was thin on a topic, or the prompt pushes beyond what the context window contains, the model will still generate something, and it will sound authoritative.
Hallucination is not a bug to be patched next quarter. It is a structural property of next-token prediction. The mitigation is architectural and procedural: grounding responses in retrieved, verifiable sources, keeping humans in the loop for consequential decisions, and building evaluation into deployment. This is precisely the territory of an effective AI model risk management operating model, and it is where governance earns its keep.
What the LLM Pipeline Means for Your Board
Once you understand the pipeline, the governance agenda writes itself.
Data in means data out somewhere. Anything your people paste into a public AI tool enters someone else's pipeline. Enterprise agreements, data processing terms and clear usage policies are not optional extras.
Costs live in the second half of the pipeline. Building the model was the vendor's expense. Inference, every prompt and every token generated, is yours. Usage governance belongs alongside licence negotiation.
Evaluation is a discipline, not a demo. The final stage of the pipeline, checking outputs for quality, accuracy and safety, is the stage most organisations skip. Deployments that release genuine capacity, of the kind I have delivered at scale, all had measurement built in from the start.
Accountability cannot be delegated to the model. The model predicts tokens. Your organisation makes decisions. Directors' duties do not change because the drafting was automated, a theme I explore further in AI in the Boardroom.
None of this requires the board to become machine learning engineers. It requires enough fluency to ask the second question, the one after the vendor's polished answer.
Frequently Asked Questions
How does an LLM work in simple terms?
A large language model is trained on vast amounts of text to learn the statistical patterns of language. When you ask it a question, it predicts the most likely next word fragment, called a token, over and over until a complete answer is formed. It is sophisticated pattern prediction, not database lookup.
What is the LLM pipeline?
The LLM pipeline covers the full journey from raw data to generated answer: data collection, cleaning, tokenisation, embedding, pretraining and fine-tuning on the build side, then prompt input, context window assembly, attention, inference, response generation and evaluation on the response side.
What is tokenisation in AI?
Tokenisation is the process of breaking text into small units called tokens, which the model can convert into numbers and process mathematically. It also underpins commercial pricing, as AI usage is typically billed per token processed and generated.
What is a context window in an LLM?
The context window is the model's working memory for a single exchange: the prompt, any retrieved documents, and the conversation so far. It is finite, and anything outside it is invisible to the model when it answers.
Why do LLMs hallucinate?
LLMs generate answers by predicting plausible next tokens rather than retrieving verified facts. When the training data or context is thin, the model still produces fluent output, which can be confidently wrong. Grounding, human oversight and structured evaluation are the practical mitigations.
Do boards need to understand how LLMs work?
Yes, at a working level. Directors remain accountable for decisions informed or automated by AI. Understanding the pipeline enables the board to interrogate vendor claims, govern data exposure, control inference costs and set proportionate risk controls.
Bring Board-Level AI Judgement Into Your Organisation
Understanding how an LLM works is the foundation. Turning that understanding into a governed, value-producing AI capability is the harder step, and it is where most programmes stall. As a fractional Chief AI Officer I help boards and executive teams move from AI curiosity to accountable delivery, with the governance to match.
Explore my services or the Fractional Chief AI Officer page, or get in touch for a confidential conversation about where AI genuinely fits in your organisation.