Webspinner Academy Introduction to AI · Lesson 3 of 15

Movement II · What It Actually Is Lesson 3

Generative AI and Basic Chat

What happens between pressing Enter and seeing text appear. No jargon, no metaphors that break under pressure, and no claim that the machine is thinking.

Runtime 6:00 Reading time 15 minutes Prerequisites Lessons 1–2 Volatility Low — review annually Sources verified 13 Aug 2026

Learning objective

By the end of this lesson you can explain, without jargon, what a chat model does when you press Enter; you can define token and context window and state the practical consequence of each; and you can write a prompt with all four load-bearing parts present.

3.1  Prediction, not retrieval

Here is the whole mechanism, stated plainly. The model takes everything it can see — your message, the conversation so far, any attached documents — and produces one next chunk of text. Then it adds that chunk to what it can see and produces the next one. Then the next. It repeats until it produces a signal meaning “done.”

That is it. There is no database being queried, no index being consulted, no document being fetched. Text appears one piece at a time, each piece conditioned on everything before it. The word for this is autoregressive generation, and the useful summary is: most AI in use today remains pattern-based prediction — highly effective within the range of its training, and unreliable once you move past it.1

Why this is the most important paragraph in the course

Almost every mistake people make with these systems comes from an unexamined belief that the machine is looking something up. If it were looking things up, a confident wrong answer would be a bug in the database. It is not looking things up, so a confident wrong answer is the system working exactly as designed — producing the most plausible continuation. Lesson 6 turns this into a mechanism you can predict and a habit you can practise.

A caution about the counter-move, because you will meet it. “It's just predicting the next word” is true and is often deployed as though it settled the question of whether these systems understand anything. It does not settle it. Predicting the next word well enough requires representing a great deal about the world the words describe, and researchers disagree sharply about what that amounts to.2 This course takes no position on the philosophy. It takes a firm position on the engineering: the output is a prediction, and predictions can be confidently wrong. That is enough to work from.

3.2  Tokens, context, and the window

The “chunk” above has a name. A token is the unit the model actually reads and writes — not a letter and not quite a word. Common words are usually one token; rarer words split into pieces; punctuation and spaces count. The scheme comes from subword tokenisation methods developed for machine translation, which solved the problem of vocabularies that could never contain every word.3

The working approximation for English: one token is roughly four characters, or about three-quarters of a word.4 A thousand words is therefore something like 1,300 tokens. This matters because tokens are the unit in which these systems are priced, limited, and billed.

FIG-03-01

A sentence, tokenised

One plain English sentence shown twice. Above: as a reader sees it. Below: broken into tokens, each in its own tinted box, showing that common words are single tokens while an unusual proper noun splits into three or four fragments and the leading space belongs to the token. Include a small counter: 11 words · 14 tokens. The insight to land is that the model's units are not our units.

Aspect 3:1 · 3000×1000 px · Brand palette: navy #00040c, silver-blue #a8c0d8, column gold #a87848 · Style: clean typographic diagram

Figure 3.1. Tokens are the model's unit of perception. Roughly ¾ of a word in English, but the boundaries rarely fall where you expect.4

The context window is the total amount of text the model can hold in view at once — your prompt, the conversation history, attached files, and the response it is building, all counted together. It is measured in tokens and it is finite.

Three consequences follow, and all three will bite you:

  1. Nothing outside the window exists. The model has no memory of a conversation you had yesterday unless something puts it back in the window. Apparent memory in a product is a feature built on top, not a property of the model.
  2. Long conversations drift. As a chat grows, early instructions get further from the text being generated, and the model's attention to them thins. When a long chat starts ignoring a rule you set at the beginning, restate the rule rather than complaining.
  3. A large window is not a used window. Advertised context sizes have grown enormous. Performance on material buried in the middle of a very long context is consistently worse than performance on material at either end — a robustly reproduced result usually called the lost in the middle effect.5 Put what matters at the start or the end.

3.3  Why the same question gives different answers

Ask a model the same thing twice and you will often get two different replies. This unsettles people who expect a computer to be deterministic, and the explanation is short.

At each step the model does not produce a single next token. It produces a probability distribution over all possible next tokens. Something then has to choose one. That choosing step is called sampling, and it is deliberately not always the highest-probability option — because a model that always takes the single most likely token produces flat, repetitive, oddly lifeless text. The parameter governing how adventurous the choice is usually surfaces as temperature.

Two practical implications:

  • Variation is a setting, not a malfunction. Where a product exposes temperature, lower it for anything where consistency matters — extraction, classification, formatting — and raise it for drafting and ideation.
  • One good answer is not evidence. If you test a prompt once and it works, you have observed one sample from a distribution. Run it several times before you trust it. This is the first genuinely load-bearing habit in the course, and Lesson 14 builds the rest on it.

