Skip to content

Article · 11 min read · Oct 31, 2026

How do LLMs work? A plain-English guide for people who buy and run them

A large language model (LLM) reads text as tokens, turns them into numbers, and uses attention to predict the next token, over and over, until a reply is complete. It generates likely text instead of looking facts up, which is why you test it against your own work, ground it in your documents, and keep a person approving consequential actions. This guide is for operations and IT leaders at companies of roughly 20 to 200 people.

Farzan AnsariCofounder and CTO

Key takeaways

  • An LLM predicts the next token from patterns learned in training, so a fluent answer is not evidence that the answer is true.
  • Temperature and sampling settings change how varied the output is, and they do not make a wrong answer right.
  • Hallucinations follow from how models are trained and scored, so plan for them with grounding in your documents and with tests.
  • Tool use lets a model request an action that your own software then runs, which is where a named person can approve or refuse.
  • Recent advances such as reasoning modes, mixture-of-experts and small open-weight models change cost and deployment options, and every claim should be tested on your own work.

Most buying and risk conversations about AI go wrong at the same point. Someone treats a large language model (LLM) as a search engine that knows things, or as a person who understands the task. It is neither, and the way it actually works explains nearly every behavior that surprises teams in production: confident wrong answers, different results on repeated runs, and bills that depend on text length. This guide covers the mechanics in plain English, then the recent changes in model design as of October 2026, then what each one means for a buyer.

How do LLMs work in one page?

An LLM is a program that predicts the next piece of text. It splits your input into tokens, turns each token into a list of numbers, uses a mechanism called attention to work out which earlier tokens matter, and outputs a probability for every possible next token. The system picks one, appends it, and repeats until the answer ends.

That loop produces fluent writing, working code and useful summaries. It also means the model has no separate fact store to consult. Everything it "knows" is encoded in numerical weights learned during training. The table below links each mechanism to the decision it should change.

MechanismWhat it isWhat it means for a buyer
TokensPieces of text, often parts of wordsCost, speed and limits are measured in tokens, so long documents cost more
EmbeddingsNumbers that represent the meaning of a token or passageThey power document search, which is how you ground answers in your files
Attention and the transformerA way to weigh how much each token relates to the othersIt lets a model use the whole prompt as context, so what you put in the prompt shapes the answer
TrainingLearning weights from huge text collections, then from human feedbackKnowledge is frozen at a cutoff date, and the model cannot reliably say where a fact came from, so any citation it produces needs checking
InferenceRunning the trained model to answer a requestEach answer is generated fresh, and each request is billed
Temperature and samplingHow much randomness enters the choice of the next tokenRepeated runs can differ, so you test many runs, not one
HallucinationA fluent answer that is falseNeeds grounding, tests and review, not a better prompt alone
Context windowThe text the model can use in one requestBigger is not automatically better, and it is not a database
Tool useThe model asks your software to run an actionThe natural point for a named person to approve consequential steps

What are tokens, embeddings and attention?

A token is the unit of text a model reads and writes. Models do not work on whole words; they split text into subword pieces. Byte pair encoding, discussed in a 2015 paper on translating rare words, is one common way to build that vocabulary, so a rare name might become several tokens while "the" is one. Providers price and limit usage by tokens, which is why a 40-page contract costs more to process than a two-line email.

An embedding turns a token or a passage into a long list of numbers, a vector, so that similar meanings sit close together. Word2vec, published in 2013, showed that learned vectors capture relationships between words. Embeddings are now also used on whole passages: Anthropic's documentation describes them as numerical representations of text that let you measure semantic similarity, which is the basis of search over your documents.

Attention is how the model decides which other tokens matter for the one it is processing. In the sentence "The invoice was late because it was never approved," attention helps link "it" to "invoice". A 2014 paper on machine translation introduced a soft search over the parts of the source sentence relevant to each output word. The 2017 paper Attention Is All You Need built the transformer, an architecture that relies entirely on attention, and reported that it was more parallelizable and trained faster than recurrent and convolutional designs. Most major LLMs since have been transformers or close variants of one.

How is a model trained, and what happens at inference?

