Open Documentation
Model Architecture & Internals
How transformers actually work, built from scratch rather than taken on faith. Tokenizers, the KV cache, speculative decoding, and what a small model has genuinely learned once training finishes.
RAG vs SFT: When to Use Which | SR Cookbooks
A technical breakdown of when to use Retrieval-Augmented Generation (knowledge) versus Supervised Fine-Tuning (behavior) in enterprise AI pipelines.
Speculative Decoding From Scratch | SR Cookbooks
Implement speculative decoding from scratch using NumPy to verify losslessness via rejection sampling and calculate wall-clock speedup bounds.
Inspecting What a Tiny Transformer Actually Learned | SR Cookbooks
A technical guide to probing a character-level PyTorch Transformer. Learn how to measure rule acquisition, test generalization, and ablate attention heads.
Implementing a KV Cache From Scratch: Pure PyTorch | SR Cookbooks
Learn the mechanics of autoregressive LLM optimization. Implement a transformer Key-Value (KV) cache from scratch in PyTorch to massively speed up decoding.
Tokenizers From Scratch: BPE vs MaxMatch | SR Cookbooks
Stop treating tokenization as a black box. Learn how Byte Pair Encoding (BPE) and MaxMatch split text differently, and what mathematically happens when you add new tokens for fine-tuning.