3.4  Anatomy of a good prompt

Prompting has attracted a great deal of mystification. The durable part is small enough to memorise: four components, and most weak prompts are weak because two of them are missing.

The four parts of a working prompt
PartWhat it doesWeakStrong
Role Sets the register, vocabulary, and assumed audience — omitted — “You are a technical editor for a non-specialist newsletter.”
Task States the actual job, as a verb “Something about our onboarding docs” “Rewrite the passage below at a 9th-grade reading level.”
Constraints Bounds length, format, tone, and what to avoid — omitted — “Under 120 words. No bullet points. Keep every product name unchanged.”
Examples Shows the target rather than describing it — omitted — “Here is a paragraph we already like: …”

The fourth is the one people skip and the one that does the most work. Lesson 2 established that few-shot behaviour — performing a task from examples supplied in the prompt — was the capability that arrived with scale.6 Supplying an example is not a courtesy to the model; it is the single highest-leverage thing in the prompt, because a specimen of the output you want carries constraints you would never think to write down.

One more technique worth knowing

For problems with several reasoning steps, asking the model to work through them before answering measurably improves accuracy — the finding usually called chain-of-thought prompting.7 Most current chat products do some of this automatically. The transferable habit from Lesson 6 remains: ask for the reasoning separately from the answer, so you can check the reasoning without the conclusion prejudicing you.

Demonstration protocol

  1. Lazy prompt. “Write something about our new returns policy.” Show the output. Name what is wrong with it — no audience, no length, no format, no source material.
  2. Specific prompt. Add role, task, and constraints. Show the improvement.
  3. Specific plus example. Paste one paragraph in the target voice. Show the second, larger improvement. This is the beat the whole lesson exists to deliver.
  4. Run step 3 twice more without changing anything. Show that the outputs differ. Explain sampling. This inoculates the viewer against trusting a single good result.
  5. Show the window failing. In a long conversation, set a rule early, work for many turns, then observe the rule being dropped. Restate it and show compliance return.

Key terms introduced here

Token
The unit of text a model reads and writes. Roughly four characters or ¾ of a word in English. The unit in which context limits and pricing are counted.
Context window
Everything the model can see at once — prompt, conversation, attachments, and the response being generated. Finite. Nothing outside it exists to the model.
Autoregressive generation
Producing output one token at a time, each conditioned on everything generated so far.
Sampling / temperature
The step that picks one token from the predicted distribution, and the setting that governs how adventurous that pick is. The reason identical prompts give varying answers.
Prompt (role, task, constraints, examples)
The four load-bearing parts. Examples are the most powerful and the most often omitted.
Chain-of-thought prompting
Eliciting intermediate reasoning steps before the final answer, which improves accuracy on multi-step problems.

Evidence at a glance

Load-bearing claims in this lesson
ClaimSpecificsSource
A token is roughly ¾ of an English word ≈4 characters per token; 1,000 words ≈ 1,300 tokens Note 4
Material mid-context is retrieved less reliably The “lost in the middle” effect; performance is U-shaped by position Note 5
Examples in the prompt drive task performance Few-shot learning, established at scale in 2020 Note 6
Eliciting reasoning steps improves multi-step accuracy Chain-of-thought prompting Note 7

The misconception to kill

“It searched the internet for that.”

Not unless it was given a search tool — which is Lesson 5's subject. A plain chat model has no connection to anything. What it has is a very large set of learned statistical regularities from text it was trained on, with a cut-off date, and no ability to check anything against a live source.

How to tell the difference in practice: a system that searched will normally show you what it retrieved — links, snippets, citations you can click. A system that did not will produce fluent prose with no verifiable trail, and will often produce a citation-shaped object anyway. Lesson 6 makes checking those citations a reflex.

Self-check

Answer before revealing.8

Explain to a colleague what happens when they press Enter, in three sentences and without the word “think.”

The model reads everything currently in view. It predicts one next chunk of text, adds it to what it sees, and predicts the next. It repeats until it predicts a stopping signal — so the output is built forward, one piece at a time, never retrieved whole.

Your long chat has started ignoring a formatting rule you set at the top. What is happening and what do you do?

The instruction is now far from the text being generated and is competing with a great deal of intervening conversation; material in the middle of a long context is attended to least reliably. Restate the rule near the end of your latest message, or start a fresh conversation carrying only what matters.

Why is a single successful test of a prompt weak evidence?

Because the output is sampled from a probability distribution rather than computed deterministically. One good result is one draw. Run it several times — and if consistency matters more than variety, lower the temperature where the product lets you.

