The input tokens become exact vectors through token and position tables. No sinusoidal position encoding appears in this tiny model, so the starting stream is exact.

highlighted = computed this step

Tokens to vectors

The input is a then b, with IDs 0 and 1. Token vectors and position vectors are displayed as exact integer tables. These lookup steps are discrete: token IDs choose rows, and row addition creates the starting stream vectors.

a0,b1a\mapsto 0,\quad b\mapsto 1
Tokens to vectorsExact token and position tables feed the pass.Tokens to vectorsExact token and position tables feed the pass.tiny transformer exact-or-named forwarddiscrete spine exact; softmax/layernorm sqrt become named only at the boundaryinput: a b; E[a]=(1,0), E[b]=(0,1), E[c]=(1,1); P0=(0,0), P1=(1,0)weights: Wq=Wk=Wv=I; MLP=I+ReLU+I; gamma=(1,1), beta=(0,0); unembed tied to Eposition 0: fully exact pathx0=(1,0); Q0=K0=V0=(1,0)score S00=1; softmax=[1] exactattn0=(1,0); residual1=(2,0)ln1 mean=1; centered=(1,-1); var=1; std=1ln1 output=(1,-1)MLP ReLU=(1,0); mlp=(1,0)residual2=(2,-1)ln2 mean=1/2; centered=(3/2,-3/2); var=9/4; std=3/2ln2 output=(1,-1)logits: a=1, b=-1, c=0argmax=a; output token=aposition 1: named softmax boundaryx1=(1,1); Q1=(1,1)K0=(1,0); K1=(1,1)scores=[1, 2]softmax=[e^1/(e^1+e^2), e^2/(e^1+e^2)]named after multi-entry softmaxordered pipelinetokens -> embed -> +pos -> attention -> +residual-> layernorm -> MLP -> +residual -> layernorm-> unembed -> logits -> argmax -> output tokenpos0 remains exact; pos1 stops at named softmax

Add the position table

For position zero, E[a]+P zero gives x zero = (1,0). For position one, E[b]+P one gives x one = (1,1). This book uses stored position table rows, not sinusoidal position encodings, so these additions are exact.

xzero=(1,0),xone=(1,1)x_{\text{zero}}=(1,0),\quad x_{\text{one}}=(1,1)
Tokens to vectorsExact token and position tables feed the pass.Tokens to vectorsExact token and position tables feed the pass.tiny transformer exact-or-named forwarddiscrete spine exact; softmax/layernorm sqrt become named only at the boundaryinput: a b; E[a]=(1,0), E[b]=(0,1), E[c]=(1,1); P0=(0,0), P1=(1,0)weights: Wq=Wk=Wv=I; MLP=I+ReLU+I; gamma=(1,1), beta=(0,0); unembed tied to Eposition 0: fully exact pathx0=(1,0); Q0=K0=V0=(1,0)score S00=1; softmax=[1] exactattn0=(1,0); residual1=(2,0)ln1 mean=1; centered=(1,-1); var=1; std=1ln1 output=(1,-1)MLP ReLU=(1,0); mlp=(1,0)residual2=(2,-1)ln2 mean=1/2; centered=(3/2,-3/2); var=9/4; std=3/2ln2 output=(1,-1)logits: a=1, b=-1, c=0argmax=a; output token=aposition 1: named softmax boundaryx1=(1,1); Q1=(1,1)K0=(1,0); K1=(1,1)scores=[1, 2]softmax=[e^1/(e^1+e^2), e^2/(e^1+e^2)]named after multi-entry softmaxordered pipelinetokens -> embed -> +pos -> attention -> +residual-> layernorm -> MLP -> +residual -> layernorm-> unembed -> logits -> argmax -> output tokenpos0 remains exact; pos1 stops at named softmax

Summary

Tokenization and vector lookup are discrete and exact here. The position table is exact, not sinusoidal. The named boundaries come later, after the exact stream vectors are in place.

lookup tables are exact\text{lookup tables are exact}
Tokens to vectorsExact token and position tables feed the pass.Tokens to vectorsExact token and position tables feed the pass.tiny transformer exact-or-named forwarddiscrete spine exact; softmax/layernorm sqrt become named only at the boundaryinput: a b; E[a]=(1,0), E[b]=(0,1), E[c]=(1,1); P0=(0,0), P1=(1,0)weights: Wq=Wk=Wv=I; MLP=I+ReLU+I; gamma=(1,1), beta=(0,0); unembed tied to Eposition 0: fully exact pathx0=(1,0); Q0=K0=V0=(1,0)score S00=1; softmax=[1] exactattn0=(1,0); residual1=(2,0)ln1 mean=1; centered=(1,-1); var=1; std=1ln1 output=(1,-1)MLP ReLU=(1,0); mlp=(1,0)residual2=(2,-1)ln2 mean=1/2; centered=(3/2,-3/2); var=9/4; std=3/2ln2 output=(1,-1)logits: a=1, b=-1, c=0argmax=a; output token=aposition 1: named softmax boundaryx1=(1,1); Q1=(1,1)K0=(1,0); K1=(1,1)scores=[1, 2]softmax=[e^1/(e^1+e^2), e^2/(e^1+e^2)]named after multi-entry softmaxordered pipelinetokens -> embed -> +pos -> attention -> +residual-> layernorm -> MLP -> +residual -> layernorm-> unembed -> logits -> argmax -> output tokenpos0 remains exact; pos1 stops at named softmax