The model does not read your paragraph the way you do. It gets a sequence of tokens and predicts what comes next. Remember that and a lot of mysterious LLM behaviour becomes easier to debug.

Tokens are chunks of text, not always whole words

A tokenizer turns text into a sequence of token IDs. Common words may be a single token. Rare names, misspellings, code fragments and other scripts can break into several. The model receives the token sequence and ultimately emits one token at a time. It does not directly see a sentence as the single object your eyes perceive.

This explains two practical surprises. First, a long name can consume more context and cost than expected. Second, a typo or uncommon spelling may be harder because it produces a less familiar pattern. Inspect token counts when a prompt unexpectedly hits a budget or the API bill rises.

Next-token prediction creates capability and limits

A language model estimates what token should follow the context so far. Training on large collections of text teaches patterns that let it continue requests in useful ways. Instruction tuning and other training stages shape how those completions behave. The model produces fluent answers because fluent continuations are often plausible, not because every sentence was checked against the world.

That is why an answer can sound confident while being wrong. Generation is not the same as retrieval or verification. If the task requires fresh facts, retrieve reliable material and check the output. If the task requires a command, validate it before execution.

The context window is working memory, not permanent knowledge

Context is the material presented for the current model call: system instructions, conversation, retrieved passages, tool output and sometimes earlier summaries. A context window limits how much can be processed in one request. Putting more text into the window does not guarantee that the model will attend to every detail equally.

When a conversation exceeds a practical limit, systems may truncate or summarize. Keep critical facts concise, keep sources close to the question, and ask the model to quote or point to the evidence it used. A longer prompt can add distracting material and cost. A shorter prompt that includes the right passages may work better.

Why the transformer metaphor helps

Transformers use attention mechanisms to relate elements of an input sequence. That lets each token's representation incorporate information from other positions, with learned projections and multiple layers. In the 2017 paper Attention Is All You Need, the authors introduced a transformer architecture that relied on attention rather than recurrence and convolution as the central sequence mechanism.

You do not need to derive the full equations to build a responsible application. You do need to know that context processing has compute and memory costs, that model behaviour depends on what text is present, and that longer context alone does not promise equal recall. When a result changes, compare the input context and retrieval output before blaming the model weights.

FOLLOW THE EVIDENCE

Sources & further reading

Process note: AI tools assisted with research and drafting. Sources are linked so you can inspect the evidence. Unless an essay says otherwise, it does not claim hands-on testing or independent reproduction.

  1. Hugging Face NLP course: Transformers
  2. Attention Is All You Need
  3. OpenAI tokenization guide