TrustCyber / machine
/insights/toronto-one-prompt-language-model/index.mdtext/markdown8.3 KB ~2,118 tokens
Open raw

Toronto: One Prompt Through a Language Model

A 2:05 film tracing one prompt through a small language model, from seven tokens to the answer “Toronto,” with figures from a real model run.

Canonical HTML page

What this examines

The film follows the question “What is the capital of Ontario?” through Qwen2.5-0.5B-Instruct: seven tokens and their IDs, 896 numbers for each token, attention across 24 layers, a score for each of 151,936 tokens, and the choice of “Toronto.” The model was not certain. Toronto scored 51 percent and Ottawa 36 percent. The film then shows the loop that repeats until a stop token, and how training shaped the weights.

Why it matters

A chatbot's answer can read like a lookup. The film shows a prediction instead: the model weighed Toronto against Ottawa and picked the likelier token. In the film's words, that is how a model can sound right and be wrong.

Key ideas

One prompt, end to end

You ask a chatbot “What is the capital of Ontario?” and the answer arrives one word at a time. The film explains why: on its own, the model looks nothing up. It predicts what comes next, over and over. The example stays with one small model, Qwen2.5-0.5B-Instruct, and the figures on screen come from a run of that model.

The steps the film shows

The narration walks through one prediction, then the loop around it.

What comes from the model run

After “The capital of Ontario is,” the film shows Toronto at 51 percent and Ottawa at 36 percent, with smaller scores for other tokens such as Kingston at 1 percent. After “Toronto,” a period scores 89 percent. After the period, the end-of-turn token <|im_end|> scores 85 percent and the answer stops.

What is illustrated

The training sequence, with examples such as “The sun rises in the” and a row of dials for weights, is labelled “an illustration of training, not the model's real data.” The score chart samples 240 tokens evenly rather than drawing all 151,936.

The original version (August 2026)

The original 2:16 film, the second player on this page, traces the same prompt with a different design and a different set of measurements. The text below describes that version. The film begins with “What is the capital of Ontario?” and ends with “Toronto.” Between them, it traces the finite sequence of operations a language model performs. The example stays concrete so every transition can be shown where it occurs rather than hidden behind a generic model icon.

Original version: the seven stages

The sequence follows the model pipeline while treating speculative decoding as an optimization around its central loop.

Original version: what was measured

The source page reports the tokenization, token IDs, byte values, duration, frame rate, and output format as measured. The prompt was checked with tiktoken under o200k_base and resolves to seven tokens. The source records “Toronto” as token ID 151837, the leading-space form as 27812, and the period as 13. It also verifies the UTF-8 bytes for Toronto as 54 6f 72 6f 6e 74 6f.

Original version: what remains schematic

The film avoids numerical claims where no model run supplied them. Probability bars communicate relative shape without numeric labels, and the embedding strip is labelled schematic. Transformer depth is expressed as a 32-to-80-block range so the illustration does not imply one vendor's architecture. Probability-bar heights and the embedding strip are explicitly schematic, and the architecture is shown as a 32-to-80-block range rather than one vendor configuration.

Original version: three corrections

The source outline initially placed three ideas incorrectly. The finished film calls out each correction on screen.

Original version: how it was made

The film was composed in HTML and GSAP and rendered with HyperFrames. Narration uses the Kokoro bf_emma voice, with ten segments mixed to one timeline. Captions were synchronized with Whisper and corrected by hand; the soundtrack is a deterministic FFmpeg drone. League Gothic and JetBrains Mono provide the type system.

Evidence note

The film credits its figures to a real run of Qwen2.5-0.5B-Instruct. Its token IDs, 896 numbers per token, 24 layers, 151,936-token vocabulary, and 494,032,768 weights match the model's published tokenizer and configuration. The attention arcs are labelled as real weights from the model, and the score chart shows real scores for an even sample of 240 tokens. The training sequence is labelled an illustration, not the model's real data.

Resources