Chapter-synced curated core quick-reference (not exhaustive) mapping the kitten universe to formal math and production code, organized by the same Phase I-VII structure as the book.
Notation policy used throughout:
Generic matrix: A
Data matrix: X \in \mathbb{R}^{n \times d}
Random variables in probability sections: T , U , Z (reserve X for dataset matrix)
Parameters: \theta (bundle), w (linear-model vector), W (neural-network weight matrices)
Learning rate: \eta (some papers use \alpha )
PyTorch API legend:
nn.*: modules/layers (often parameterized and stateful)
torch.nn.functional / F.*: stateless tensor ops
Phase I: Foundations
A single jump
Vector
\vec{v} \in \mathbb{R}^n
v = np.array([1, 2, 3])
Stretchy paw stamp
Matrix transform
A\vec{x}
A @ x
Invisible directions
Nullspace
\mathrm{Null}(A)
Vt[rank:].T (via SVD)
X-ray the matrix
SVD
A = U\Sigma V^T
U, S, Vt = np.linalg.svd(A)
Favorite sunbeam paths
PCA
top eigvecs of \frac{1}{n-1}X_c^T X_c (X_c = X - \bar{X} )
PCA(n_components=k).fit_transform(X)
Feel the slope
Gradient
\nabla L(\theta)
loss.backward()
Take the step
GD update
\theta_{t+1}=\theta_t-\eta\nabla L(\theta_t)
optimizer.step()
Smart adaptive paw
Adam / AdamW
moment-based adaptive updates
torch.optim.AdamW(params, lr=...)
Phase II: Classical ML
Straight yarn line
Linear Regression
\hat{y}=Xw+b
LinearRegression().fit(X, y)
Yes/No S-curve
Logistic Regression
\hat{y}=\sigma(Xw+b)
LogisticRegression().fit(X, y)
Four truth boxes
Confusion Matrix
TP/TN/FP/FN
confusion_matrix(y_true, y_pred)
Pile by magnets
K-Means
\arg\min \sum \|x_i-\mu_k\|^2
KMeans(n_clusters=k).fit(X)
Cluster quality
Silhouette Score
s \in [-1,1]
silhouette_score(X, labels)
Rotating exam room
K-Fold CV
mean over folds
cross_val_score(model, X, y, cv=5)
Phase III: Deep Learning
Basic neuron math
Linear Layer
z = Wx + b
nn.Linear(in_features, out_features)
Bouncer activation
ReLU
f(x)=\max(0,x)
nn.ReLU() / F.relu(x)
Whiskers for edges
Convolution
local weighted sum
nn.Conv2d(in_ch, out_ch, kernel_size=3)
Slice words into treats
Tokenization (BPE/SentencePiece)
text \rightarrow token IDs
tokenizer.encode(text)
Dense scent profiles
Embeddings
E \in \mathbb{R}^{V \times d}
nn.Embedding(vocab_size, d_model)
Whole-room lookup
Attention
\mathrm{softmax}(QK^T/\sqrt{d_k})V
F.scaled_dot_product_attention(q, k, v)
Save the scent
KV Cache
cached K,V over time
past_key_values=...
Sticky note tuning
LoRA
W=W_0+AB
get_peft_model(model, config)
Phase IV: Reinforcement Learning
Room rulebook
MDP
(S,A,P,R,\gamma)
import gymnasium as gym; env = gym.make(...)
Future treats
Return
G_t = \sum_{k=0}^{\infty}\gamma^k R_{t+k+1}
G += (gamma**t) * r
Heat map
Q-Value
Q(s,a)
Q[state, action]
Optimist update
Q-Learning
Q \leftarrow Q + \alpha[r+\gamma\max Q' - Q]
tabular update loop
Two kittens in trench coat
Actor-Critic
policy + value nets
PPO("MlpPolicy", env)
Phase V: Safety and Alignment
Etiquette class
SFT
supervised loss on instruction data
trainer.train()
Human thumbs-up loop
RLHF
reward model + PPO
TRL / custom pipeline
Skip the judge
DPO
preference loss vs ref model
DPOTrainer(...)
Know when unsure
OOD detection
entropy/uncertainty threshold
torch.distributions.Categorical(probs=probs).entropy()
Read hidden thoughts
Linear Probe
probe on frozen activations
LogisticRegression().fit(H, y)
“Who is at fault?”
AI Governance / EU AI Act
Risk-level classification
Model Cards / Compliance logs
Phase VI: Frontier Engineering
Kibble budget
6ND compute estimate
C \approx 6ND
compute = 6 * params * tokens
Cloned kittens
DDP
gradient AllReduce
torch.nn.parallel.DistributedDataParallel
Slice the matrix
Tensor Parallel
split matmul across devices
Megatron-LM / TP layers
Assembly line
Pipeline Parallel
stage-wise layer split
PP schedules + microbatches
Shred the backpack
FSDP / ZeRO
shard params/optim states
torch.distributed.fsdp.FSDP
Paged restaurant seats
PagedAttention
paged KV blocks
vllm engine
Revolving door queue
Continuous Batching
in-flight request scheduling
vLLM continuous batching
Tiny kitten guesses, lion verifies
Speculative Decoding
draft+verify decoding
speculative decoding pipeline
Shrink the lion
Quantization (INT8/INT4)
lower-precision weights
AWQ / GPTQ / GGUF workflows
Sober vs creative kitten
Temperature sampling
logits \rightarrow controlled entropy
temperature=...
Phase VII: Integration and Capstone
Lock the dice
Reproducibility
fixed RNG stream
torch.manual_seed(42)
Cat door
API serving
request/response contract
FastAPI / Flask
Indestructible carrier
Containerization
immutable runtime env
Dockerfile
GPS collar
Monitoring + drift
detect P_{live} \neq P_{train}
Evidently / Prometheus
Sculpting from static
Diffusion
iterative denoising process
Diffusers pipelines
2026 Reasoning & Agent Additions
Council of Kittens
Self-Consistency
III (Reasoning)
Double-Check Whiskers
Chain-of-Verification
III (Safety/Grounding)
Tool-using Kitten
ReAct Loop
VII (Agents)
Failure Journal
Reflexion
VII (Memory)
The Recipe Box
Agent Skills
VII (Infrastructure)