Transformers

How a transformer turns a list of tokens into the next one, taken apart piece by piece with every matrix shown. The matrix maths has its own course, Linear algebra for LLMs; Maths for ML covers softmax and cross-entropy.

The big picture

Tokenization

Inputs

Attention

The transformer block

Training

Inference

Modern architectures

Looking inside

Reference