Attention, explained with a tiny example
Queries, keys and values without the matrix fog — build self-attention in 20 lines of NumPy.
Logits, temperature, top-k and top-p — and why the same prompt gives different answers. With runnable Python.
Narjis Zekhnini · 3 Nov 2026 · 3 min read
Queries, keys and values without the matrix fog — build self-attention in 20 lines of NumPy.
Chunking, embeddings, re-ranking — and the five failure cases worth logging before you blame the model.
Byte-pair encoding, how text becomes numbers, and the quirks it leaves behind.
Adapters, rank and the memory maths that make it fit — with a working Hugging Face recipe.
A 30-example test set tells you more about your use case than any leaderboard. Here is how to build one in Python.
The one NumPy rule behind every batch, every normalisation and every attention mask — explained with shapes.
Everything AI, organised the way you learn it.