Working notes, derivations, and diagrams
This guide covers fundamental AI algorithms with mathematical rigor and practical insights. Each algorithm is explained with clear derivations, real-world applications, and implementation details based on my research experience at Cyrion Labs and SourceMind Labs.
Self-attention mechanisms, multi-head attention, and the architecture behind modern NLP.
IO‑aware tiled attention with streaming softmax and huge speedups.
Low‑rank adaptation for parameter‑efficient training and deployment.
NF4 quantization, double‑quant, dequant math, paged optimizers.
Clipped surrogate objective for stable policy updates.
KL‑constrained policy improvement with natural gradient.
Maximum‑entropy RL with twin critics and temperature tuning.
Direct preference optimization without a reward model.
Generalized preference optimization with grouping and KL/clipping.