Skip to content
ML to LLMs

Cheat sheets

One page per topic, for review and interviews. Each sheet links back to the full lessons.

Activation functionsReLU, GELU, sigmoid, tanh, and softmax, their derivatives, and where each is used.Agents and tool useTool calling, the agent loop, token growth, MCP, workflow patterns, reliability math, and guardrails on one page.Classification metricsConfusion matrix, precision, recall, F1, ROC and PR curves, calibration, and how to pick a threshold.Clustering algorithmsK-means, DBSCAN, hierarchical, and Gaussian mixtures compared, with how to choose and validate.Common failure modesThe mistakes that most often make ML and LLM systems fail, and how to catch each one.Fine-tuningPost-training stages, SFT data rules, memory math for full fine-tuning, LoRA, and QLoRA, and the DPO and GRPO formulas.Important formulasThe formulas worth remembering, with the lesson that derives each.LLM adaptationPrompting, RAG, fine-tuning, LoRA, and preference optimization compared by what they change and when to use them.LLM evaluationMetrics for every layer of an LLM system and how to compare versions soundly.LLM inferenceKV-cache and decode-speed formulas, inference optimizations, serving techniques, latency metrics, and cost per token on one page.Loss functionsWhich loss to train with for each task, and what each one encourages.ML system designThe ten-step design framework as a checklist, the recommendation funnel, data pitfalls, and the A/B test formulas.Model selectionWhat to try first for each kind of problem, what to try next, and the questions to ask before trusting any result.NLP representationsFrom bag-of-words and TF-IDF to static and contextual embeddings, with trade-offs.OptimizersGradient descent variants, momentum, Adam and AdamW, learning-rate schedules, and the stability limit.Production reliabilityPatterns, formulas, and monitoring for dependable, affordable AI services.RAG pipelineEvery stage of retrieval-augmented generation, its knobs, and its failure modes.Regression metricsMAE, MSE, RMSE, R², and MAPE, with when to use each.RegularizationEvery technique that fights overfitting, what it does, and when to reach for it.Security controlsThreats to LLM applications and the enforceable controls that contain them.Tensor shapesThe shapes you will see in every model, and the bugs that come from losing track of them.Transformer architectureAttention, blocks, shapes, families, and costs on one page.Vector searchSimilarity metrics, exact vs approximate nearest-neighbor indexes, their knobs and memory, hybrid search with RRF, and filtering pitfalls.