Which of the four prompt parts is most often missing, and why does its absence hurt most?

Examples. A specimen of the output you want encodes tone, structure, length, and a dozen conventions you would never think to state explicitly. Describing a target is lossy; showing one is not.

A colleague says “it's just autocomplete, it doesn't understand anything.” Give the strongest reply that does not overclaim.

That the mechanism is next-token prediction is correct and does not by itself settle what internal representations the system has — predicting text well requires modelling a great deal about what the text describes, and that is genuinely contested. But the engineering point stands regardless of how the philosophy resolves: the output is a prediction, and predictions can be fluent and wrong at the same time. Plan for that.

Prompt construction worksheet

Write a real prompt for a real task you have this week. All four parts.

Role — who is the model being, and for what audience?

Task — the job, as a verb.

Constraints — length, format, tone, what to avoid.

Example — paste or describe one specimen of the output you want.

Run it three times. Did the outputs differ materially? Where?

Endnotes

Source tiers: Primary peer-reviewed or archival; Institutional research body or government; Documentation first-party technical documentation; Journalism established newsroom; Trade vendor or aggregator — verify figures independently.

  1. Trade Ayaz Karimov, quoted in Swiss Cyber Institute, “The History of Artificial Intelligence: A Timeline from Turing to Today,” February 2026, on contemporary AI as predominantly pattern-based prediction, effective in narrow tasks and unreliable beyond them. swisscyberinstitute.com
  2. Primary For the sceptical position that fluency does not entail understanding, see E. M. Bender, T. Gebru, A. McMillan-Major, S. Shmitchell, “On the Dangers of Stochastic Parrots: Can Language Models Be Too Big?”, Proceedings of FAccT '21 (2021): 610–623. This course cites the disagreement rather than adjudicating it. doi:10.1145/3442188.3445922
  3. Primary R. Sennrich, B. Haddow, A. Birch, “Neural Machine Translation of Rare Words with Subword Units,” Proceedings of ACL 2016; arXiv:1508.07909. The byte-pair-encoding approach described here is the ancestor of the tokenisation schemes used by current chat models. arxiv.org/abs/1508.07909
  4. Documentation OpenAI, “What are tokens and how to count them.” The published rule of thumb for English is approximately 4 characters per token, or about ¾ of a word. Ratios differ substantially for other languages and for code, and differ between tokenisers. help.openai.com
  5. Primary N. F. Liu et al., “Lost in the Middle: How Language Models Use Long Contexts,” Transactions of the Association for Computational Linguistics 12 (2024): 157–173; arXiv:2307.03172. Retrieval accuracy is highest for material at the beginning and end of a long context and degrades in the middle. arxiv.org/abs/2307.03172
  6. Primary T. B. Brown et al., “Language Models are Few-Shot Learners,” arXiv:2005.14165 (2020). arxiv.org/abs/2005.14165
  7. Primary J. Wei et al., “Chain-of-Thought Prompting Elicits Reasoning in Large Language Models,” NeurIPS 35 (2022); arXiv:2201.11903. arxiv.org/abs/2201.11903
  8. Primary H. L. Roediger III and J. D. Karpicke, “Test-Enhanced Learning: Taking Memory Tests Improves Long-Term Retention,” Psychological Science 17, no. 3 (2006): 249–255. doi:10.1111/j.1467-9280.2006.01693.x

Bibliography

Primary research

  • Bender, Emily M., Timnit Gebru, Angelina McMillan-Major, and Shmargaret Shmitchell. “On the Dangers of Stochastic Parrots: Can Language Models Be Too Big?” Proceedings of the 2021 ACM Conference on Fairness, Accountability, and Transparency (2021): 610–623. doi.org
  • Brown, Tom B., et al. “Language Models are Few-Shot Learners.” arXiv:2005.14165 (2020). arxiv.org
  • Liu, Nelson F., et al. “Lost in the Middle: How Language Models Use Long Contexts.” TACL 12 (2024): 157–173. arxiv.org
  • Sennrich, Rico, Barry Haddow, and Alexandra Birch. “Neural Machine Translation of Rare Words with Subword Units.” ACL (2016). arxiv.org
  • Wei, Jason, et al. “Chain-of-Thought Prompting Elicits Reasoning in Large Language Models.” NeurIPS 35 (2022). arxiv.org

Product and technical documentation

Industry analysis

  • Swiss Cyber Institute. “The History of Artificial Intelligence: A Timeline from Turing to Today.” February 2026. swisscyberinstitute.com

Learning science

  • Roediger, Henry L., III, and Jeffrey D. Karpicke. “Test-Enhanced Learning: Taking Memory Tests Improves Long-Term Retention.” Psychological Science 17, no. 3 (2006): 249–255.