toy text and tokenization
Transformer Systems Lab
From text to one gradient update
Begin with a tiny object instead of a course grid: a string, two toy tokenizations, one causal attention row, a cross-entropy loss, and one inspectable update.
tokens -> QK route -> softmax CE -> gradienttokens, attention paths, p-y
commit source token
tokenizer, key scale, mask
trace, table, finite check
path controls gradient
residual-off perturbation
RoPE phase geometry
Operability contract
The page is complete only when the loop closes around the object.
Operable Station 00
From text to one gradient update
Start with a toy text object, choose a tokenization, route the final context token through one causal attention row, then inspect the exact softmax-cross-entropy update that follows.
Selected Object
Toy next-token training case
the model learns patternsThe tokenizer here is deliberately small and inspectable. It is not BPE, unigram LM, or real SentencePiece; it is a controlled witness for how token boundaries change positions before the loss. For the final training row, the context is everything before the last token and y is the final token.
Prediction Checkpoint
After scaling the model key by 2x, which source token receives the largest gradient signal from the final loss?
Manipulation
Change one axis, then re-predict.
Fewer pieces, fewer training positions.
Transformer Systems Lab route
One complete station first; the whole route stays visible.
Later stations must inherit the same object-centered contract: object, gap, prediction, manipulation, evidence, invariant, transfer, and one next move.
- 01Data, tokenization, objective
Toy text -> tokens -> next-token loss
operable - 02Causal self-attention
One row of QK^T, mask, softmax, V
operable in cockpit - 03Reverse-mode gradient trace
Loss signal through attention and residual paths
operable in cockpit - 04RoPE
Rotated query/key pair and phase gap
first-class next - 05KV cache and grouped-query attention
Mem_KV = B * N_layers * T * H_kv * d_head * 2 * bytes
operable in cockpit - 06Efficient exact attention
Exact attention with different memory movement
source mapped - 07Long-context use
Available context vs usable retrieval
first-class station - 08Stable pretraining
Activation scale, update ratio, loss trace
planned - 09Post-training
Reference policy, preference pair, behavior shift
planned - 10Evaluation and falsification
Claim, slice, metric, counterexample
first-class station - 11Serving and deployment constraints
Workload, prefill, decode, cache pressure
first-class station - 12Capstone systems claim
One defensible architecture/training/eval/serving claim
first-class station