Training is the one-time, expensive stage where the weights are set. Pretraining feeds the model enormous amounts of text and rewards it for predicting the next token correctly. The GPT-4 technical report describes its model as a transformer pretrained to predict the next token in a document, followed by post-training alignment that improves factuality and adherence to intended behavior.

Post-training is where a raw text predictor becomes an assistant. The InstructGPT paper fine-tuned GPT-3 on human demonstrations, then used reinforcement learning from human feedback, where people rank outputs. In OpenAI's human evaluations, outputs from the 1.3 billion parameter InstructGPT were preferred over those from the 175 billion parameter GPT-3, so training method mattered more than raw size in that comparison. The history behind these steps is covered in our history of large language models.

Inference is what happens when you send a request. The weights are fixed, and the model computes a probability for each possible next token, chooses one and repeats. Your prompt does not change the weights. That has a practical consequence: the model does not retain your company's facts between requests, so anything it needs, including events after its training data ended, must be supplied in the request.

What do temperature and sampling change?

They change how adventurous the next-token choice is. The simplest method, greedy decoding, always picks the most probable token. Sampling instead picks at random in proportion to the probabilities. As a Hugging Face explainer describes it, lowering the temperature makes the probability distribution sharper, which favors likely tokens and approaches greedy behavior as it nears zero. Top-p, or nucleus, sampling chooses from the smallest set of tokens whose probabilities add up to a threshold.

Neither setting adds knowledge. Low temperature gives steadier phrasing and high temperature gives more varied phrasing, but a confidently wrong answer can be steady too. The research on neural text degeneration found that always choosing the highest-likelihood text produced output that was bland and strangely repetitive, and that decoding strategy alone can change text quality substantially. OpenAI also noted at ChatGPT's launch that the model was sensitive to small changes in phrasing and to retrying the same prompt.

For a buyer, the lesson is to run each test case several times and to review the spread of answers rather than the best one.

Why do language models hallucinate?

A hallucination is a fluent answer that is false. It follows from the design. The model produces likely text, and likely text is not the same as true text. OpenAI's launch post listed the problem plainly: ChatGPT sometimes writes plausible-sounding but incorrect or nonsensical answers, and during reinforcement learning there was no source of truth.

A 2025 paper, Why Language Models Hallucinate, argues that the cause is partly how models are trained and scored. Its authors contend that when benchmarks score answers so that guessing pays off, models learn to behave like good test-takers who guess instead of admitting uncertainty. The GPT-4 report is equally direct that the model is less capable than humans in many real-world settings, despite strong exam scores.

Illustrative example: A distributor's support lead asks a general-purpose assistant, "What is our return window for wholesale accounts?" The assistant answers "30 days" in a confident paragraph, because 30 days is a common figure in its training text. The actual policy is 14 days, stored in a PDF the model has never seen. Nothing in the answer signals the gap. When the same question is routed through a system that retrieves the policy PDF first and shows the paragraph it used, the answer is checkable in seconds.

What are context windows and tool use?

The context window is all the text a model can use in one request, including its own reply. Anthropic's documentation calls it a kind of working memory, distinct from the data the model was trained on, and lists a 1 million token window for many of its current models as of October 2026. The same page warns that more context is not automatically better: as token count grows, accuracy and recall degrade, which it calls context rot. The research paper Lost in the Middle found that models often performed best when relevant information sat at the beginning or end of the input and worse when it sat in the middle.

So a large window is a convenience, not a replacement for good document selection. Our guide to RAG, fine-tuning and prompting explains when to paste material in and when to retrieve it.

Tool use is how a model affects anything outside the conversation. Under Anthropic's description, the model decides when a tool is needed, based on the request and the tool's description, and, for tools you define, returns a structured call that your application runs. Some providers also offer server-side tools, such as web search, that they run for you, and those have no approval step of yours, so leave them off where it matters. The 2023 Toolformer paper showed models learning to choose which APIs to call, with what arguments, and how to use the results. For a business this separation is useful, because the step between "the model asked to refund this order" and "the refund happened" is code you control.

What has changed recently in LLM architecture and development?

