techtree

A map of what you need to know to understand a transformer, the machine inside modern AI. Each topic gets one short video and builds only on the topics before it. The numbers are a watch order: every topic comes after everything it needs.

Assumes: arithmetic, basic algebra, functions and their graphs, exponents, square roots. 26 of 26 videos made so far.

1 Vectors 2 Adding and scalingvectors 3 Dot product 4 Length, angle, andcosine similarity 5 Matrices 6 Matrix times vector 7 Matrix times matrix 8 Transpose 9 Exp and softmax 10 Nonlinearity (ReLU) 11 Mean, variance, andnormalization 12 Tokens 13 Embeddings 14 Positioninformation 15 A neural networklayer 16 MLP 17 Residualconnections 18 Queries, keys, andvalues 19 Attention scores 20 Self-attention 21 Causal masking 22 Multi-headattention 23 The transformerblock 24 Stacking blocks 25 Next-tokenprediction andsampling 26 What is atransformer?

Linear algebra

Glue math

Building blocks

  • 12Tokens video
    Text is chopped into pieces, and each piece gets an ID number.
  • 13Embeddings video
    Each token ID is looked up as a vector; similar meanings point in similar directions.
  • 14Position information video
    Add a position vector to each token vector so order is not lost.
  • 15A neural network layer video
    Multiply by a matrix, add a bias, apply a nonlinearity.
  • 16MLP video
    Two layers in a row; widen, bend, narrow.
  • 17Residual connections video
    Add a block's output back to its input, so each block makes an edit.

Attention

Transformer