What Is an LLM? How Large Language Models Actually Work (Plain-English Guide, 2026)

LLMs don't look facts up; they predict the next piece of text. Here's how tokens, training, context windows, web search and 'thinking' models actually work, and when to trust the answers.

By Khaled Jabr · 8 min read · March 25, 2026

اقرأ هذا المقال بالعربية

What Is an LLM? How Large Language Models Actually Work (Plain-English Guide, 2026)

The single most consequential misunderstanding about large language models is that they "know" things the way a search engine or a database does. They don't. What they actually do is predict the next most likely piece of text, over and over. Once that clicks, almost every strange thing they do makes sense: the confidently wrong answers, two different replies to the same question, and why a five-word prompt and a five-paragraph prompt sometimes land you in the same place.

This guide explains how an LLM works in plain language: what it reads, how it was trained, what its "memory" really is, why it makes things up, and how modern assistants like ChatGPT, Claude and Gemini wrap extra tools around it. It ends with a simple rule for when to trust the output and when to check it.

It's autocomplete, just enormously bigger

You've already used a weak version of this technology: the predictive text on your phone that suggests the next word as you type. Type "The capital of France is" and it will probably suggest "Paris". Your phone doesn't know geography; that word simply follows that phrase constantly in the text it learned from.

A large language model does the same thing at a scale that's hard to compare to anything else. It was trained on a huge slice of written text, and it doesn't only look at the last word. It weighs everything you've written so far, near or far, to decide what most plausibly comes next. Then it adds that piece to the text and repeats, one piece at a time, until the answer is finished.

That is the whole core mechanism. There is no lookup inside the model, no database query and no fact-checking step. Every response is a very sophisticated answer to one question: "given everything so far, what comes next?"

What the model actually reads: tokens

Models don't read words or letters. They read tokens: chunks of text that are often a whole short word, part of a longer word, or a piece of punctuation. OpenAI's rule of thumb for English is that one token is roughly four characters, or about three-quarters of a word, so 100 tokens is around 75 words. Other languages, including Arabic, can split into tokens differently, so the same sentence may cost a different number of tokens.

Tokens matter for three practical reasons:

  • Prices and limits are counted in tokens. When a provider says a model accepts a certain context length or charges per million tokens, this is the unit.
  • It explains some odd weaknesses. Because a model sees "strawberry" as one or two chunks rather than ten letters, tasks like counting letters or reversing a word can trip it up even when it writes fluent essays.
  • Long pasted documents fill the budget fast. A 40-page report can be tens of thousands of tokens before you've asked a single question.

How it learned: two very different stages

Stage one is pretraining. The model reads an enormous amount of text and plays one game billions of times: hide the next token, predict it, adjust slightly when wrong. The architecture that made this work at scale is the Transformer, introduced by Google researchers in the 2017 paper "Attention Is All You Need". Its key idea, attention, lets the model weigh how relevant every earlier token is when predicting the next one. That is why it can connect a pronoun in your last sentence to a name you mentioned ten lines earlier.

A model that has only been pretrained is a powerful text predictor, but not a helpful assistant. Ask it a question and it might continue with three more questions, because that's a plausible continuation of a list of questions.

Stage two is post-training. The model is trained further on examples of good instructions and good answers, and then with human feedback: people compare possible responses, and the model is pushed toward the ones they prefer. OpenAI's 2022 InstructGPT paper showed how much this matters: human raters preferred answers from a 1.3-billion-parameter model trained this way over a 175-billion-parameter model without it. Post-training is where the polite tone, the refusals, the formatting habits and much of the "personality" of each assistant come from.

This two-stage picture explains why different assistants feel different even when they're built on similar ideas. The base prediction engine is similar in spirit; the post-training decides how it behaves.

Its "memory" is a context window

An LLM has no memory between separate conversations unless the product adds one. Within a conversation, everything it knows about you lives in the context window: the text of the chat so far, any files you attached, and instructions the product adds behind the scenes. On every turn, the whole conversation is sent to the model again and it predicts the reply from scratch.

Context windows have grown fast. Some current models accept around a million tokens, enough for several books. But a bigger window is not perfect recall. In very long conversations, details from early on can carry less weight, and an instruction you gave at the start can quietly stop being followed. If a long chat starts drifting, starting a fresh conversation with a short summary of what matters usually works better than arguing with it.

