Lessons
136 lessons in ai · advanced · page 4 of 6
- AIadvanced
The Greedy Algorithm and Its 63% Guarantee
Maximizing a submodular function is NP-hard, yet the simplest possible algorithm gets provably close to optimal. This lesson presents the greedy algorithm, the celebrated (1 - 1/e) guarantee of Nemhauser, Wolsey, and Fisher, why that bound cannot be beaten, and the lazy trick that makes greedy fast at scale.
8 steps·~12 min - AIadvanced
Submodularity: The Mathematics of Diminishing Returns
Many selection problems share one property: each new item helps less than the last. Formalized, that property is submodularity, and it is what makes otherwise intractable problems solvable with guarantees. This lesson defines it precisely, shows the everyday examples, and explains why it is called the discrete analog of convexity.
8 steps·~12 min - AIadvanced
What Neural Language Models Can Actually Compute
The same hierarchy that classifies grammars can classify neural networks. This lesson places recurrent networks and transformers on the Chomsky ladder, explains why a transformer is theoretically weaker than it looks, and shows how formal language theory predicts where today's language models generalize and where they break.
8 steps·~12 min - AIadvanced
Morphology and Finite-State Methods
Words have internal structure, and modelling it is computational linguistics' cleanest success. This lesson covers morphemes and the ways languages build words, why the finite-state machines at the bottom of the hierarchy are enough, and how finite-state transducers analyze and generate word forms, up to the modern neural shared tasks.
9 steps·~14 min - AIadvanced
Formal Grammars and the Chomsky Hierarchy
How much computational power does a language need? The Chomsky hierarchy answers it with four nested classes of grammar. This lesson builds the ladder from regular to recursively enumerable, shows the machine that recognizes each rung, and locates human language on it using the classic proof that it is not context-free.
9 steps·~14 min - AIadvanced
The Science of Language, Computationally
Computational linguistics treats human language as something to be modelled precisely, and language fights back at every level. This lesson maps the levels of linguistic structure, shows why ambiguity, recursion, and Zipf's law make naive approaches fail, and frames the formal and statistical traditions the rest of the path builds on.
9 steps·~14 min - AIadvanced
Bayesian Optimization in Practice
The theory becomes useful through libraries, and its flagship job is tuning machine-learning models. This lesson covers that application, the Tree-structured Parzen Estimator behind Hyperopt and Optuna, the tools you would actually reach for, batching, and the honest limits of the method.
8 steps·~12 min - AIadvanced
Acquisition Functions: Deciding Where to Look Next
A Gaussian process gives a mean and an uncertainty everywhere; the acquisition function turns them into one decision about where to spend the next expensive evaluation. This lesson covers Expected Improvement, GP-UCB and its no-regret guarantee, and Thompson sampling, and how each resolves exploration against exploitation.
9 steps·~14 min - AIadvanced
The Gaussian Process Surrogate
Bayesian optimization needs a model that predicts the objective everywhere and knows how unsure it is. The Gaussian process delivers exactly that. This lesson builds the GP as a distribution over functions, shows how a kernel encodes assumptions, and explains why its posterior variance is the engine of the whole method.
9 steps·~14 min - AIadvanced
Optimizing an Expensive Black Box
Some functions cost hours or dollars to evaluate once, give no gradient, and must be optimized in as few tries as possible. This lesson sets up that problem, shows why grid and random search waste the budget, and introduces the surrogate-model loop that Bayesian optimization is built on.
9 steps·~14 min - AIadvanced
The Options Nobody Compares, and Changing Your Mind
The fine-tuning versus retrieval framing hides several options that are often better than either. This lesson covers long context and why it does not replace retrieval, prompt caching as a cost lever, agentic retrieval, continued pretraining, and how to revisit a decision that was right when you made it.
8 steps·~12 min - AIadvanced
Building Both: LoRA, Data, and the Retrieval Pipeline
The decision is only half the work. This lesson covers what building each actually involves: parameter-efficient fine-tuning with LoRA and why it made the technique accessible, the training data problem that stalls most projects, the retrieval pipeline end to end, and how to combine them into one system.
8 steps·~12 min - AIadvanced
What Each Technique Actually Changes
Fine-tuning and retrieval are usually presented as alternatives when they change different things. This lesson separates them precisely: fine-tuning adjusts weights and teaches behaviour, retrieval supplies context and teaches nothing, and the question that decides between them is whether your problem is knowledge or form.
8 steps·~12 min - 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

