Appendix B — The “Rosetta Stone” Master Cheat Sheet

Complete kitten-math-code mapping tables

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:

PyTorch API legend:

B.1 Phase I: Foundations

Kitten Concept Formal ML Term Formal Math Python / Library Code
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=...)

B.2 Phase II: Classical ML

Kitten Concept Formal ML Term Formal Math Python / Library Code
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)

B.3 Phase III: Deep Learning

Kitten Concept Formal ML Term Formal Math Python / Library Code
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)

B.4 Phase IV: Reinforcement Learning

Kitten Concept Formal ML Term Formal Math Python / Library Code
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)

B.5 Phase V: Safety and Alignment

Kitten Concept Formal ML Term Formal Math / Mechanism Python / Library Code
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

B.6 Phase VI: Frontier Engineering

Kitten Concept Formal ML Term Formal Math Python / Library Code
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=...

B.7 Phase VII: Integration and Capstone

Kitten Concept Formal ML Term Formal Math / Mechanism Python / Library Code
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

B.8 2026 Reasoning & Agent Additions

Kitten Concept Formal Term Target Phase
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)