Six developments matter for buyers. All dates below are publication dates of the cited papers or documentation, and the performance claims are the authors' own, so none of them substitutes for testing on your work. This section was checked in October 2026.

  • Reasoning modes. The DeepSeek-R1 paper (January 2025) reports that reasoning ability can be improved through reinforcement learning on verifiable tasks, without human-labeled reasoning steps, with behaviors such as self-reflection and verification emerging. In practice, providers let the model spend extra tokens thinking before it answers. Anthropic's documentation states that its fixed-budget extended thinking is deprecated on newer models in favor of adaptive thinking, where the model decides whether and how much to think, and that thinking tokens are billed as output tokens. The business effect is that cost and response time now vary by request.
  • Mixture-of-experts (MoE). An MoE model has many parallel sub-networks in each layer and a learned router that sends each token through only a few of them, so compute per token falls. The full set of weights still has to be loaded into memory. Mixtral (January 2024) selects two of eight experts per token, so each token has access to 47 billion parameters while using 13 billion. The DeepSeek-V4 report (2026) describes a model with 1.6 trillion total parameters of which 49 billion are activated.
  • Long context. The same DeepSeek-V4 report states one-million-token context for both of its models, and that at that length the larger model needs 27% of the single-token inference compute and 10% of the key-value cache of its predecessor, DeepSeek-V3.2. Treat that as an efficiency claim from the authors, and keep the Lost in the Middle caveat in mind.
  • Multimodal input. The GPT-4 report (March 2023) described a model accepting image and text inputs. The Qwen3.5-Omni report (April 2026) describes one model handling text, images, audio and video, with a 256,000 token context.
  • Agentic tool use. Models are increasingly trained to call tools and work through multi-step tasks, as the Toolformer and tool-use documentation above show. The approval question moves from "is the answer right?" to "is the action allowed?"
  • Smaller open-weight models and quantization. The Phi-3 report (April 2024) describes a 3.8 billion parameter model small enough to deploy on a phone. Quantization stores weights in fewer bits: GPTQ (October 2022) reports compressing weights to 3 or 4 bits with negligible accuracy loss, and QLoRA (May 2023) reports fine-tuning a 65 billion parameter model on a single 48 GB GPU. Together these make private or on-premises deployment a realistic option for some workloads.

None of these sources makes the claim that one model is better than another for your task, and neither does this guide. The pattern across them is that cost, speed and deployment options keep shifting, which is why you keep the model replaceable and avoid vendor lock-in.

What does each mechanism mean for a buyer?

Three habits follow from the mechanics.

  1. Test against your own work. Public benchmarks measure other people's tasks, and the hallucination paper above argues that common benchmarks reward guessing. Build a set of real cases with agreed answers, run each several times, and rerun the set whenever the model, prompt or documents change. Our guide to testing AI before production shows how.
  2. Ground answers in your documents. Because the model predicts rather than looks up, anything that must be accurate and current should come from retrieved text that the user can inspect. Retrieval also lets you enforce who may see which document.
  3. Keep a person approving consequential actions. Because a tool you define produces a proposed call that your software executes, you can require approval before refunds, payments, customer emails or record changes. Match the level of review to the cost of a wrong action.

Some tasks do not need an LLM at all. If the input is a spreadsheet and the output is a number or a category, a conventional statistical model is usually cheaper, easier to explain and easier to test. Choose a language model when the input or the output is language.

How Kastling approaches this

Kastling's AI Integration & Automation work starts from the business task, not the model. That means understanding the workflow first, connecting the systems a business already uses, keeping a named person in control of consequential decisions, and agreeing up front how success will be measured and how data is accessed and owned.

Model choice is made late and kept replaceable. Answers are tested against real business scenarios before anything goes live, and cloud deployments run on AWS or Azure. Scope, responsibilities and operating costs are set out in the proposal, with no promises about what a model will do before it has been tested on your data.

Questions

Do LLMs understand language?

They model the statistical structure of language well enough to summarize, translate and answer questions, and whether that amounts to understanding is still argued among researchers. For a business decision the useful question is narrower: does it get your task right, on your documents, often enough? Only a test on your own examples answers that.