Some assistants now offer a separate "memory" feature that saves facts about you between chats. That's a product feature built on top: the app stores notes and inserts the relevant ones into the context window later. The model itself still learns nothing new from your conversation.

Why it gets things wrong, confidently

Ask an LLM about a well-documented topic, like a major historical event, a mainstream programming concept or how photosynthesis works, and it is usually right. When a topic appears often and consistently in the training text, the plausible continuation and the correct continuation are almost always the same.

Ask it about a specific court case, an obscure date, a niche academic paper or a small company's pricing, and the failure looks different. It rarely says "I don't have enough information." It produces the most plausible-sounding continuation anyway: a real-sounding case name, a specific-sounding date, a confident price. This is usually called a hallucination. It isn't lying, because lying requires knowing the truth and saying something else. The model is doing exactly what it does everywhere else; here, plausible and correct have simply come apart.

Two more effects make this worse:

  • A knowledge cutoff. The training text stops at some date. Anything that changed after it, such as a new law, a price change or this week's news, is invisible to the model itself. It may still answer as if its old information is current.
  • Deliberate randomness. When choosing the next token, models usually don't always take the single most likely option; a setting often called temperature lets them pick among several good candidates. That makes writing less robotic, and it also explains why asking the same question twice can give two different answers, sometimes one right and one wrong.

"But my assistant can search the web"

This is the most common source of confusion in 2026, and the answer is that the model and the product are different things. ChatGPT, Claude and Gemini are apps built around a model. The app can give the model tools: a web search, a code runner, a calculator, access to your uploaded files or connected apps. When the model decides it needs one, the app runs the tool and pastes the results into the context window, and the model writes its answer from that.

This is called grounding or retrieval, and it helps a lot with recent or specific facts. But it moves the risk rather than removing it. The answer is now only as good as the pages it found and how faithfully the model summarized them. A cited source is a gift: open it and check that it really says what the answer claims.

Models that "think" before answering

Many current models can produce a stretch of hidden or visible reasoning before their final answer: working through a math problem step by step, planning code before writing it, or checking a draft against the question. It's the same next-token mechanism, pointed at writing out intermediate steps first. On multi-step problems this measurably improves results; on simple questions it mostly adds time and cost. It also doesn't fix missing facts. A model can reason flawlessly from a wrong number.

Why it still feels intelligent

None of this is a reason to dismiss these tools. The same mechanism that produces confident fabrications also produces genuinely useful writing, explanation and reasoning. Human writing is full of careful arguments, clear explanations and working code, and predicting "what would a careful explanation of this look like" very often produces one. The skill is knowing which mode you're in: for topics with deep, consistent coverage in general knowledge, prediction and correctness line up well. For anything specific, recent, numeric or obscure, they often don't.

A practical trust guide

  • Use freely, as a draft: rewriting and editing your own text, brainstorming options, explaining well-known concepts, summarizing a document you gave it, drafting emails and outlines, first-pass code you will run and test.
  • Use, then verify: anything with numbers, dates, names, prices, laws or quotes; summaries of web results; medical, legal or financial explanations; claims about recent events. Ask for sources, then open them.
  • Don't rely on it alone: final decisions with legal, medical or financial consequences, exact citations for academic work, and any fact you can't check yourself and can't afford to get wrong.

Two habits catch most problems. First, give it the source material instead of asking it to remember: paste the policy, attach the report, link the page. Second, ask it to point to where in that material each claim comes from. Answers drawn from text you supplied are far more reliable than answers drawn from what the model absorbed in training. (For more on getting better answers, see our guide on how to write a prompt that actually works.)

The mental model that actually helps

Stop picturing a librarian who looks things up. Picture a writer who has read an almost unimaginable amount and instantly produces the response that sounds most like what a knowledgeable person would say, with no built-in step that checks whether it's true. Some apps hand that writer a search engine and a calculator, which helps. But the writer is still the one producing every sentence. That picture tells you when to trust the output at face value and when to check before you rely on it.

Sources: Vaswani et al., "Attention Is All You Need" (2017); Ouyang et al., "Training language models to follow instructions with human feedback" (OpenAI, 2022); OpenAI Help Center, "What are tokens and how to count them?"; Anthropic Claude Platform documentation on context windows (checked October 2026). Context window sizes and product features change often; check your assistant's current documentation.

Related articles