AI Grimoire
Standing note
Kept open, revised often.
143 entries, 7 stubs.
No prose written by a model.

The AI Engineer's Grimoire

A field reference for how these systems actually work: attention and its cheaper cousins, training dynamics that fail quietly, inference kernels, the interpretability toolkit, and the attack surface that follows all of it.

Each entry begins with the maths and ends with something you can run. Nothing is explained twice.

Categories

01
Architectures — attention variants, position schemes, normalisation, sparse blocks
54
02
Training — optimisers, schedules, sharding, RL objectives, stability failures
40
03
Fine-tuning — PEFT families, adapter merging, data curation, catastrophic drift
5
04
Inference — kernels, KV-cache layouts, quantisation, speculative decoding
8
05
Interpretability — circuits, SAEs, causal interventions, probing, feature geometry
9
06
Adversarial ML — evasion, extraction, poisoning, privacy leakage, agent hijacks
6
07
Evaluation — metrics, preference aggregation, contamination, statistical power
5
08
Miscellany — numerics, tensor conventions, the things every other shelf assumes
3
09
Tooling — what the software is for, when to reach for it, and what it hides
13

Notes

The entries state the result. The notes are the working out — read in order, or not at all.

Making it fit
the memory arithmetic of training something larger than the machine you have

Recent revisions

Activation Compression
Store the saved activations in fewer bits instead of recomputing them.
Training · revised 2d ago
O(L·B·T·d)
Activation Memory Accounting
How much a forward pass must keep, and which term dominates when.
Training · revised 2d ago
O(L·B·T·d)
Activation Sparsity
Most FFN neurons are zero for any given token; skip the rows they own.
Architectures · revised 2d ago
O(n·d·s)
Agent Frameworks
Loops with tools: what the frameworks add, and how little of it is the hard part.
Tooling · revised 2d ago
—