Lessons
230 lessons in ai · page 6 of 10
- AIadvanced
Hybrid Search, Tuning, and Running It in Production
Dense vectors miss exact terms, so production retrieval combines them with lexical search. This lesson covers hybrid retrieval and reciprocal rank fusion, a tuning method that starts from a stated recall target, capacity planning, the operational failures that catch teams, and how to choose between running your own index and buying a service.
7 steps·~11 min - AIadvanced
HNSW, IVF, and Quantization
Three ideas carry almost all production vector search. This lesson covers HNSW as a navigable small-world graph with its M and ef parameters, IVF as coarse partitioning with nprobe, and the quantization schemes that cut memory by an order of magnitude, plus how they compose into the hybrid indexes real systems actually run.
8 steps·~12 min - AIadvanced
Why Exact Nearest Neighbour Search Does Not Scale
Vector search exists because exact nearest neighbour search is intractable at scale and the curse of dimensionality defeats the classical index structures. This lesson covers distance metrics and when each is right, why brute force costs what it does, why k-d trees fail above a few dozen dimensions, and the recall-latency trade that every approximate index makes.
8 steps·~12 min - AIadvanced
Running the Audit and Acting on What It Finds
An audit is only useful if it produces a decision. This lesson covers the audit sequence end to end, the three families of mitigation and what each costs, why some findings cannot be fixed at the model layer, documenting a trade-off you can defend, and monitoring for the drift that reopens a closed finding.
8 steps·~12 min - AIadvanced
The Fairness Metrics, and Why You Must Choose
Fairness has several formal definitions that sound equally reasonable and cannot all hold at once. This lesson covers demographic parity, equal opportunity, equalized odds and calibration, the impossibility result proved independently by Chouldechova and by Kleinberg and colleagues, and how to choose one deliberately and defend it.
8 steps·~12 min - AIadvanced
What Bias Means, and Where It Enters
The word bias carries three unrelated meanings that get argued past each other. This lesson separates them, then traces the six points where disparity enters a machine learning system, from historical data through label definition and objective choice to deployment, and explains why removing a protected attribute does not remove its influence.
8 steps·~12 min - AIadvanced
Abstention: Building a System That Can Say It Does Not Know
The most valuable behaviour an AI system can have is refusing to answer when it should not. This lesson covers calibration and why stated confidence is unreliable, selective prediction and the coverage-accuracy trade, conformal methods that give guarantees, designing abstention users accept, and measuring all of it in production.
9 steps·~14 min - AIadvanced
Grounding and Detection: Catching It Before the User Does
Since a model cannot judge its own output, detection has to compare it against something external. This lesson covers grounding through retrieval and why it reduces rather than eliminates the problem, then the detection methods that work: self-consistency sampling, entailment checking against sources, claim decomposition, and chain-of-verification.
9 steps·~14 min - AIadvanced
What a Hallucination Is, and Why It Happens
Hallucination is not a bug that will be patched out. This lesson covers why a next-token predictor produces confident falsehoods, the dual-axis taxonomy separating intrinsic from extrinsic and factuality from faithfulness, why fluency carries no signal about truth, and the theoretical result that the problem cannot be fully eliminated.
8 steps·~12 min - AIadvanced
Red-Teaming: Attacking Your Own System Before Someone Else Does
Guardrails you have not attacked are guardrails you have only hoped about. This lesson covers manual and automated red-teaming: the attack methods worth knowing, how to run an exercise that produces findings rather than reassurance, what to measure, and how to turn results into regression tests that survive the next model update.
9 steps·~14 min - AIadvanced
Building the Control Layer: Rails, Classifiers, and Containment
Guardrails are a layered control system around a model that cannot police itself. This lesson covers the rail types, rules versus classifiers versus model-based judges, the tools that implement them, the latency and false-positive budget that constrains every design, and why architectural containment beats filtering.
9 steps·~14 min - AIadvanced
The LLM Threat Model: Why the Model Cannot Defend Itself
Guardrails exist because a language model cannot reliably distinguish instructions from data. This lesson builds the threat model: the OWASP Top 10 for LLM Applications, direct and indirect prompt injection, jailbreaks, data leakage, and why tool-using agents turn a content problem into a security one.
9 steps·~14 min - AIadvanced
LIME and SHAP: Attributing a Single Prediction
Two methods dominate local explanation, and both perturb the input. LIME fits a small interpretable model near one prediction. SHAP borrows the Shapley value from game theory and is the unique attribution satisfying local accuracy, missingness and consistency. This lesson builds both mechanisms, compares KernelSHAP with TreeSHAP, and is precise about what a SHAP value does not mean.
11 steps·~17 min - AIintermediate
Explainable AI: The Landscape of Model Explanations
A model that predicts well can still be impossible to justify. This lesson maps explainable AI: interpretable-by-design versus post-hoc, global versus local, model-specific versus model-agnostic. It covers the global workhorses (permutation importance, partial dependence, ICE), faithfulness versus plausibility, and the argument that post-hoc explanation is the wrong tool for high-stakes decisions.
11 steps·~17 min - AIadvanced
Gradients, Counterfactuals, and Whether to Trust an Explanation
When a model is differentiable you can attribute a prediction with calculus instead of sampling. This lesson covers plain saliency, Integrated Gradients and its axioms, Grad-CAM, then counterfactual explanations, which answer what would have to change rather than what mattered. It closes with the evidence that explanations can fail or be deliberately faked, and a protocol for checking yours.
12 steps·~18 min - AIadvanced
Training Energy-Based Models
Training an EBM means shaping an energy landscape so real data sits in valleys, but the intractable partition function blocks plain maximum likelihood. This lesson covers the push-down-push-up principle, contrastive methods (contrastive divergence, noise-contrastive estimation), score matching, and the regularized alternative that avoids sampling entirely.
8 steps·~12 min - AIadvanced
EBMs as a Unifying Lens
Why LeCun treats energy as the common language of machine learning. This lesson shows how classification, generative models, self-supervised learning, JEPA, and diffusion all read as energy-based models, ties the contrastive-versus-regularized split back to self-supervised learning, and gives an honest account of where explicit EBMs help and where they do not.
8 steps·~12 min - AIadvanced
Energy Landscapes: The EBM View
Energy-based models replace input-to-output functions with a scalar energy that scores how compatible a configuration is. This lesson covers the energy function, inference as finding the lowest-energy answer, the energy landscape picture, the link from energy to probability via the partition function, and why this framing handles problems with many valid answers.
8 steps·~12 min - AIadvanced
Beyond Negatives: Non-Contrastive and Masked Methods
How to prevent collapse without negative samples. This lesson covers distillation methods (BYOL, SimSiam) that rely on stop-gradients and asymmetry, regularization methods (Barlow Twins, VICReg) that constrain the embedding's statistics, and the masked-modeling family (MAE, BERT), then ties them to JEPA and the energy-based view.
8 steps·~12 min - AIadvanced
Contrastive Learning
The first family to make joint-embedding self-supervised learning work: pull together two views of the same image, push apart different images. This lesson covers the InfoNCE loss, SimCLR and its reliance on large batches, MoCo's momentum encoder and queue, why negatives block collapse, and the practical costs that motivated negative-free methods.
7 steps·~11 min - AIintermediate
Learning Without Labels: Pretext Tasks
Self-supervised learning turns unlabeled data into its own teacher. This lesson covers why labels are the bottleneck, how a pretext task manufactures free supervision, the shift from predicting pixels to learning embeddings invariant to augmentation, and the collapse problem that every method after it must solve.
8 steps·~12 min - AIadvanced
From I-JEPA to V-JEPA: World Models and Planning
The JEPA idea becomes concrete in I-JEPA on images and V-JEPA 2 on video. This lesson covers the multi-block masking that makes I-JEPA work, how an action-conditioned video model becomes a world model, and how predicting representations enables planning by model-predictive control instead of a fixed policy.
8 steps·~12 min - AIadvanced
Inside a JEPA: Encoders, Predictors, and Collapse
Predicting a learned representation invites a trivial cheat: represent nothing. This lesson opens the JEPA machine, the context encoder, target encoder, and predictor, shows the training loop in code, explains why representation collapse is the central danger, and how asymmetry, stop-gradient, and an EMA target defeat it without negatives.
8 steps·~12 min - AIadvanced
Why Predict Representations, Not Pixels
Self-supervised learning has three families: reconstruct the input, contrast augmented views, or predict in a learned embedding space. This lesson explains why the third, the joint-embedding predictive approach behind JEPA, sidesteps both wasted capacity on unpredictable pixels and hand-crafted augmentation biases.
8 steps·~12 min

