# Easy Explain > Free lessons from the Easy Explain YouTube channel (https://www.youtube.com/@EasyExplain-p7x). Every video has a read-along article built from its script, split into chapters with timestamps that link back into the video. 170 lessons in 6 playlists. Each lesson page (/lesson/) holds the full article text, the chapter list and the embedded video. Append ?t= to open a lesson at that moment. Search covers every script: https://easy-explain-app.vercel.app/search?q=. ## Machine Learning from Zero to Advanced A 30-episode visual course taking you from no background to advanced machine learning. Math (algebra, linear algebra, calculus, probability) is taught from scratch with animations and hand-worked numbers. Each algorithm is then derived, coded from scratch in Python, checked against scikit-learn or PyTorch, and evaluated honestly, ending with deep learning, Transformers, RL and production. - [1. What Is Machine Learning? A Visual Introduction for Beginners](https://easy-explain-app.vercel.app/lesson/aXu7_PC4vgE): How does your email know which messages are spam without anyone writing every rule? This video is a visual, math-light introduction to machine learning. - [2. Algebra Essentials for Machine Learning: Functions, Exponents, Logs and Sigma](https://easy-explain-app.vercel.app/lesson/yMwfees6Z6Y): Every machine learning formula is built from a few algebra ideas. In this episode you learn them from zero and then read a real loss formula symbol by symbol. - [3. Vectors and Dot Products: The Geometry Behind Every ML Prediction](https://easy-explain-app.vercel.app/lesson/Ax-Uu4PxPbA): Every machine learning prediction starts with one tiny operation: the dot product. In this episode we build vectors from scratch and see them as arrows and as rows of data. - [4. Matrices as Transformations: See Linear Algebra Move](https://easy-explain-app.vercel.app/lesson/FHu18ys-mhA): What if a matrix isn't a table of numbers, but a machine that bends space itself? - [5. Eigenvectors, SVD and Positive-Definite Matrices Explained Visually](https://easy-explain-app.vercel.app/lesson/-AbdWaQPATs): Most vectors get knocked off course by a matrix. A few special ones don't. Learn why eigenvectors matter, how to find them by hand, and how SVD can compress an image. - [6. Derivatives From First Principles: Slopes, Rules and Why ML Needs Them](https://easy-explain-app.vercel.app/lesson/IvwdUuBQQGo): What does it mean for a curve to have a slope at a single point? In this episode we build the derivative from scratch, using nothing but a moving secant line and a limit. - [7. Partial Derivatives, Gradients, Jacobians and Hessians Explained Visually](https://easy-explain-app.vercel.app/lesson/molE_I8OPeY): What happens when a function has many inputs? Machine learning models have millions of them, and calculus still works. - [8. Probability Basics and Bayes' Theorem: Why a 90% Accurate Test Can Be Wrong](https://easy-explain-app.vercel.app/lesson/w8eFAvJn69c): A positive result on a 90 percent accurate medical test does not mean you are 90 percent likely to be sick. In this episode we find out why, using probability and Bayes' theorem. - [9. Distributions, Expectation and the Central Limit Theorem Explained Visually](https://easy-explain-app.vercel.app/lesson/Jy5lkk6zkiA): Why does the bell curve show up everywhere, even when the data itself is not bell shaped? In this episode we build the answer from the ground up. - [10. Maximum Likelihood, Entropy and Cross-Entropy Explained From Scratch](https://easy-explain-app.vercel.app/lesson/0eev3TzfMMU): Why does almost every classifier in machine learning minimize cross-entropy? Because it is secretly maximum likelihood in disguise. - [11. Loss Functions and Gradient Descent Explained Visually, With Numbers](https://easy-explain-app.vercel.app/lesson/bbq41oFCMUw): How does a machine actually learn? It rolls downhill. In this video we build loss functions and gradient descent from scratch, with every number worked out by hand. - [12. Python and Data Foundations for ML: NumPy, Pandas, EDA and Data Leakage](https://easy-explain-app.vercel.app/lesson/lxQokWFy5Qc): Most machine learning bugs hide in the data code, not the algorithm. In this episode you learn the Python, NumPy, Pandas and plotting skills every ML project relies on, and how to avoid data leakage. - [13. Overfitting and the Bias-Variance Trade-off, Derived Step by Step](https://easy-explain-app.vercel.app/lesson/8ayFobAlFks): Why does a model that scores perfectly on training data fail on new data? In this episode we build the answer from scratch: polynomial fits, training versus validation curves, and a full… - [14. Linear Regression Explained: Normal Equation to Gradient Descent](https://easy-explain-app.vercel.app/lesson/CkyQHRN9-Q4): Two ways to fit the same line: solve it in one shot with the normal equation, or walk downhill with gradient descent. Which one should you trust? - [15. Logistic Regression and Softmax: Derived from Scratch, Step by Step](https://easy-explain-app.vercel.app/lesson/_e4mvvr9lkc): How does a model turn a straight line into a probability? In this episode we derive logistic regression and softmax from first principles, with every step worked out in numbers. - [16. Classification Metrics, Thresholds and Calibration Explained Visually](https://easy-explain-app.vercel.app/lesson/H7-1wi9Nh8A): A model with 98 percent accuracy can be completely useless. In this episode we build classification metrics from scratch and learn when to trust each one. - [17. Regularization and Feature Engineering: Ridge, Lasso and Leak-Free Pipelines](https://easy-explain-app.vercel.app/lesson/IpjebaPURYo): Why do models with more features often get worse on new data, and how do you fix it? In this episode we build the full toolkit: polynomial features, categorical encoding, scaling, multicollinearity,… - [18. k-Nearest Neighbors and Naive Bayes Explained: Distance, Bayes, Spam Filters](https://easy-explain-app.vercel.app/lesson/g3J4jvnm8Bk): What if the best classifier were just a lookup, and the other one a clever use of counting? - [19. Decision Trees Explained: Entropy, Gini, Pruning and Code From Scratch](https://easy-explain-app.vercel.app/lesson/k-ZNVu4GNMs): How does a machine learn a flowchart from data? In this episode we build a decision tree by hand, with real numbers, from the very first split to the final leaf. - [20. Random Forests, Boosting and SHAP Explained With Real Numbers](https://easy-explain-app.vercel.app/lesson/5EvGJ8-1NHY): Why does a crowd of weak decision trees beat one clever model? This episode builds bagging, random forests, AdaBoost, gradient boosting, XGBoost, stacking and SHAP from the ground up, with… - [21. Support Vector Machines and Kernels Explained: Margins, Duals, RBF](https://easy-explain-app.vercel.app/lesson/N7cNfErHgS0): What if the best classifier is the one that stays as far from the data as possible? In this episode we build Support Vector Machines from the ground up. - [22. Clustering Explained: k-Means, Hierarchical, DBSCAN and GMM](https://easy-explain-app.vercel.app/lesson/2tFni5w6xbY): How do you find groups in data when nobody tells you the answer? In this episode we build clustering from the ground up, with math, worked numbers and animation. - [23. PCA, SVD, t-SNE and UMAP: Dimensionality Reduction Explained Visually](https://easy-explain-app.vercel.app/lesson/jFOKSPLdYCc): How do you squeeze a thousand features into two without losing what matters? This video builds PCA from first principles, derives it with a Lagrange multiplier, connects it to SVD, then explains… - [24. Model Evaluation and Selection Done Right: CV, Tuning, Leakage](https://easy-explain-app.vercel.app/lesson/QtrXGxCCndg): Your model scored 95 percent. Can you trust it? Probably not yet. - [25. Time Series and Forecasting: ARIMA, Smoothing and Leakage Explained](https://easy-explain-app.vercel.app/lesson/IOQ8selTgqc): Why does shuffling your data ruin a forecast? Learn how time series really work, step by step, with numbers you can check by hand. - [26. Neural Networks From Scratch: Backpropagation Derived Step by Step](https://easy-explain-app.vercel.app/lesson/6nbA8-8SlrQ): Build a neural network from scratch in NumPy and derive backpropagation layer by layer, with real numbers at every step. - [27. PyTorch and Convolutional Neural Networks: Tensors to Transfer Learning](https://easy-explain-app.vercel.app/lesson/RXIt1OF8dYs): Ever wondered how a computer actually sees an image, and how a few lines of PyTorch can teach it to recognize one? In this episode we go from tensors and autograd to convolution computed by hand,… - [28. RNNs, LSTMs and Attention Explained With Real Numbers](https://easy-explain-app.vercel.app/lesson/YZg2ugwLMaQ): How does a neural network read a sentence one word at a time and still remember the beginning? In this episode we build recurrent networks from scratch, with real numbers at every step. - [29. Transformers Explained: Attention, Math and How LLMs Really Work](https://easy-explain-app.vercel.app/lesson/5RTu_dLI92Q): Every modern language model is built from one idea: attention. In this episode we build a transformer from the ground up, with real numbers and visuals. - [30. Reinforcement Learning, Causal Inference and MLOps: The ML Capstone](https://easy-explain-app.vercel.app/lesson/GQSqL3a3tOU): What happens when a model has to learn by acting, and then survive in the real world? This final episode ties the whole course together. - [31. NumPy Arrays, Shapes and Broadcasting Explained Visually (ML Lesson 31)](https://easy-explain-app.vercel.app/lesson/c06DC_PeDyM): One million numbers, one slow Python loop, one fast NumPy line. Why is the gap so big, and how do you think in arrays? - [32. Pandas Essentials for Machine Learning Data (Lesson 32)](https://easy-explain-app.vercel.app/lesson/BeFK-uDJq04): Most machine learning time is spent on tables, not models. This lesson teaches the pandas skills you need, checked by hand on a tiny toy table. - [33. Plotting and EDA: Look at Your Data Before You Model It](https://easy-explain-app.vercel.app/lesson/0QpZwWO2OVc): Four datasets can share the same summary numbers and look completely different. Learn why you must plot your data before training any model. - [34. Data Cleaning for ML: Missing Values, Outliers and Feature Types](https://easy-explain-app.vercel.app/lesson/FXraVViHNMg): Your model is only as good as the data you feed it. Here is how to clean that data without fooling yourself. - [35. Why Your 99% Model Is a Lie: Leakage-Safe Splits and Pipelines](https://easy-explain-app.vercel.app/lesson/5LFFz4UvfYc): Your model scores 99 percent in testing and fails in production. The cause is almost always data leakage. - [36. The Chain Rule and Computational Graphs: How Gradients Really Flow](https://easy-explain-app.vercel.app/lesson/78jRUEZ09uQ): Every neural network trains because of one idea from calculus: the chain rule. In this lesson we derive it from first principles, check it with real numbers, and then turn it into a machine. - [37. Convexity and Lagrange Multipliers: Optimization With Rules (ML Lesson 37)](https://easy-explain-app.vercel.app/lesson/LdScZx8zULU): What if the best answer is not allowed? Learn why convex functions have no bad valleys, and how Lagrange multipliers and KKT conditions solve optimization problems with constraints. - [38. Covariance, Correlation and the Multivariate Gaussian Explained](https://easy-explain-app.vercel.app/lesson/dHQit23qfN0): Two numbers can move together, yet a correlation of zero can still hide a perfect relationship. Here is how to read covariance, correlation and the Gaussian properly. - [39. Confidence Intervals and Hypothesis Tests for ML: Is Your Model Really Better?](https://easy-explain-app.vercel.app/lesson/gz8iIMTJDqY): Your new model scores 90 percent and the old one scores 88. Is that a real improvement, or just luck? - [40. Linear Regression From Scratch in NumPy: Assumptions and Residual Analysis](https://easy-explain-app.vercel.app/lesson/J9tqB8iGkP8): Your linear regression runs and gives numbers. But can you trust them? - [41. Logistic Regression Gradient Derived From Scratch (Full Math + NumPy)](https://easy-explain-app.vercel.app/lesson/3aumzTBOzbQ): One line of algebra hides inside every classifier you have ever trained: gradient equals X transpose times prediction minus label. In this lesson we derive it from scratch. - [42. Gradient Boosting and XGBoost: The Math, Derived Step by Step](https://easy-explain-app.vercel.app/lesson/69WmnK-_Zlk): Why do boosted trees win so many tabular data problems? Because they are gradient descent, performed on functions instead of numbers. - [43. The SVM Dual and the Kernel Trick: The Math Explained Step by Step](https://easy-explain-app.vercel.app/lesson/b45BFw0izZI): How can a machine learning model work in infinite dimensions without ever computing a single coordinate? The answer is the SVM dual and the kernel trick. - [44. Expectation-Maximization for Gaussian Mixtures: The Full Math and Code](https://easy-explain-app.vercel.app/lesson/brnKyvuAj1s): What do you do when the cluster label of every data point is hidden? Expectation-Maximization is the elegant answer, and in this lesson we build it from the ground up. - [45. Hyperparameter Search and Bayesian Optimization Explained With Numbers](https://easy-explain-app.vercel.app/lesson/ZOVWaRW4rOU): Stop guessing learning rates. Learn how to tune models with a plan: random search, nested cross-validation, Hyperband, and Bayesian optimization. - [46. ARIMA and Exponential Smoothing Explained With Real Numbers](https://easy-explain-app.vercel.app/lesson/SWAlHphGh8E): Two classic forecasting families, ARIMA and exponential smoothing, built from the ground up with hand-worked numbers. - [47. Weight Initialization, Vanishing Gradients and Optimizers: Why Deep Nets Train](https://easy-explain-app.vercel.app/lesson/TSo1n2doPzE): Why does a deep network sometimes refuse to learn at all? Often the answer is decided before the first training step. - [48. Dropout and Batch Normalization Explained With Numbers and NumPy Code](https://easy-explain-app.vercel.app/lesson/gognHqfQcWs): Why does randomly deleting neurons make a network better? And how does normalizing activations make training faster? We derive dropout and batch normalization step by step with concrete numbers,… - [49. PyTorch Tensors and Autograd: Gradients You Can Verify by Hand](https://easy-explain-app.vercel.app/lesson/bFJjj6ImHj4): What if you never had to differentiate by hand again, but could still prove the answer is right? - [50. PyTorch Training Loops, DataLoaders, GPUs and Debugging Explained](https://easy-explain-app.vercel.app/lesson/VY9uxf-iL24): Your model trains, but is it trained correctly? Learn the full PyTorch workflow, from Dataset and DataLoader to a clean training loop, GPU use and a practical debugging checklist. - [51. Convolution Explained: Kernels, Stride, Padding and Pooling by Hand](https://easy-explain-app.vercel.app/lesson/JcH2-HBVRyk): A 150 million weight layer or 1,792 weights? Learn why convolution is the right tool for images. - [52. CNN Architectures: LeNet, ResNet, Transfer Learning and Grad-CAM Explained](https://easy-explain-app.vercel.app/lesson/lI17nJKRu_Q): What if you could train a great image classifier with a few hundred photos and a few minutes of compute? In this lesson we build a small CNN in PyTorch, follow the architecture story from LeNet to… - [53. LSTM, GRU and Backpropagation Through Time Explained With Numbers](https://easy-explain-app.vercel.app/lesson/3ZM-ZKsSBRI): Why can a simple RNN read ten words but forget a hundred? This lesson unrolls the RNN, derives backpropagation through time, and shows the product of Jacobians behind vanishing and exploding… - [54. Tokenization and Embeddings: How Text Becomes Numbers (BPE by Hand)](https://easy-explain-app.vercel.app/lesson/Iy_B-XHWHMI): A language model has never read a word. It only sees integers. Here is exactly how text becomes numbers, worked out by hand. - [55. Attention Explained With Real Numbers: Scaled Dot-Product and Multi-Head](https://easy-explain-app.vercel.app/lesson/ENqhiW4D0qg): Attention is the engine of every transformer, but most explanations stop at a diagram. In this lesson we compute it by hand, number by number. - [56. The Full Transformer Block: Residuals, LayerNorm, GPT vs BERT vs T5](https://easy-explain-app.vercel.app/lesson/Zp_WLVXYeGA): Every large language model is one small block stacked over and over. In this lesson we assemble that block piece by piece and run it ourselves. - [57. Pretraining, Fine-Tuning and LoRA Explained With Real Numbers](https://easy-explain-app.vercel.app/lesson/YDtcMzyMsI8): How does a model that only predicts the next word become a helpful assistant, and how can you adapt a huge model on one GPU? - [58. How LLMs Actually Run: Decoding, KV Cache, Latency and Limits](https://easy-explain-app.vercel.app/lesson/5-IcrmTgoro): Training gets the headlines, but inference is where language models meet reality: memory, speed, cost and mistakes. - [59. Reinforcement Learning I: MDPs, Bellman Equations, DP and Monte Carlo](https://easy-explain-app.vercel.app/lesson/EmuVFna7xsw): How does a machine learn to act when nobody tells it the right answer? Lesson 59 builds reinforcement learning from the ground up. - [60. Reinforcement Learning II: TD, Q-Learning, Policy Gradients, DQN and PPO](https://easy-explain-app.vercel.app/lesson/su8pblpqdY4): How does an agent learn from a single step instead of waiting for the whole episode? This lesson takes you from temporal difference learning to Q-learning, Deep Q-Networks, policy gradients and PPO,… - [61. Bayesian ML: MAP, Priors, and Gaussian Processes Explained](https://easy-explain-app.vercel.app/lesson/8UoERDhvwBc): What if your model could say "I'm not sure" and mean it? Lesson 61 shows how probability turns guessing into reasoning. - [62. Trustworthy ML: Uncertainty, Shift, Fairness and Robustness Explained](https://easy-explain-app.vercel.app/lesson/pOtWsuMS0CQ): Your model scores 95 percent in testing. Why might you still not trust it? - [63. MLOps: Reproducible Pipelines, Serving, Deployment and Monitoring](https://easy-explain-app.vercel.app/lesson/VbGnNgIIbeo): Your model works in a notebook. Now what? This lesson shows how to take a machine learning model into production and keep it healthy. - [64. Two Full ML Projects: House Prices and Customer Churn, Start to Finish](https://easy-explain-app.vercel.app/lesson/45G2SdpIR94): Two end-to-end tabular machine learning projects, built with one repeatable template. - [65. Credit Risk, Fairness and Anomaly Detection: Capstone 3 and 4](https://easy-explain-app.vercel.app/lesson/ut6ijfBnO_Y): Can a model that is accurate still be unfair? In this capstone we build a credit-risk classifier end to end, then audit it for fairness, and finally hunt rare anomalies with no labels at all. - [66. Spam Filter and Text Classifier From Scratch: Naive Bayes to Transformers](https://easy-explain-app.vercel.app/lesson/byiMkOlGXG0): Can a 1960s-style probability trick compete with a fine-tuned Transformer? We build a spam filter from scratch, then a multi-class text classifier, and compare them honestly. - [67. Customer Segmentation and a Recommender From Scratch (Capstone 7-8)](https://easy-explain-app.vercel.app/lesson/QciYJlJpU_M): Build two classic ML products from scratch: a customer segmentation with RFM features, k-means and Gaussian mixtures, and a movie recommender with item-based neighbors and matrix factorization. - [68. Capstone: Train a CNN and a Tiny GPT From Scratch (Grad-CAM, Perplexity)](https://easy-explain-app.vercel.app/lesson/ANgBPEtDOrM): Two real projects, one video: classify images with a CNN and transfer learning, then train a tiny GPT that writes Shakespeare-like text. - [69. Forecasting to Production: Time Series, FastAPI, Docker and Drift Monitoring](https://easy-explain-app.vercel.app/lesson/FqSmDj7BpIo): Can a forecast survive contact with the real world? In this capstone we build a time-series forecaster honestly, then ship it as a tested, containerized, monitored API. - [70. Machine Learning Course Wrap-Up: The Full Map and Your Roadmap Beyond](https://easy-explain-app.vercel.app/lesson/I1hRcbRTP-o): You finished 70 lessons of Machine Learning from Zero to Advanced. Here is the complete map of everything you learned, the six principles that tie it together, and a clear roadmap for what to do next. ## Generative AI & LLM Engineering: Transformers to Agents A practical 40-lesson follow-on to "Machine Learning from Zero to Advanced". Go from how GPT models are trained and sampled, through prompting, embeddings, vector search, RAG and fine-tuning, to tool-using agents, MCP and production serving. It ends with four capstone projects and a roadmap. Every lesson gives intuition, math, a worked numeric example and runnable provider-neutral Python. - [1. How GPT Is Trained: Next-Token Prediction Explained with Math and Code](https://easy-explain-app.vercel.app/lesson/0wx-GpS2kns): Every GPT model starts with one simple game: predict the next token. Here is how that game becomes a chatbot. - [2. Scaling Laws Explained: Why Bigger Models Keep Getting Better](https://easy-explain-app.vercel.app/lesson/vItWq_4QhSE): Why does making a language model bigger keep making it better, and so predictably? In this lesson we unpack scaling laws: power laws, the compute rule C ≈ 6ND, a worked GPU-days estimate for a 7B… - [3. Sampling Explained: Greedy, Temperature, Top-k, Top-p (With Numbers)](https://easy-explain-app.vercel.app/lesson/r3LnXDOJZ_8): Why does the same LLM sound robotic in one app and wildly creative in another? The answer is not in the model. It is in how we pick the next token. - [4. Context Windows and RoPE Explained: How LLMs Know Word Order](https://easy-explain-app.vercel.app/lesson/oPNrMkhFJGg): How does a Transformer know which word came first? We derive Rotary Position Embeddings (RoPE) from scratch, work a 2D example with real numbers, and verify the relative-position property in PyTorch. - [5. The KV Cache Explained: Why LLM Decoding Is Memory-Bound](https://easy-explain-app.vercel.app/lesson/uJLSDw2xJ4w): Why does a GPU that can do hundreds of trillions of operations per second still crawl through text one token at a time? The answer is the KV cache and memory bandwidth. - [6. Why LLMs Hallucinate (and What Actually Helps)](https://easy-explain-app.vercel.app/lesson/zalzq8lOAKk): Why does a language model confidently invent facts, names and citations? Because it is trained to produce plausible text, not true text. - [7. Prompt Patterns and System Prompts: Programming in Plain English](https://easy-explain-app.vercel.app/lesson/S_9qB8jhqGk): Prompting is programming with natural language specs. Learn the patterns that make LLM output reliable. - [8. Few-Shot Prompting and In-Context Learning Explained (With Code)](https://easy-explain-app.vercel.app/lesson/IqdOibMocJc): What if you could teach a language model a brand new task without changing a single weight? That is in-context learning, and it is the engine behind few-shot prompting. - [9. Chain-of-Thought and Reasoning Models: How LLMs Learn to Think](https://easy-explain-app.vercel.app/lesson/YY8UJ1Y8vJ8): Why does asking a model to think step by step change its answers? This lesson explains chain-of-thought prompting, self-consistency voting with a worked probability example, tree search ideas, and… - [10. Structured Output and Evaluating Prompts Like Real Software](https://easy-explain-app.vercel.app/lesson/sJRSjP-zGWk): Your LLM works in the demo, then breaks your parser in production. Here is how to fix both problems. - [11. Sentence Embeddings and Contrastive Training: How Meaning Becomes Math](https://easy-explain-app.vercel.app/lesson/EYVVDHaVXxY): How does a computer know that "How do I reset my password?" and "I forgot my login" mean the same thing? Sentence embeddings turn text into points in space, and contrastive training teaches them… - [12. Cosine vs Dot Product: How Exact Vector Search Really Works](https://easy-explain-app.vercel.app/lesson/m3l8mcvY2d4): Your vector search can return the wrong results even when the embedding model is perfect. The cause is often a mismatch between dot product, cosine similarity and Euclidean distance. - [13. ANN Indexes Explained: HNSW, IVF and Product Quantization](https://easy-explain-app.vercel.app/lesson/744E2X-idks): How do vector databases search millions of embeddings in milliseconds? Learn how HNSW graphs, IVF clustering and product quantization trade a little recall for huge speed and memory savings. - [14. Vector Databases in Practice: Filtering, Sizing, and Real Code](https://easy-explain-app.vercel.app/lesson/ZtTkvM-SGBM): An ANN index is not a database. Learn what a vector database really adds, and how to use one well. - [15. RAG Explained: How to Ground LLMs in Your Own Data](https://easy-explain-app.vercel.app/lesson/jnQoARknUXg): What if your LLM could look up the answer instead of guessing it? - [16. Chunking Strategies for RAG: How to Split Documents Right](https://easy-explain-app.vercel.app/lesson/N6x7Wnjq9SQ): Your RAG system can only find what you chunked well. Learn fixed-size, recursive, structure-aware, semantic and parent-document chunking, with real numbers and Python. - [17. Retrieval and Query Rewriting: Fix RAG Before It Fails](https://easy-explain-app.vercel.app/lesson/T2bEWLvGz7M): Your RAG bot has the right document and still answers wrong. The problem is often the query, not the index. - [18. Reranking with Cross-Encoders: The Cheap Trick That Fixes RAG Search](https://easy-explain-app.vercel.app/lesson/jjll_YlwJn0): Your vector search finds roughly the right documents, but the best one is stuck at rank 7. Cross-encoder reranking fixes that. - [19. Hybrid Search Explained: BM25 + Dense Vectors with Reciprocal Rank Fusion](https://easy-explain-app.vercel.app/lesson/D5GscpT1ars): Your vector search just missed an exact error code. Here is why, and how hybrid search fixes it. - [20. Evaluating RAG: Metrics, Test Sets and 8 Failure Modes](https://easy-explain-app.vercel.app/lesson/uActEaJAYkk): Your RAG demo looks great, so why does it fail in production? Because you are probably judging it by eyeballing a few answers. - [21. Supervised Fine-Tuning Explained: Chat Templates, Loss Masking and Code](https://easy-explain-app.vercel.app/lesson/u8pitUokrfE): How does a model that only predicts the next token become an assistant that follows instructions? In this lesson we build supervised fine-tuning from the ground up. - [22. LoRA Math Explained: Low-Rank Adaptation Derived From Scratch](https://easy-explain-app.vercel.app/lesson/0FyEOCwDgts): Fine-tune a huge model by training less than half a percent of one weight matrix? Here is exactly why LoRA works. - [23. QLoRA Explained: Fine-Tune a 7B Model on One GPU with 4-Bit Quantization](https://easy-explain-app.vercel.app/lesson/ZfeWoghxgII): A 7 billion parameter model needs over 100 gigabytes to fine-tune the normal way. QLoRA does it in a fraction of that. Here is exactly how. - [24. RLHF Explained: Reward Models, KL Penalty and PPO Step by Step](https://easy-explain-app.vercel.app/lesson/1TtwvD2JivM): How does a raw language model become a helpful assistant? Reinforcement learning from human feedback, explained with real numbers. - [25. DPO Derived: Preference Optimization Without RL](https://easy-explain-app.vercel.app/lesson/FrgRkrSXLfE): What if you could get the benefits of RLHF with a single, simple classification-style loss? In this lesson we derive Direct Preference Optimization from scratch. - [26. Fine-Tune vs RAG vs Prompt: How to Decide (A Practical Framework)](https://easy-explain-app.vercel.app/lesson/3X79mWN6jH4): Should you prompt, retrieve, or fine-tune? Most teams pick the wrong tool first. This lesson gives you a clear decision ladder, a cost comparison with hypothetical prices, four case studies, and… - [27. Tool and Function Calling: How LLMs Actually Use Tools](https://easy-explain-app.vercel.app/lesson/5BBBJGuUpmY): A language model can only write text, so how does it check the weather, do exact math, or call your API? The answer is tool calling: the model writes a request, and your code acts. - [28. The ReAct Loop, Planning and Reflection: How AI Agents Actually Think](https://easy-explain-app.vercel.app/lesson/IJum0tlGedQ): Build an AI agent from scratch: the ReAct loop explained, plus planning, reflection and the failure modes that sink real agents. - [29. Agent Memory Explained: Short-Term, Long-Term and Context Management](https://easy-explain-app.vercel.app/lesson/bz2vS3a1_TM): Your agent forgets everything the moment the context window closes. Here is how to fix that. - [30. Multi-Agent Systems: When They Help and When They Hurt](https://easy-explain-app.vercel.app/lesson/oBs2xT2_gJU): More agents is not automatically better. Learn when splitting work across agents pays off, and when one agent wins. - [31. Model Context Protocol (MCP) Explained: One Standard for AI Tools](https://easy-explain-app.vercel.app/lesson/TqUMJN2kYFI): Every AI app needs tools, and every tool needs every app. MCP is the open protocol that turns that mess into one clean standard. - [32. Latency and Cost Math for LLM Applications: Predict Your Bill](https://easy-explain-app.vercel.app/lesson/NhA_XtqraH0): Your LLM demo costs a fraction of a cent. Your production bill says otherwise. Learn the math that explains why. - [33. Quantization Explained: INT8, INT4, GPTQ and AWQ for LLMs](https://easy-explain-app.vercel.app/lesson/7b1C-BeC5wU): How do you fit a 70 billion parameter model into a fraction of the memory without wrecking it? Quantization. - [34. Serving LLMs with vLLM: Continuous Batching and PagedAttention Explained](https://easy-explain-app.vercel.app/lesson/CDgof5l1jDA): Why does the same GPU serve several times more users with vLLM? Two ideas: continuous batching and PagedAttention. - [35. LLM Guardrails and Prompt Injection: Securing and Monitoring AI in Production](https://easy-explain-app.vercel.app/lesson/i8pR2yRAT4A): Your LLM app passed every eval, so why can one pasted web page make it leak data? - [36. Build a Document Q&A RAG Bot: Hybrid Search, Reranking, Citations, Evals](https://easy-explain-app.vercel.app/lesson/8cwn3yn-ooc): Most RAG demos work on three hand-picked questions and fall apart on the fourth. In this capstone we build a document Q&A bot that you can actually trust, and we prove it with an eval set. - [37. Capstone 2: Build a Repo-Aware Coding Assistant (Python, Sandboxed, Tested)](https://easy-explain-app.vercel.app/lesson/6T6zVctD2EM): What does it take to build a coding assistant that edits your code and proves it works? In this capstone we build one from scratch in plain Python. - [38. Capstone: Fine-Tune a Small Open Model End to End (QLoRA + TRL)](https://easy-explain-app.vercel.app/lesson/zmteR_v5BAo): Fine-tune a small open model for a narrow task, the right way: baseline first, clean data, QLoRA with TRL, honest evaluation, merge, quantize, and ship with a model card. - [39. Capstone 4: Deploy a Tool-Using AI Agent to Production (FastAPI, Docker, Guardrails)](https://easy-explain-app.vercel.app/lesson/unxHpAvwR0c): Build and ship a production-style tool-using agent: tool calling, memory, step and cost budgets, guardrails, human approval, FastAPI streaming, Docker, tracing, CI evals, canary and rollback. - [40. LLM Engineering Roadmap: What You Learned and Where to Go Next](https://easy-explain-app.vercel.app/lesson/lU4UiB3x1V0): You finished the course. Now what? This final lesson turns forty lessons into one mental map, from foundations to production. ## Inside Kestrel: Building a C++ Trading Platform A code-level tour of Kestrel, a C++20 backtesting, paper and live trading platform for NSE, BSE and MCX on the FYERS API. We animate the engine's deterministic event loop, the fill and Indian cost models, Black-Scholes and IV surfaces, backtest metrics, and the multi-process services that handle market data, orders and live-trading safety. Educational only, not financial advice. - [1. Kestrel in One Picture: One Engine, Three Modes](https://easy-explain-app.vercel.app/lesson/EgmlrRIfqY8): What if your backtest and your live trading ran the exact same code? Kestrel, a C++20 trading platform for Indian markets, does exactly that. - [2. Kestrel Build System: CMake Modules and a Zero-Comment Rule](https://easy-explain-app.vercel.app/lesson/j-wYUGibQjc): What happens when a C++20 trading codebase enforces its own boundaries? Kestrel turns every directory into a static library, makes dependency cycles impossible by design, and bans comments with a… - [3. Kestrel Core Vocabulary: Ticks, IST Time and the Run Config](https://easy-explain-app.vercel.app/lesson/cPe2E0X15Gc): Before any engine logic, a trading system needs words it can trust. This episode walks through Kestrel's base types, the variant-index trick, tick rounding with an epsilon, hand-written IST time,… - [4. The History Store: Bar Files That Never Corrupt (Kestrel Ep. 4)](https://easy-explain-app.vercel.app/lesson/CeyDpWRj1Ls): What happens to your backtest when a data file is half written, or when every bar is one minute too early? In this episode we open Kestrel's history store and see how it survives crashes and… - [5. The Event Bus and K-Way Merge: Why Every Backtest Is Bit-Identical](https://easy-explain-app.vercel.app/lesson/ACqV2HMDSWw): Run the same backtest twice and get the exact same bytes. How? - [6. Inside Kestrel: The Per-Bar Pipeline, Derived Bars and Expiry](https://easy-explain-app.vercel.app/lesson/uqtCDPxQnqg): One bar arrives. What happens next, and in what order? In this episode we walk through Kestrel's handleBar pipeline in a C++20 trading engine, and see why the order of steps prevents lookahead bugs. - [7. Kestrel Alpha Framework: Interfaces, Gates and Target Positions](https://easy-explain-app.vercel.app/lesson/IWycUa9mA7U): How does one C++ strategy object run unchanged in backtest, paper and live trading? Through a narrow interface, a chain of gates, and a habit of trading to targets instead of deltas. - [8. OMS and Risk: Normalise, Check, Then Send (Kestrel Code Walkthrough)](https://easy-explain-app.vercel.app/lesson/K82HXlABkK4): What happens between an alpha saying "sell 60" and an order reaching a venue? In Kestrel, every order is normalised, risk-checked in a fixed order, and only then sent. - [9. Positions and P&L in C++: Average Cost, Flips and Futures Variation Margin](https://easy-explain-app.vercel.app/lesson/Y1bAzh2dNCA): How does a trading engine know what you own, what you paid, and what you have made? Kestrel answers with one small function. - [10. The Simulated Venue: How Kestrel Fills Orders Without Lookahead](https://easy-explain-app.vercel.app/lesson/nVIKJndn4Is): When exactly does a simulated order fill, and at what price? A backtest that fills at the wrong bar quietly lies to you. - [11. The Indian Cost Model: Brokerage, STT, GST and Every Fee Per Fill](https://easy-explain-app.vercel.app/lesson/l31ennq60ME): A single option trade can look cheap and still pay seven different charges. In this episode of Inside Kestrel we build the Indian cost model line by line. - [12. Black-Scholes, Greeks and Implied Volatility by Bisection in C++](https://easy-explain-app.vercel.app/lesson/YkKtVWDa2BY): Why does a production options library solve implied volatility with bisection instead of Newton's method? We read Kestrel's Black-Scholes code line by line. - [13. Building an IV Surface: Parity Forward, Black-76, 25-Delta Wings](https://easy-explain-app.vercel.app/lesson/48rKkAOY_Yw): How do you turn a noisy option chain into one clean volatility number? In this episode of Inside Kestrel we build an implied volatility surface from scratch: a put-call parity forward, Black-76… - [14. Backtest Metrics: Welford Sharpe, Sortino and Drawdown in C++](https://easy-explain-app.vercel.app/lesson/tdfIdEJjsjA): Four equity points can produce a Sharpe ratio above 12. Here is why, and how Kestrel's BacktestMetrics computes Sharpe, Sortino, volatility, CAGR and drawdown in one streaming pass. - [15. Kestrel Backtest Jobs, Parameter Sweeps and Honest Walk-Forward](https://easy-explain-app.vercel.app/lesson/Myr5kcD89y8): How do you run hundreds of backtests without cheating, without a network, and without fooling yourself? - [16. Golden Tests, Fakes and the Run Archive: Proving a Trading Engine Unchanged](https://easy-explain-app.vercel.app/lesson/W8ETv5s93Ig): How do you refactor a trading engine and prove that not a single byte of behaviour changed? - [17. Why Kestrel Runs as Many Processes: The Live Architecture](https://easy-explain-app.vercel.app/lesson/41xVtq8a8Iw): One engine, many processes: why Kestrel splits paper and live trading into kestrel_md, kestrel_orders and kestrel_trader. - [18. Wire Framing and Loopback Security: Inside Kestrel's Local Sockets](https://easy-explain-app.vercel.app/lesson/NGBnBN60qBg): Four bytes of length, a streaming parser that rejects a 4 GB lie instantly, and a browser tab that hits three walls. - [19. Kestrel: A Bounded HTTP Server, dlopen libcurl, and a Hand-Built WebSocket](https://easy-explain-app.vercel.app/lesson/vBpYOEogxZ8): What if your trading binary could use libcurl without ever linking it, and speak WebSocket without a library? - [20. Decoding the FYERS Binary Market-Data Protocol, Byte by Byte](https://easy-explain-app.vercel.app/lesson/qkZd9fvyPtU): Seventeen bytes arrive on a websocket. Can you turn them into a price safely? We decode the FYERS HSM binary market-data protocol byte by byte in C++20, inside the Kestrel trading platform. - [21. One Connection, Many Traders: Inside Kestrel's Market-Data Service](https://easy-explain-app.vercel.app/lesson/OwN6ZhVZjKE): How does one process serve many strategies from a single broker connection without duplicating work or letting one slow client hurt the rest? - [22. Kestrel Broker Plumbing: Daily Login, Secret Redaction, Rate Limiters](https://easy-explain-app.vercel.app/lesson/REmSuZBv9Kc): What happens before a trading system sends its first request? Kestrel has to log in every morning, keep secrets out of every log, and stay under a broker's rate limits across several processes. - [23. Safe Order Placement: When the Broker Doesn't Answer](https://easy-explain-app.vercel.app/lesson/s3vZM-5t8ZA): What should a trading engine do when an order request times out and nobody knows whether it reached the exchange? - [24. Kestrel Order Service: Sessions, Shadow Books, Crash Recovery](https://easy-explain-app.vercel.app/lesson/iN16nRT9xf0): What happens to your orders when a trading process dies? Kestrel's answer: the order service owns the truth, and the strategy keeps only a shadow. - [25. Ten Layers of Live-Trading Safety: Every Switch Before a Real Order](https://easy-explain-app.vercel.app/lesson/OlKum2tFHqA): How many switches stand between a strategy and a real broker order? In Kestrel, the answer is ten, and none of them trusts the others. - [26. A Day in Paper Trading: Running a C++ Trading Stack, and 15 Lessons](https://easy-explain-app.vercel.app/lesson/gVxbTL4y5xo): What does it actually take to run an algorithmic trading stack for one day? We walk through Kestrel's daily paper-trading routine, from the morning script to the ordered shutdown, then recap the… ## Machine Learning from Zero to Advanced | Shorts A 30-episode visual course taking you from no background to advanced machine learning. Math (algebra, linear algebra, calculus, probability) is taught from scratch with animations and hand-worked numbers. Each algorithm is then derived, coded from scratch in Python, checked against scikit-learn or PyTorch, and evaluated honestly, ending with deep learning, Transformers, RL and production. - [1. Why Machine Learning Squares Its Mistakes (MSE by Hand)](https://easy-explain-app.vercel.app/lesson/sOnTTY1zmAw): Why does machine learning square its errors? Work out mean squared error by hand with just three data points. - [2. A Dot Product Is Just Alignment, Explained Visually](https://easy-explain-app.vercel.app/lesson/r5CCKbBHODg): The dot product isn't just multiply and add. It measures how much two arrows point the same way. - [3. Eigenvectors: The One Direction a Shear Can't Turn](https://easy-explain-app.vercel.app/lesson/KQrOHLLq3T8): Almost every arrow turns when you transform space. Eigenvectors are the exception. - [4. 99% Accurate Test, Positive Result: Only 50% Sick?](https://easy-explain-app.vercel.app/lesson/aV-k2NoEZ1s): A 99% accurate test says you're positive. So you're 99% likely sick, right? Wrong. Here's the base-rate trap in Bayes' theorem, shown by counting 10,000 people. - [5. Learning Rate: Too Small, Just Right, Too Big](https://easy-explain-app.vercel.app/lesson/4QkCeP4uOtw): One number decides whether your model learns or explodes. Watch three balls roll down the same loss landscape with three different learning rates. - [6. Why Lasso Sets Weights Exactly to Zero (Diamond vs Circle)](https://easy-explain-app.vercel.app/lesson/-vV2IRSPwRo): Why does Lasso zero out coefficients while Ridge only shrinks them? One picture explains it: a diamond has corners, a circle does not. - [7. Why 99% Accuracy Can Be Totally Useless](https://easy-explain-app.vercel.app/lesson/OwqzX5FV5HE): A model with 99 percent accuracy that catches zero fraud? Here is how accuracy fools you on imbalanced data, and how a confusion matrix exposes it. - [8. How AI Decides Which Words Matter: Attention Explained](https://easy-explain-app.vercel.app/lesson/I1EFRANihEc): How does a model know which word in a sentence to focus on? Attention turns word similarity into weights. - [9. Why Broadcasting Is NumPy's Superpower (and Its Silent Bug)](https://easy-explain-app.vercel.app/lesson/QtvF2-JA0tQ): One missing dimension can wreck your model, and NumPy will never warn you. - [10. The 99% Accuracy That Was a Lie (Data Leakage Explained)](https://easy-explain-app.vercel.app/lesson/24e0iMnKg88): A model scored 99% accuracy and was completely useless. The cause: data leakage. - [11. The Chain Rule in 50 Seconds: Gears, Rates and Backprop](https://easy-explain-app.vercel.app/lesson/7yt2UOU4Drc): Every neural network learns with one rule from calculus, and you can see it in 50 seconds. - [12. Lagrange Multipliers in 50 Seconds: Where Gradients Line Up](https://easy-explain-app.vercel.app/lesson/tnag53VDTMo): You want the highest point, but you must stay on a path. Lagrange multipliers solve it with one picture and one equation. - [13. Zero Correlation Does NOT Mean Independent (Proof in 50 Seconds)](https://easy-explain-app.vercel.app/lesson/HT4rbhWj3ho): Two variables can be perfectly dependent and still have a correlation of zero. - [14. Gradient Boosting: Just Keep Fitting the Mistakes](https://easy-explain-app.vercel.app/lesson/zFZGoTRzlBA): One tree is weak. Three trees that fix each other's mistakes are not. - [15. The Kernel Trick: Higher Dimensions for Free](https://easy-explain-app.vercel.app/lesson/_RiQ4o_bjig): Can't separate your data with a line? Lift it to a higher dimension, without ever going there. - [16. Why Adam Works: Momentum Plus Scaling](https://easy-explain-app.vercel.app/lesson/PJKP02HMNe0): Why does plain gradient descent zig-zag, and how does Adam glide straight to the minimum? - [17. Why Attention Divides by Square Root of d](https://easy-explain-app.vercel.app/lesson/7s2cOT9R9i4): Why does attention divide by the square root of d? Because without it, softmax collapses into a spike. - [18. LoRA Explained: Fine-Tune a Giant Model by Training a Sliver](https://easy-explain-app.vercel.app/lesson/3vv61v7GAcU): What if you could fine-tune a giant model by training less than two percent of one layer? - [19. The Bellman Equation: How a Gridworld Learns Its Values](https://easy-explain-app.vercel.app/lesson/XJJaWGSVIgE): What if every square on a map could learn how good it is to stand there? That is the Bellman equation. ## Generative AI & LLM Engineering: Transformers to Agents | Shorts A practical 40-lesson follow-on to "Machine Learning from Zero to Advanced". Go from how GPT models are trained and sampled, through prompting, embeddings, vector search, RAG and fine-tuning, to tool-using agents, MCP and production serving. It ends with four capstone projects and a roadmap. Every lesson gives intuition, math, a worked numeric example and runnable provider-neutral Python. - [1. Temperature in 50 Seconds: How LLMs Choose the Next Word](https://easy-explain-app.vercel.app/lesson/XpNpP99kQ2I): Why does an AI answer differently every time? Temperature is the dial behind it. - [2. Why AI Types Slowly: The KV Cache Explained](https://easy-explain-app.vercel.app/lesson/RggtSEH4g9g): Why does an LLM generate text one word at a time, and why does it get slower as the conversation grows? The answer is the KV cache. - [3. Why Chatbots Confidently Make Things Up](https://easy-explain-app.vercel.app/lesson/2dy7e5K9mMA): Your chatbot just cited a paper that doesn't exist. Here's why. - [4. Cosine vs Dot Product: The Search Ranking Trap](https://easy-explain-app.vercel.app/lesson/ibUk_bQsH4Q): Your vector search might be ranking the wrong result, and vector length is why. - [5. Product Quantization: Shrink a 3072-Byte Vector to 96 Bytes](https://easy-explain-app.vercel.app/lesson/7uW_i14xvaY): One embedding takes 3072 bytes. Product quantization stores it in 96, which is 32 times smaller. - [6. Why Keyword Search Still Beats Embeddings Sometimes](https://easy-explain-app.vercel.app/lesson/Fv6XxKEjy80): Embeddings are powerful, but they can miss an exact error code that old-school BM25 finds instantly. - [7. LoRA in One Minute: 16.8 Million Parameters vs 65,536](https://easy-explain-app.vercel.app/lesson/LBuQcNXnyy8): One weight matrix, 16.8 million numbers. LoRA trains just 65,536 of them. - [8. DPO vs RLHF: What Got Removed From Alignment](https://easy-explain-app.vercel.app/lesson/3R6ydAxWMn4): RLHF needs a reward model, PPO, and a lot of moving parts. DPO deletes most of that and trains with one simple loss. - [9. Why 95% Accurate AI Agents Still Fail Most Tasks](https://easy-explain-app.vercel.app/lesson/GRGM2xSkTN0): Your agent is right 95 percent of the time per step, so why does it fail so often? Because the errors multiply. - [10. Prompt Injection in 50 Seconds: How AI Agents Get Hijacked](https://easy-explain-app.vercel.app/lesson/5N5y5aq_faE): A web page can secretly give your AI agent orders. Here is prompt injection in 50 seconds, plus two defenses that actually help. ## Inside Kestrel: Building a C++ Trading Platform | Shorts A code-level tour of Kestrel, a C++20 backtesting, paper and live trading platform for NSE, BSE and MCX on the FYERS API. We animate the engine's deterministic event loop, the fill and Indian cost models, Black-Scholes and IV surfaces, backtest metrics, and the multi-process services that handle market data, orders and live-trading safety. Educational only, not financial advice. - [1. The Bug That Made Every Strategy One Bar Late](https://easy-explain-app.vercel.app/lesson/RyzvvNwa2jo): One constant shifted every backtest by one bar. Here is how Kestrel's store read bar end times wrong, and the three-line fix. - [2. Never Call a Handler Under a Lock](https://easy-explain-app.vercel.app/lesson/D3p-y0PyBxc): One mutex mistake can freeze an entire trading engine. Here is how Kestrel's EventBus drain avoids it. - [3. Why Your Backtest Order Can't Fill on the Same Bar](https://easy-explain-app.vercel.app/lesson/6ABpSaJbSVI): Your order can't fill on the bar that triggered it. Here is the one-line rule that stops lookahead in Kestrel's simulated venue. ## Other lessons - [Why the Pythagorean Theorem Actually Works (Visual Proof)](https://easy-explain-app.vercel.app/lesson/y8Zrg_3_p7A): You've memorized a squared plus b squared equals c squared, but do you know why it's true? - [Correlation vs Covariance: What's the Difference?](https://easy-explain-app.vercel.app/lesson/iB_zMCG3CMM): Do two things move together? Covariance and correlation answer that, but only one is easy to compare.