Phase 1 · Lesson 2

What the model actually reads

You type text. The neural network never receives that text directly. A tokenizer first turns it into model-specific pieces and integer IDs.

Start the visual trace ↓
Discussion open · no assessment has started
01 · Core path

Follow one request end to end

Use Next step to move through the path. The IDs and splits are deliberately made-up teaching values.

Visible text“Reset password?”
Tokenizersplits + maps
Token IDs[4821, 10237, 30]
Embeddingsnumeric vectors
Model scoresone score per possible ID
Step 1 of 8

Visible text arrives

The API receives Reset password?. This is still human-readable text. The neural network has not processed it yet.

The main boundary: the tokenizer performs deterministic text processing. The neural network begins working from numerical vectors derived from token IDs.
02 · Tokenizer lab

Click the pieces, inspect the IDs

Choose a preset, then click a colored token. These examples are illustrative toy tokenizers—not claims about a commercial model.

Visible text

Reset password?

Toy split

Notice that spaces, punctuation, fragments, or bytes may be represented as pieces. A token is not reliably a word.

Selected vocabulary entry
4821

"Reset"

The number identifies this piece only inside this toy vocabulary. A neighboring ID does not imply a neighboring meaning.

Whitespace is data. In " password", the leading space belongs to the token piece. It was not discarded.
03 · Definition

A mechanical unit, not a meaning unit

A token is one entry in a particular tokenizer’s finite vocabulary, represented by an integer ID.

Not reliably

A word

One word can be several tokens. A token can also contain whitespace plus a whole word.

Not reliably

A character

One token can contain many characters. One visible character can also require several tokens.

Not guaranteed

A unit of meaning

Vocabulary construction favors useful recurring pieces, but every piece need not represent a clean concept.

Low-stakes prediction · not recorded as assessment

Which statement is safest?

Why can round-tripping differ?
Many byte-aware tokenizers can encode and decode nearly arbitrary input. But normalization and decoder cleanup can affect whether the exact original bytes return. “Usually reversible” is safer than “universally identical under every configuration.”
What are special or control tokens?
Vocabulary entries that can mark message roles, boundaries, end-of-generation, padding, or tool-call structure. They may be invisible in the text you see while still occupying token positions.
04 · Compatibility

The same text can become different sequences

Related model versions may share a tokenizer, but compatibility must be checked rather than assumed.

Toy tokenizer A · 3 tokens
Reset password?

[4821, 10237, 30]

Toy tokenizer B · 5 tokens
Reset password?

[91, 882, 377, 2041, 17]

Token counts are not portable

A prompt counted with tokenizer A may use a different number of positions with tokenizer B.

Token IDs are not portable

ID 10237 has no universal meaning. It only identifies an entry inside the vocabulary that assigned it.

Production rule: count with the tokenizer paired with the model you will actually call. When exact behavior matters, run that tokenizer on the real text.
05 · Two numbers

Vocabulary is width. Context is length.

Vocabulary size

How many token types could occupy one position?

At each generation step, the model produces scores over its available vocabulary.

Context window

How many token positions fit in this run?

Input, output, system instructions, role markers, tools, and provider formatting may all consume positions.

Do not mix them: a 50,000-entry vocabulary does not mean a 50,000-token context window. They describe different dimensions.
06 · Context budget lab

Make space for the answer

This calculator illustrates budgeting, not a universal provider formula. Move the sliders and watch the remaining capacity.

System + tools900 tokens
User input + history2600 tokens
Reserved output1500 tokens
Illustrative window8000 positions
Budgeted positionsRemaining
3000positions left

Cost

Providers commonly use input and output tokens as billing units, but rates and accounting differ.

Latency

More tokens generally mean more work. The relationship is not universally linear.

Output limits

500 output tokens does not mean 500 words, characters, or lines.

07 · Diagnostic awareness

Where surprising splits appear

Important restraint: an unusual token split is a diagnostic hypothesis, not proof that the split caused a failure or proof of what the model understands.
08 · Next boundary

Tokenization stops. Numerical representation begins.

Textvisible string
Token IDsdiscrete integers
Input embeddingslearned vectors
Tokenizer owns

Segmentation + ID mapping

It produces discrete IDs. Numeric adjacency has no semantic promise: ID 4821 and ID 4822 need not have related meanings.

Model begins with

Embedding lookup

Each ID indexes a learned input vector. Later layers turn that starting vector into context-dependent internal representations.

Recognize now: position information
The model also needs information about where a token sits in the sequence. Architectures supply this in different ways. The mechanics are deliberately deferred.
Deferred: embedding geometry
The meaning of vector dimensions, similarity measures, and how embedding tables are learned belong to the next representation lesson—not this one.
09 · Learning map

What belongs at each depth

Understand now

The core model

  • Text → pieces → IDs → embeddings
  • Token ≠ reliable word or character
  • Generation decoding ≠ tokenizer decoding
  • Vocabulary width ≠ context length
  • Tokenizer/model pairing matters
Recognize for now

Engineering caveats

  • Special/control tokens
  • Bytes and normalization
  • Inference caching
  • Provider-specific accounting
  • Edge-case splits
Deliberately deferred

Later lessons

  • Embedding geometry
  • Sampling and temperature
  • Attention and transformers
  • Cache mechanics
  • Building tokenizers
Keep discussion open

Capture questions while you read

Write anything that still feels hand-waved. This stays only in this browser unless you copy it.

Lesson state: reading this page opens discussion. It does not start assessment. Ask questions first; say “ready for assessment” only when you want to close discussion.
Copied
Keyboard navigation

Move without hunting

[]
Previous / next section
Move between the lesson's major sections.
⇧ TabTab
Previous / next control
Use the browser's native focus order for buttons, toggles, sliders, tabs, links, and fields.
EnterSpace
Activate the focused control
Click a button or open/close a disclosure using native browser behavior.
?
Show this guide
Esc
Close this guide

Use arrow keys normally for sliders and selects. Section shortcuts pause while you type in a text field or note. Click outside this guide or press Esc to close it.