Draft & Co LearnCourse home
Lesson 03 · 15 minutes

Tokens, context and uncertainty

Build a practical mental model of what a language model sees, when it is trained, and why its confidence is not proof.

01

Tokens and the context window

A language model processes text as tokens: pieces of characters, words or punctuation, rather than reading exactly as a person does. A token might be a whole common word, part of a longer word, or a space and punctuation. This is why word count is only a rough guide to model limits. The context window is the amount of material the model can consider at one time. It can include your instruction, earlier messages, supplied documents and the answer being generated. A large window does not guarantee that every detail will be used well. Put essential instructions near the material they govern, remove irrelevant repetition, and divide very large jobs into reviewable parts instead of assuming everything will receive equal attention.

02

Training is different from inference

Training is the process that adjusts a model’s internal parameters using examples and a training objective. Inference is the later process of using those learned parameters to produce an output from your input. When you chat with a hosted model, you are normally performing inference, not retraining it with each message. Product features such as saved memories or conversation history can still change what is supplied at inference, so read the product’s settings rather than making assumptions. Fine-tuning is a separate, deliberate training process. Knowing this difference prevents two common mistakes: believing a model automatically learns your private conversation as general knowledge, and believing a cleverly worded prompt permanently changes the underlying model.

03

Hallucination and useful uncertainty

A hallucination is generated material presented as fact when it is false, invented or unsupported. It can appear as a plausible date, quotation, citation or explanation. Models generate likely continuations from patterns; fluent wording is not a built-in verification step. Some products add retrieval or checking tools, but those also need evaluation. Ask for supporting evidence when it matters, inspect the evidence yourself, and treat an expression of uncertainty as a prompt to investigate rather than proof of safety. For an important answer, use authoritative sources and record what you checked. If the supplied material does not contain the answer, instruct the tool to say so. A visible gap is more useful than a confident guess.

Words worth knowing

In plain English.

Token
A small unit of text, such as part of a word or punctuation, that a language model processes.
Context window
The limited amount of input and generated content a model can consider during one inference request.
Training
The process of adjusting model parameters from data and a training objective.
Inference
Using an already trained model to produce an output from a new input.
Hallucination
Generated material that is false, invented or unsupported but presented as factual.
See it in practice

Worked example: checking a long handbook

  1. Choose one question about a handbook instead of asking for every possible summary at once.
  2. Supply the relevant section and ask: ‘Answer only from this extract. Quote the sentence that supports your answer; if it is absent, say Not covered.’
  3. Compare the quoted sentence with the extract and check whether it actually answers the question, including exceptions and dates.
  4. Repeat for other sections, keeping a list of questions the handbook does not answer.

Why this works: Smaller relevant context makes review manageable. The quotation requirement gives you something concrete to verify, while ‘Not covered’ makes missing information explicit.

Your turn

Try it for yourself.

Write a short prompt that asks a model to answer one question from a document extract. Include an instruction for missing information and a way to show which text supports the answer. Then describe your own verification step.

Saved only in this browser. Clearing browser data or resetting course progress will remove it.
View a sample answer

Sample: ‘Using only the extract below, state whether bicycles may be stored in the shared hallway. Return Answer, Supporting sentence and Exceptions. If the extract does not address it, write Not covered rather than inferring a rule.’ I would locate the supporting sentence myself, read the surrounding paragraph, and check any building notice with a later date before relying on the answer.

Check your understanding

Three quick questions.

Answer all three, then check. Nothing is sent anywhere.

Question 1What happens during inference?
Question 2What does a larger context window guarantee?
Question 3Which response is most useful when evidence is missing?
Keep going

Finished reading and practising?

Mark the lesson complete when you are ready. The quiz is for learning, not a pass/fail gate.

For an optional technical introduction to language models, visit Hugging Face’s LLM course. Open the LLM course introduction ↗