# LLMs

> How large language models work: tokens, context windows, training, alignment, and what each one means for how your content is read.

Canonical: https://promptlyfound.com/llms
Updated: 2026-11-20

What an AI answer says about a brand depends on what the model learned in training and on which pages sit in its context window when it answers. Only pages in the context window can be cited. A large language model (LLM) is a neural network trained on large amounts of text to predict the next token, and chat assistants and AI search products use LLMs to write their answers.

## Training and inference

An LLM has two phases. In training, the model reads large collections of text and adjusts its parameters, the numerical weights that define how it processes text, each time it predicts the next token wrongly. Training ends with fixed weights and a knowledge cutoff, the date after which the training data contains no information.

In inference, the trained model answers a prompt. It predicts one token, adds it to the text, and repeats until the answer is complete. The model does not learn from the prompt and has no database of facts to look up. Its output depends on its weights and on the text in its context window. [How large language models work](https://promptlyfound.com/llms/how-llms-work) describes both phases.

The two phases are the two routes by which a page can reach an AI answer. A page in the training data can shape what the model knows, but the model cannot cite it. A page retrieved at answer time sits in the context window, and the system can link to it. [Retrieval-augmented generation](https://promptlyfound.com/ai-search/rag) covers the second route, and [Common Crawl](https://promptlyfound.com/crawlers/common-crawl) covers one of the main sources of training data.

## Tokens and the context window

Models read and write text in [tokens](https://promptlyfound.com/llms/tokens): whole words, parts of words, characters or punctuation. OpenAI estimates that 100 tokens are about 75 English words. The ratio depends on the tokenizer, and a provider can change it when it ships a new one. Anthropic's tokenizer for Claude Opus 4.7 and later produces about 30% more tokens for the same text than its earlier tokenizer.

The context window is the number of tokens a model can work with in one request. The system prompt, the conversation, any retrieved pages and the answer all share it. Current flagship models from OpenAI, Anthropic and Google accept about 1 million tokens. A larger window holds more sources, but models use information at the start and end of a long context more reliably than information in the middle. Anthropic's documentation says accuracy and recall degrade as the token count grows.

These limits shape how a page is read in AI search. The model sees passages of a page alongside passages from other sources, and developer search tools cap how much text they extract from each page. A passage that states its claim in its first sentence keeps the claim near the start of the extract.

## The Transformer

Current LLMs are built on the Transformer, an architecture introduced in 2017 by eight researchers at Google in the paper "Attention Is All You Need". Its self-attention mechanism lets each token weigh every other token in the input. The Transformer processes a whole sequence in parallel, which made training at large scale practical. [What the Attention Is All You Need paper introduced](https://promptlyfound.com/llms/attention-is-all-you-need) traces the line from that paper to the models behind ChatGPT, Claude, Gemini and Google AI Overviews.

## Alignment

Alignment is background knowledge for your team rather than something a site can act on. No published study has shown that the alignment method changes which pages a model cites. Providers add a second stage of training so that a model follows instructions and avoids harmful answers. OpenAI used reinforcement learning from human feedback (RLHF) for InstructGPT and ChatGPT: people ranked model outputs, and the model learned to prefer the higher-ranked ones. Anthropic developed Constitutional AI for Claude, in which the model critiques its own outputs against a written set of principles and AI feedback replaces human labels for harmlessness.

[How RLHF and Constitutional AI differ](https://promptlyfound.com/llms/rlhf-vs-constitutional-ai) compares the two methods and grades the claims made about them.

## Hallucination and grounding

A model asked about something outside its training data still generates the most likely continuation of the prompt. That continuation can be false, and the error is called hallucination. Retrieval reduces it by putting sources in the context window before the model writes, a practice providers call [grounding](https://promptlyfound.com/ai-search/grounding). Google Cloud says grounding reduces the chances of invented content, and does not say that it removes them.

For a page, the mechanics lead to a short list of requirements. The page must be crawlable and indexed to be retrieved. Each passage should make one claim that makes sense on its own. The page should contain information the model cannot produce from training, such as original data or first-hand experience. [The AI search section](https://promptlyfound.com/ai-search) explains how retrieval systems find and select those passages.

---

This is a plain-text copy of https://promptlyfound.com/llms from Promptly Found. The web page is the canonical version and includes the charts.
