Contact and servicesmarcelo2020.it@gmail.com
Knowledge & Prompt LabManzo
AI Academy · M02

How does a language model work?

Understand tokens, context, training and inference

M02 · Estimated time: 25–30 minOwner approved · 27 October 2026

Approved and published learning content. Examples are illustrative; exercises have not yet been field-tested with learners. Recheck source relevance and currency for professional use.

1. Observable learning objectives

  1. Distinguish a model from an application and external tools.
  2. Explain tokens, training, inference and context windows without coding.
  3. Explain why fluent writing can still be wrong.
  4. Suggest two practical checks for an LLM answer.

Prerequisites: M01 or equivalent familiarity with AI as a broad field.

2. Lesson

2.1 A model is not a chat interface

ChatGPT, Claude and Gemini are products with interfaces, features and model choices. A language model is trained to process sequences and generate plausible continuations. A chat is one interface. A product might also add search, calculation or document retrieval, and those capabilities should not automatically be attributed to the underlying model. [S2][S3]

2.2 Tokens: the processing units

Text is represented as tokens: these may correspond to words, word fragments or other units. The model processes these representations in context and estimates appropriate continuations. “Advanced autocomplete” is a helpful beginner analogy, but it is not a complete account of what modern language systems can do. [S3]

2.3 Training is different from inference

Training adjusts model parameters using data and optimization procedures. Further stages may improve instruction following. Inference is the step when a prepared model processes a new input and produces output. A single chat message does not by itself permanently retrain its weights. Separate product policies determine how users’ data may be retained or used; those must be checked in context. [S2][S3]

2.4 Transformers and the context window

Many current LLMs belong to the Transformer family described in the 2017 paper “Attention Is All You Need”. Attention mechanisms help represent relationships among pieces of a sequence. A context window sets a limit on information available in an interaction; even a large window is not unlimited human-like memory or a guarantee that every detail will be used correctly. [S3][S11]

2.5 Why verification matters

A model can confidently supply a wrong date or a fabricated citation. Live web lookup is not always active, and a cited passage may not support the claim attached to it. For meaningful decisions, verify important statements against original records and separate plausible language from supported findings. [S7]

3. Worked example, original MANZO AI material

Scenario: You need to summarize course attendance rules.

Initial request:

Summarize the rules and tell me how many sessions I can miss.

Improved request / sound next step:

Use only the course policy I provide. Identify and quote the sections about absence limits. If the policy does not specify a limit, state “not specified”. Do not infer a rule from missing information.

Analysis and limitations: A model can organize the text but the actual policy must be inspected. Without the document, it should not pretend to know its provisions.

4. Independent exercise

Why might a chatbot get a historical date wrong while sounding confident? Suggest two ways to check.

Explained solution

Fluent output does not prove access to verified archives. Check a primary document and a reputable historical account describing the same event.

5. Quiz with reasoned answer key

Q1. Is one token always a whole word?

Reveal the explained answer

A1. No. Tokens can be word fragments or other units. [S3]

Q2. Does every chatbot answer involve browsing the web?

Reveal the explained answer

A2. No. That depends on which tools are actually in use. [S2]

Q3. Does a larger context window guarantee factual accuracy?

Reveal the explained answer

A3. No. Context capacity is not an accuracy certificate. [S3]

6. Assessment rubric

  • 1. Separates products, models and tools. — 0 = absent, 1 = partial, 2 = clearly demonstrated.
  • 2. Describes tokens and inference accurately. — 0 = absent, 1 = partial, 2 = clearly demonstrated.
  • 3. Identifies one limitation and two feasible checks. — 0 = absent, 1 = partial, 2 = clearly demonstrated.

Max: 6 — thresholds are provisional and not externally validated.

7. Limits, privacy and application

Do not paste unnecessary personal or confidential information. An AI summary cannot replace checking an official document when the outcome matters.

8. Sources and traceability

9. Links to other modules

Review M01 and then move to M03 to learn to define tasks and constraints clearly.