Why does the same question give different answers?

Most systems pick each token with some randomness, so repeated runs differ. OpenAI noted at ChatGPT's launch in 2022 that the model was sensitive to small changes in phrasing and to repeating the same prompt. Providers also retire and replace models, so an answer can change when the model behind a name changes, which is another reason to keep a fixed test set.

What is the difference between an LLM and a chatbot?

The LLM is the model that predicts tokens. A chatbot is a product around it: a system prompt, conversation memory, document search, tools and a user interface. Many business failures come from the product layer, such as missing permissions or poor retrieval, and not from the model.

Is our data used to train the model when we call an API?

That depends on the provider, the plan and the contract, so read the data processing terms for the specific service before sending anything sensitive. Training the original model and answering your request are separate steps, and a request does not change the model's stored weights. Retention, logging and training-use terms are what differ between services.

Sources

  1. arXiv: Neural Machine Translation of Rare Words with Subword Units
  2. Mikolov et al. (arXiv): Efficient Estimation of Word Representations in Vector Space
  3. Anthropic documentation: Embeddings
  4. Bahdanau et al. (arXiv): Neural Machine Translation by Jointly Learning to Align and Translate
  5. Vaswani et al. (arXiv): Attention Is All You Need
  6. arXiv: GPT-4 Technical Report
  7. Ouyang et al. (arXiv): Training language models to follow instructions with human feedback
  8. Hugging Face: How to generate text
  9. arXiv: The Curious Case of Neural Text Degeneration
  10. OpenAI: Introducing ChatGPT (November 30, 2022)
  11. Kalai et al. (arXiv): Why Language Models Hallucinate
  12. Anthropic documentation: Context windows
  13. arXiv: Lost in the Middle: How Language Models Use Long Contexts
  14. Anthropic documentation: Tool use with Claude
  15. arXiv: Toolformer: Language Models Can Teach Themselves to Use Tools
  16. DeepSeek-AI (arXiv): DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning
  17. Anthropic documentation: Extended thinking
  18. arXiv: Mixtral of Experts
  19. DeepSeek-AI (arXiv): DeepSeek-V4: Towards Highly Efficient Million-Token Context Intelligence
  20. Qwen Team (arXiv): Qwen3.5-Omni Technical Report
  21. arXiv: Phi-3 Technical Report: A Highly Capable Language Model Locally on Your Phone
  22. arXiv: GPTQ: Accurate Post-Training Quantization for Generative Pre-trained Transformers
  23. arXiv: QLoRA: Efficient Finetuning of Quantized LLMs

Guide · 16 min read

AI workflow automation: a practical guide for operations teamsAI workflow automation puts AI models inside a defined business process to read, classify and prepare work, while fixed rules, integrations and named people handle the steps that must be predictable. It suits repetitive, document-heavy or request-heavy work such as intake, routing, document checks and approvals. This guide is for operations leaders at companies of roughly 20 to 200 people, mainly in the US and Canada: start with one measurable workflow, keep consequential approvals with an accountable person, and expand only once the numbers show it works.Read

Article · 8 min read

Using Claude and ChatGPT for security audits and red teaming: what worksClaude and ChatGPT are useful first-pass reviewers of your own code, configurations and AI features, and they are weak as a final authority. Use them to find common flaws, explain findings, draft threat models and triage scanner output, keep Semgrep or CodeQL running beside them, and have a person confirm every finding. For regulated systems, an AI pass does not replace an independent penetration test.Read

Article · 7 min read

The history of large language models: a dated timeline and what it means for buyersLarge language models grew out of statistical word prediction, gained their modern shape with the transformer in 2017, and reached the public with ChatGPT in November 2022. The history teaches four things to a business buyer: capability per dollar changes fast, model rankings keep reshuffling, training method matters as much as size, and no single vendor should be a permanent dependency. This guide is for leaders at companies of roughly 20 to 200 people.Read

One useful email a month.

New guides, tools and practical notes on putting AI to work. No sales sequences.

See how an idea becomes a working solution.

Explore how we scope, build and hand over AI projects, with clear decisions at each stage.