Train merges, encode new text, and compare tokenizers fairly.
Preparation: Counting, pairs and fractions.
Plan 20–35 minutes with the activities; this is a study estimate, not a timed requirement. Both paths have complete narration. Your notes and progress are kept separately for each level.
FULL LOCAL NARRATION
Follow the complete explanation.
Narration includes worked solutions. Pause at each practice prompt before continuing. Formula notation has a spoken explanation; all teaching text remains readable.
High-school path. Train merges, encode new text, and compare tokenizers fairly.
Preparation: Counting, pairs and fractions. Work through one section at a time. Predict the experiment result before changing its controls, then explain what the example leaves out.
Imagine packing a sentence into reusable tiles. A tile might contain one letter, several letters, punctuation, or a space. The model receives tile numbers, not the printed sentence. Counting words therefore does not tell you how many inputs you have. Start with banana. Its six letters can become six tiles, or fewer tiles if a vocabulary includes recurring groups. Neither arrangement changes the spelling. It changes the code used to represent it.
Worked step 1. Write b, a, n, a, n, a as six pieces.
Worked step 2. Give repeated pieces the same vocabulary ID.
Worked step 3. Join the decoded pieces and recover banana.
Try it yourself. Must the ID of ana be three times the ID of a?
Pause the recording and write your reasoning before continuing. The worked solution follows.
Reveal worked solution
Worked solution. No. IDs are labels. Their magnitude has no relationship to the number of letters or the meaning of a piece.
Section 02 / 07
Count adjacent pairs
BPE learns which neighboring pieces to join. First count pairs in a training collection. In banana, a followed by n occurs twice, and n followed by a also occurs twice. A tie needs a fixed rule; this lesson chooses a then n. Replace non-overlapping occurrences, then count again. Looking for the most frequent whole word is a different algorithm. The important habit is to inspect the changing pieces after every merge.
Worked step 1. Pairs are ba, an, na, an, na.
Worked step 2. Choose an and replace its two non-overlapping occurrences.
Worked step 3. The new sequence is b, an, an, a: four pieces.
6 pieces → 4 pieces
Two non-overlapping merges reduce six pieces to four.
Try it yourself. Can the original pair counts be reused for the next merge?
Pause the recording and write your reasoning before continuing. The worked solution follows.
Reveal worked solution
Worked solution. No. The current pairs are b with an, an with an, and an with a. Counts describe the current symbol sequence.
Section 03 / 07
Freeze the rules before encoding
Training writes a reusable merge list. Encoding applies that saved list to new text. It does not learn a new vocabulary for every prompt. Suppose the rules first join a with n, then an with a. Banana becomes b, an, ana. A different word may use fewer rules. The fixed list lets the model encounter consistent tile IDs across messages. New tiles would need embeddings the model has actually learned.
Worked step 1. Freeze a+n→an, followed by an+a→ana.
Worked step 2. Banana encodes as b, an, ana.
Worked step 3. Band encodes as b, an, d; no band tile is invented.
Try it yourself. Why not learn fresh merges for every incoming message?
Pause the recording and write your reasoning before continuing. The worked solution follows.
Reveal worked solution
Worked solution. A fixed model has no trained embedding for arbitrary new pieces. Stable encoding is required to interpret the saved vocabulary.
Section 04 / 07
Bytes and visible characters differ
A character on screen and a byte in a file are different units. UTF-8 stores some characters in one byte and others in several. A byte tokenizer can begin with a complete byte alphabet, but a piece can end inside a displayed character. Normalization is another choice: two strings that look alike can use different codes. Test whether decoding preserves the original string instead of assuming every tokenizer has the same behavior.
Worked step 1. ASCII a occupies one UTF-8 byte.
Worked step 2. A single-code-point é occupies two UTF-8 bytes.
Worked step 3. An e plus combining accent has a different code-point sequence, even if it looks similar.
Try it yourself. Does more UTF-8 storage always mean more final tokens?
Pause the recording and write your reasoning before continuing. The worked solution follows.
Reveal worked solution
Worked solution. No. Learned merges can combine bytes. Measure the chosen tokenizer, and record normalization and fallback settings.
Section 05 / 07
Predict, merge, measure
In Workbench, choose a merge count before looking at the result. Write a prediction: how many pieces will remain? Then inspect both the count and the pieces themselves. Useful merges reduce this tiny training example, but the saving may not carry over to unfamiliar writing. A vocabulary is shaped by the text used to train it. The experiment is about a mechanism, not a claim that one language or writing style is inherently efficient.
Worked step 1. At zero merges banana has six pieces.
Worked step 2. At one merge it has four pieces.
Worked step 3. At two merges, inspect the displayed sequence and join the pieces again.
Try it yourself. What must remain invariant when the piece count changes?
Pause the recording and write your reasoning before continuing. The worked solution follows.
Reveal worked solution
Worked solution. The decoded character sequence remains banana. This fixture does not discard or reorder characters.
Section 06 / 07
Build a fair comparison
Use the same held-out messages to compare two tokenizers. Include the languages, names, numbers and punctuation your learners use. Keep a small table of byte counts, token counts and round-trip changes. Do not call a language less meaningful because it takes more pieces under one vocabulary. That result reflects a representation and its training coverage. Explain your recommendation using the actual course audience, not an English-only average.
Worked step 1. Keep evaluation texts unchanged.
Worked step 2. Encode them using two frozen configurations.
Worked step 3. Decode and record any normalization changes alongside counts.
Try it yourself. One tokenizer is better on English but worse on your main teaching language. Which result matters?
Pause the recording and write your reasoning before continuing. The worked solution follows.
Reveal worked solution
Worked solution. Use the actual audience and workload. Report both outcomes and their trade-offs rather than hiding one behind a global average.
Section 07 / 07
Mastery and transfer
Bring the pieces together. First answer the checkpoint without the worked solutions. Then explain the mechanism in your own words, using one numerical example from this lesson.
Encoding means… Option 1: Learning fresh rules for every prompt. Option 2: Applying saved rules. Option 3: Making every word one piece.
Pause here and choose an answer before continuing. The checkpoint explanation follows.
Reveal worked solution
The correct choice is option 2: Applying saved rules. Encoding applies a saved tokenizer.
Transfer task. Change one assumption in the worked example. State your prediction, calculate or test it in Workbench, then explain whether the result supports your prediction.
Reveal worked solution
Self-check rubric. Name the changed assumption, keep the other inputs fixed, show at least one intermediate calculation, and distinguish what the toy example guarantees from what would require a trained model or a real measurement.
WORKBENCH / PREDICT → TEST → EXPLAIN
Inspect exact numerical data
These are computed teaching fixtures. No remote AI model or GPU is called by the experiment.
CHECK YOUR UNDERSTANDING
Commit to an explanation.
Keep your learning record.
Sources and scope
Original worked examples and teaching text, grounded in these primary references. Numerical fixtures explain mechanisms; model quality and hardware performance require separate measurements. Both levels share key examples, with different explanations and checkpoints.
What a model learns: from numbers to a useful answer
Follow a sentence through learned weights, temporary activations, and the next-token decision.
Additional reading · original lesson audio remains unchanged.
Read the full explanation · 586 words
What changes when you ask a question?
23input x
×
0.6−0.2learned weights
+
0.1bias
=
0.7output y
The weights stay fixed during ordinary inference. Activations change with your input.
Text → tokens
Tokens → vectors
Learned transformations
Next-token scores
Text → tokens
A model is a computation with learned settings
A language model does not contain a little librarian choosing a finished answer from a shelf. It contains a structured computation whose numerical settings were learned during training. Those settings are called parameters. Many are weights arranged in matrices; other parameters can include offsets or normalization scales. The architecture determines which operations happen and how information travels. The weights determine the particular transformations performed by those operations. Two models can share an architecture and behave differently because they learned different parameter values.
Consider a tiny operation: y = 0.6x₁ − 0.2x₂ + 0.1. With inputs x₁ = 2 and x₂ = 3, the output is 0.7. Changing the first weight from 0.6 to 0.5 changes the output to 0.5. This is a teaching example, not a miniature intelligent system. Its purpose is to make one idea visible: numerical settings influence the result. In a language model, many such transformations act together across large vectors, nonlinear functions, and layers.
Follow the sentence
First, a tokenizer turns text into a sequence of token identifiers. A token may represent a word, part of a word, punctuation, or another unit. An embedding table supplies a learned vector for each identifier. These vectors are starting representations, not complete dictionary definitions. As they pass through the network, surrounding tokens influence how the current sequence is represented.
In attention, learned projections produce queries, keys, and values. The model compares queries with keys to calculate input-dependent attention scores, then combines value representations. This distinction matters: the projection weights normally remain fixed during a conversation, while the attention scores change with the input. Feed-forward transformations further process the representations, and residual connections carry information around sublayers. Finally, an output transformation supplies scores for possible next tokens. A selection procedure chooses a continuation, which becomes part of the next input step.
Training changes the settings; a conversation changes the state
During training, a loss measures how the predictions compare with the training objective. Gradients estimate how parameter changes would affect that loss. An optimizer uses those gradients to update trainable parameters. A single example does not usually teach an isolated fact to one identifiable weight. Useful patterns emerge through many updates, and knowledge and behavior are distributed across the computation.
During ordinary inference, the parameters stay fixed. Your prompt changes the activations: the temporary numbers produced while the model runs. A cache can retain intermediate information so the system need not repeat earlier work. That cache is not a new permanent education for the model. A product may separately save conversation history or conduct later training, but those are additional mechanisms. Saying that a chatbot remembers your previous sentence does not establish that its weights changed.
Why more parameters is not a complete explanation
A parameter count describes scale, not a guarantee of reliability. Data quality, architecture, training, numerical precision, and the way a model is evaluated all matter. A large model can produce a convincing error; a smaller specialized model can perform a narrow task well. To compare systems, ask what task was tested and under what conditions, rather than treating one number as a universal intelligence score.
Return to the animation and identify three different objects: a stored weight, an activation that changes with the sentence, and an output score. If the diagram uses moving dots, those dots represent information flow; they are not literal particles inside a model. Using the small equation above on paper, change an input while keeping a weight fixed, then change the weight while keeping the input fixed. Explain why these are different experiments. That distinction will help you understand fine-tuning, quantization, caches, and model releases throughout the course.
Sources and further investigation
Source review: October 28, 2026. Model-release claims are attributed to their publishers.