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 above it.

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

Vectors Adding and scalingvectors Dot product Matrices Length, angle, andcosine similarity Matrix times vector Transpose Matrix times matrix Exp and softmax Nonlinearity (ReLU) Mean, variance, andnormalization Tokens Embeddings A neural networklayer Position information MLP Residual connections Queries, keys, andvalues Attention scores Self-attention Causal masking Multi-head attention The transformerblock Stacking blocks Next-tokenprediction andsampling What is atransformer?

has a video not yet

Linear algebra

Glue math

Building blocks

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

Attention

Transformer