Day 15 · Study Toolkit
PART III Cheat sheets, self-tests, and study routines to keep the knowledge fresh. - Cheat sheet + what comes after - Master beginner checkpoint bank - If you get stuck — revision map - Recommended study pattern - Inter
PART III
Cheat sheets, self-tests, and study routines to keep the knowledge fresh.
- Cheat sheet + what comes after
- Master beginner checkpoint bank
- If you get stuck — revision map
- Recommended study pattern
- Interview-ready revision pattern
- Final mental model
Cheat Sheet + What Comes After
Formulas Cheat Sheet
| Concept | Formula |
|---|---|
| Linear model | ŷ = Xw + b |
| MSE | mean((y−ŷ)²) |
| GD update | w ← w − α·∂L/∂w |
| Ridge / Lasso | + α·Σw² / + α·Σ\|w\| |
| Precision / Recall | TP/(TP+FP) / TP/(TP+FN) |
| F1 | 2PR/(P+R) |
| Sigmoid | 1/(1+e⁻ᶻ) |
| ReLU | max(0,z) |
| BCE | −[y·log ŷ + (1−y)·log(1−ŷ)] |
| Concept | Formula |
|---|---|
| Cosine sim | a·b / (‖a‖‖b‖) |
| Attention | softmax(QKᵀ/√dₖ)V |
| Conv output size | floor((W−K+2P)/S)+1 |
Common Bugs Table
| Symptom | Likely cause |
|---|---|
| Loss = NaN | lr too high / log(0) / bad data |
| Accuracy stuck at chance | lr too low, wrong labels, no shuffle, forgot zero_grad() |
| Val ≫ train error | Overfitting |
| Shape mismatch | Print shapes; check view / reshape / transpose |
| Great test score, bad in prod | Data leakage |
| Model works in train, weird in eval | Forgot model.eval() |
What Comes After (Roadmap Notes)
LLMs → GenAI → Prompt Eng → Embeddings → Vector DBs → RAG → Fine-tuning
→ Agents → Tool Calling → MCP → LangChain → LangGraph → Evaluation
→ Security → FastAPI → Docker → LLMOps| Stage | Simple explanation | Builds on |
|---|---|---|
| LLM | Giant decoder-only Transformer predicting next token | Day 13 |
| Prompt Engineering | Steering the LLM with clear instructions/examples | — |
| Embeddings | Meaning as vectors | Days 2–3, 5 |
| Vector DB | Fast similarity search over embeddings (FAISS, Chroma, pgvector) | Cosine sim |
| RAG | Retrieve relevant docs → put in prompt → grounded answers | Embedding s |
| Stage | Simple explanation | Builds on |
|---|---|---|
| Fine-tuning | Further train on your data (LoRA/PEFT) | PyTorch (Day 11) |
| Agents | LLM decides actions in a loop | LLM + tools |
| Tool Calling | LLM outputs structured calls to functions/APIs | Agents |
| MCP | Standard protocol to connect LLMs to tools/data | Tool calling |
| LangChain / LangGraph | Frameworks to chain steps / build stateful agent graphs | Agents |
| Evaluation | Measure quality (RAGAS, LLM-as-judge, test sets) | Metrics (Day 6) |
| AI Security | Prompt injection, data leakage, guardrails | — |
| FastAPI + Docker | Serve & ship the model | Backend skills |
| LLMOps | Monitoring, tracing, cost, versioning | Production |
Master Beginner Checkpoint Bank
Try to answer each question out loud, in simple words, before checking your notes.
n Can you explain train, validation, and test sets?
n Can you explain overfitting without using the word “overfitting”?
n Can you explain gradient descent with a physical analogy?
n Can you explain precision and recall with a fraud example?
n Can you explain why embeddings are vectors?
n Can you explain cosine similarity?
n Can you explain what a neuron computes?
n Can you explain backpropagation at a high level?
n Can you describe the PyTorch training loop?
n Can you explain why CNNs are useful for images?
n Can you explain what a token is?
n Can you explain Q, K, and V in one minute?
n Can you explain causal masking?
n Can you draw a Transformer block? n Can you explain next-token prediction?
n Can you distinguish embeddings, vector databases, and RAG?
n Can you distinguish RAG from fine-tuning?
n Can you explain tool calling?
n Can you explain why an agent needs tools?
n Can you explain what MCP adds?
If You Get Stuck — Revision Map Master Beginner Checkpoint Bank — Answer Key
Check yourself after answering out loud. These are short model answers; if yours has the same core idea in your own words, you are good.
# Question Model answer
1 Train, validation, and test Train fits the model's parameters. Validation is for choices (hyperparameters, early sets stopping, model selection). Test is touched once at the end for an honest estimate of performance on new data.
2 Overfitting without the word The model memorizes quirks and noise in the training data, so it looks great on data it has seen and worse on new data.
3 Gradient descent, physical Walking downhill in fog: feel which way the ground slopes, step that way, repeat. The step analogy size is the learning rate.
4 Precision and recall, fraud Precision: of the transactions I flagged as fraud, how many really were? Recall: of all the example real fraud, how much did I catch?
5 Why embeddings are vectors Models work on numbers. A vector of numbers lets similar meanings sit close together, so distance or angle can measure similarity.
6 Cosine similarity The angle between two vectors: a·b / (‖a‖‖b‖). Near 1 = same direction, 0 = unrelated, −1 = opposite. It ignores vector length.
7 What a neuron computes A weighted sum of its inputs plus a bias, passed through an activation function: a = f(w·x + b).
8 Backpropagation, high level Run the forward pass and compute the loss. Then use the chain rule to move backward and find how much each weight contributed to the error (its gradient). An optimizer uses those gradients to update the weights.
9 The PyTorch training loop For each batch: zero the gradients, forward pass, compute loss, loss.backward(), optimizer.step().
10 Why CNNs suit images Small filters slide over the image and reuse the same weights everywhere. That needs far fewer parameters than a fully connected layer and detects patterns (edges, textures) wherever they appear.
11 What a token is A piece of text the model reads (a word, part of a word, or punctuation) mapped to an integer ID from a fixed vocabulary.
12 Q, K, and V in one minute Each token makes a query (what I am looking for), a key (what I offer), and a value (the information I carry). Scores = QKᵀ/√d; softmax turns them into weights; the output is those weights times V.
13 Causal masking A mask that blocks attention to later positions, so token t can only see tokens up to t. It stops the model cheating by looking at the answer during next-token training.
14 A Transformer block Multi-head attention with a residual connection, then a feed-forward network with a residual connection, with layer normalization around them (exact placement varies by design). Blocks are stacked many times.
15 Next-token prediction Given the tokens so far, the model outputs a probability for every token in its vocabulary. One is chosen, appended to the input, and the process repeats.
16 Embeddings vs vector Embeddings are vectors that represent meaning. A vector database stores them and does database vs RAG fast similarity search. RAG is the whole pattern: retrieve relevant text, put it in the prompt, then generate.
17 RAG vs fine-tuning RAG supplies knowledge at question time through the prompt, so weights do not change (good for fresh or private facts, with sources). Fine-tuning changes the weights with extra training (good for style, format, or task behavior).
18 Tool calling The model outputs a structured request (tool name plus arguments). Your code validates and runs it, then returns the result to the model.
19 Why an agent needs tools By itself an LLM only produces text from its training data and prompt. Tools let it fetch live information and take actions, and a loop lets it use results to decide the next step.
*# Question Model answer 20* What MCP adds A standard protocol so any compatible AI app can connect to any compatible tool or data server, instead of writing custom integrations for every pair.
Scoring yourself: 17–20 comfortable: move on. 12–16: revisit the topics you missed using the Revision Map that follows. Under 12: do one more pass through the Big Picture and Quick Recap of those days before continuing.
| Problem | Revise |
|---|---|
| NumPy shape errors | Dimensions, axis, broadcasting, @ |
| Gradient descent confusion | Loss, slope/gradient, learning rate |
| Overfitting confusion | Train vs validation behavior |
| Metrics confusion | Confusion matrix, positive class, precision/recall |
| Backprop confusion | Forward pass, loss, chain rule intuition |
| PyTorch confusion | Tensor → DataLoader → model → loss → optimizer |
| CNN confusion | Image shapes, filters, padding, stride, pooling |
| Attention confusion | Embeddings, dot product, softmax, matrix multiplication |
| Transformer confusion | Attention + FFN + residual + LayerNorm |
| RAG confusion | Embeddings → retrieval → context → LLM |
| Agent confusion | LLM → tool call → execution → result → next step |
Recommended Study Pattern
For an intensive day
1–1.5 hours: read and understand. 2–3 hours: code without copying. *Remaining time:* debug, document, and review.
For a beginner who needs more time
Split each day across two sessions. Do not rush from Days 7–8 to Day 13 simply to finish the calendar.
Daily reflection
- What did I learn?
- What confused me?
- What did I build?
- What broke?
- What will I revise tomorrow?
Rule If you cannot explain it simply, you probably need another pass. The objective is understanding, not page completion.
Interview-Ready Revision Pattern
For every major concept, prepare four answers:
- Definition — What is it?
- Intuition — Why does it work?
- Implementation — How would you code/use it?
- Failure mode — What commonly goes wrong?
*Example: RAG Definition: Retrieval-Augmented Generation combines retrieval with generation. Intuition: give the model relevant external context before asking it to answer. Implementation: chunk → embed → retrieve → construct prompt → generate. Failure modes:* poor chunking, irrelevant retrieval, missing context, unsupported answers, and weak evaluation.
Final Mental Model
CLASSICAL ML
Data → Features → Model → Loss → Optimization → Evaluation
DEEP LEARNING
Tensors → Neural network → Backpropagation → Optimizer → Evaluation
TRANSFORMERS
Tokens → Embeddings → Attention → Transformer blocks → Next-token prediction
GENAI APPLICATIONS
LLM + Prompt → Embeddings → Retrieval/RAG → Tools → Agents → Evaluation
PRODUCTION
Application → API → Docker → Monitoring → Security → LLMOps
The detailed day-by-day material in Part I provides the depth; this book is designed to make the connections easier to see, especially for a beginner moving toward GenAI. Good luck — ship one folder a day!
Move on when you can… ☐ explain the steps of RAG in your own words ☐ compute precision@k for a retrieval result ☐ describe a tool-calling loop and its risks ☐ pick a next project from the ladder ☐ write your plan for what to study next If you cannot tick most of these, repeat the worked problems for this day. Taking an extra day is fine; it is not falling behind.
Glossary — Key Terms in Plain English
| Term | Plain-English meaning |
|---|---|
| Array / Tensor | A grid of numbers with a fixed shape. “Tensor” is the general name: 0-D scalar, 1-D vector, 2-D matrix, and higher. |
| Shape | The size of an array in each direction. Shape (2, 3) means 2 rows and 3 columns. |
| Vectorization | Doing math on a whole array at once instead of writing a Python loop. Much faster. |
| Broadcasting | NumPy’s rule for automatically stretching a smaller array so it can be combined with a bigger one. |
| DataFrame | A Pandas table: rows and named columns, like a spreadsheet inside Python. |
| Feature / Label | A feature is an input column used for prediction. The label (target) is the answer you want to predict. |
| Model | A function with adjustable numbers (parameters) that turns inputs into predictions. |
| Parameters (weights, bias) | The adjustable numbers inside a model. Training means finding good values for them. |
| Loss function | A single number that says how wrong the model’s predictions are. Lower is better. |
| Gradient descent | Repeatedly nudging the parameters in the direction that lowers the loss. |
| Learning rate | How big each gradient-descent step is. Too small = slow; too large = unstable. |
| Epoch / Batch | An epoch is one full pass over the training data. A batch is the small chunk of data used for one update step. |
| Overfitting | The model memorizes the training data (including noise) and does poorly on new data. |
| Underfitting | The model is too simple to capture the real pattern, so it does poorly even on training data. |
| Regularization | Techniques that discourage overly complex models, e.g. Ridge/Lasso penalties, dropout, early stopping. |
| Term | Plain-English meaning |
|---|---|
| Train / Validation / Test | Training data teaches the model; validation data is for tuning choices; the test set is used once at the end for an honest score. |
| Term | Plain-English meaning |
|---|---|
| Cross-validation | Rotating which part of the data is held out for validation, then averaging the scores for a more reliable estimate. |
| Data leakage | Information from the test set (or the future) sneaking into training, which makes scores look better than reality. |
| Confusion matrix | A table of true/false positives and negatives that all classification metrics are built from. |
| Precision | Of everything the model called positive, how much really was positive? |
| Recall | Of everything that really was positive, how much did the model find? |
| F1 score | A single number that balances precision and recall. |
| Class imbalance | When one class is much rarer than the other (e.g. fraud). Accuracy alone becomes misleading. |
| Decision tree / Random forest / Boosting | A tree asks a series of yes/no questions. A forest averages many trees; boosting builds trees one after another, each fixing earlier mistakes. |
| k-NN / k-Means / PCA | k-NN predicts from the k closest examples; k-Means groups similar points into k clusters; PCA compresses many features into fewer. |
| Embedding | A list of numbers (a vector) that represents the meaning of something, so similar things end up close together. |
| Cosine similarity | A score of how closely two vectors point in the same direction. Used to compare embeddings. |
| Neuron / Activation function | A neuron does weights × inputs + bias, then passes the result through an activation function (e.g. ReLU, sigmoid) that adds non-linearity. |
| Term | Plain-English meaning |
|---|---|
| Backpropagation | The method that works out how much each parameter contributed to the loss, using the chain rule from the output back to the input. |
| Dropout / Early stopping | Two ways to fight overfitting: randomly switch off neurons while training, or stop training when validation loss stops improving. |
| CNN | Convolutional neural network: slides small filters over an image to detect patterns such as edges and shapes. |
| Term | Plain-English meaning |
|---|---|
| Token / Tokenization | A token is a piece of text (a word, part of a word, punctuation). Tokenization splits text into tokens and maps each to an integer ID. |
| Attention (Q, K, V) | A mechanism where each token looks at the other tokens and decides how much to focus on each. Query = what I’m looking for, Key = |
what I offer, Value = the information I give.
Transformer The neural-network architecture built from attention, feed-forward layers, residual connections, and layer normalization. It powers modern LLMs.
LLM Large language model: a huge decoder-only Transformer trained to predict the next token.
Prompt The instructions and context you give an LLM.
Vector database A store optimized for fast similarity search over embeddings.
RAG Retrieval-Augmented Generation: fetch relevant documents first, put them in the prompt, then let the LLM answer.
Fine-tuning Further training of a model on your own data, which changes its parameters. (RAG does not.)
Tool calling / Agent Tool calling lets an LLM request that your program run a function. An agent repeats “decide → act → observe” in a loop.
MCP Model Context Protocol: a standard way to connect LLMs to tools and data sources.
Prompt injection Untrusted text that tries to override the instructions you gave the model.
LLMOps The practice of running LLM apps in production: monitoring, tracing, cost, versioning.