Artificial Intelligence — A Complete Intermediate Course Material

Artificial Intelligence — A Complete Intermediate Course Material

About This Course

🎯

Who This Is For

Learners who have completed an AI fundamentals course and want to move from understanding concepts to designing, training, and deploying real AI systems.

🗺️

How to Use This

Read chapters in order or jump to what’s relevant. Each chapter introduces deeper concepts progressively with key terms throughout.

⏱️

Estimated Time

Approximately 90–120 hours of self-paced study to complete all 15 chapters thoroughly.

🛠️

What You’ll Build

The ability to design ML systems end-to-end, work with LLMs and agents, and operate models reliably in production.

Chapter Road Map

Ch 1–3
Applied Foundations

Practitioner-level math, data engineering, and system thinking.

Ch 4–6
Core Depth

Advanced classical ML, architecture design, sequence models and attention.

Ch 7–10
Modern AI

LLM internals, prompting and RAG, generative media, and autonomous agents.

Ch 11–13
Engineering

MLOps, model efficiency, and advanced computer vision in production.

Ch 14–15
Systems & Frontiers

End-to-end system design, safety, evaluation rigor, and what’s next.

01
Chapter One · Applied Foundations

Practitioner Foundations

The habits and judgment calls that separate someone who understands ML concepts from someone who can be trusted to build a real system. This chapter covers the diagnostic thinking, validation strategy, and data discipline every intermediate practitioner needs before going deeper into specific techniques.

1.1Bias-Variance Tradeoff in Depth Decomposing test error into bias, variance, and irreducible noise. Using learning curves to decide whether to add data, capacity, or regularisation.
1.2Cross-Validation Strategies Beyond K-Fold Stratified K-Fold, time-series walk-forward validation, group K-Fold, and nested cross-validation — choosing the right scheme for the structure of your data.
1.3Data Leakage — The Silent Killer of Real Projects Target leakage, train-test contamination, and temporal leakage. A systematic checklist for auditing any pipeline against it.
1.4Handling Imbalanced Data Why accuracy misleads on imbalanced datasets, and how resampling, class weighting, and threshold tuning fix it.
1.5From Notebook Thinking to System Thinking A notebook proves a model can work once. A system must handle drift, retraining, and failure — the mindset shift this course builds toward.
02
Chapter Two · Applied Foundations

Advanced Mathematics for AI

The mathematics that explains why algorithms behave the way they do — eigenvalues, optimisation landscapes, and probabilistic reasoning underneath model training and uncertainty.

2.1Eigenvalues, Eigenvectors & Diagonalisation Why eigenvectors of the covariance matrix define directions of maximum variance — the mathematical engine behind PCA.
2.2Singular Value Decomposition (SVD) Decomposing any matrix into rotation-scale-rotation, and its role in dimensionality reduction, recommenders, and LoRA-style adaptation.
2.3Jacobians, Hessians & Multivariate Calculus Generalising derivatives to vectors and curvature, and why saddle points — not local minima — are the real obstacle in deep learning.
2.4Convex vs. Non-Convex Optimisation Why linear models have one global minimum while neural networks don’t, and what that means for initialisation and training behaviour.
2.5Constrained Optimisation & Lagrange Multipliers Optimising under constraints — the mathematical foundation of SVM margin maximisation and KKT optimality conditions.
2.6Maximum Likelihood & Maximum A Posteriori Estimation Why minimising cross-entropy loss is equivalent to maximum likelihood estimation, and why L2 regularisation is a Gaussian prior in disguise.
2.7Bayesian Inference & Probabilistic Reasoning Moving from point estimates to distributions over parameters, and why Bayesian methods give naturally calibrated uncertainty.
2.8Information Theory in Practice How KL divergence measures distance between distributions, and how mutual information is used in feature selection.
2.9Matrix Calculus for Backpropagation Computing gradients with respect to entire weight tensors — the actual mechanics behind autograd engines like PyTorch’s.
03
Chapter Three · Applied Foundations

Data Engineering for AI

Real AI projects work with data that doesn’t fit in memory, changes over time, and must be reproducible across a team. This chapter covers the engineering practices that make that possible.

3.1Beyond Pandas — Polars & Out-of-Core Processing Why Pandas struggles past a few GB, and how Polars’ lazy, multi-threaded engine processes the same operations far faster.
3.2Distributed Data Processing with Dask & Spark Processing datasets larger than RAM by partitioning work across cores or machines, and when the overhead is worth it.
3.3Data Validation & Schema Enforcement Catching bad data before it reaches a model using tools like Pandera and Great Expectations.
3.4Feature Stores — Centralising Feature Logic How feature stores like Feast prevent feature definitions from drifting between training and serving code.
3.5Data Versioning at Scale Structuring a versioning strategy across raw, intermediate, and feature-engineered datasets for true reproducibility.
3.6Building Robust ETL/ELT Pipelines Orchestrating pipelines with Airflow or Prefect, with idempotency and retry logic so re-runs never corrupt data.
3.7Synthetic Data Generation Generating training data when real labelled data is scarce or sensitive, and the risks of distribution mismatch.
3.8Data Labelling Strategy & Active Learning Why labelling is usually the real bottleneck, and how active learning reduces labelling cost dramatically.
04
Chapter Four · Core Depth

Advanced Classical Machine Learning

Inside the algorithms that win tabular ML competitions and power production scoring systems — gradient boosting internals, stacking, and the probabilistic models intermediate courses rarely cover in depth.

4.1Gradient Boosting From First Principles Why boosting fits each new tree to the ensemble’s residual errors, and how this differs fundamentally from bagging.
4.2XGBoost — Architecture & Key Innovations Second-order gradient approximation, regularised objectives, and sparsity-aware splitting that make XGBoost fast and accurate.
4.3LightGBM & CatBoost — Engineering Tradeoffs Leaf-wise growth and histogram splitting in LightGBM versus CatBoost’s native categorical handling and ordered boosting.
4.4Hyperparameter Tuning for Boosted Trees The handful of hyperparameters that matter most, and why early stopping is the primary defence against overfitting.
4.5Stacking & Blending Ensembles Combining heterogeneous models via a meta-learner trained on out-of-fold predictions, and the leakage risks involved.
4.6Gaussian Processes & Bayesian Non-Parametric Models Modelling a distribution over functions to get calibrated uncertainty, and their role in Bayesian hyperparameter search.
4.7Anomaly & Outlier Detection Methods Isolation Forests, Local Outlier Factor, One-Class SVM, and autoencoder reconstruction error — matched to different anomaly types.
4.8Advanced Dimensionality Reduction — t-SNE & UMAP Preserving non-linear neighbourhood structure for visualisation, and the caveat that cluster distances aren’t meaningful.
4.9Time Series Forecasting — Classical to Modern ARIMA and Prophet for trend/seasonality, and the shift toward deep learning approaches for multi-series forecasting at scale.
4.10Model Calibration & Probability Reliability Making predicted probabilities trustworthy using Platt scaling, isotonic regression, and reliability diagrams.
05
Chapter Five · Core Depth

Deep Learning Architecture Design

Why specific architectures were designed the way they were — the engineering insights behind ResNet, EfficientNet, and modern regularisation, and how to make informed architecture choices rather than copying defaults.

5.1The Vanishing Gradient Problem & Why Depth Is Hard Why simply stacking more layers eventually hurts performance, and how this motivated every major architectural innovation that followed.
5.2ResNet & Skip Connections Learning residuals instead of full transformations, letting gradients flow through hundreds of layers and making very deep networks trainable.
5.3Inception & Multi-Scale Feature Extraction Running multiple filter sizes in parallel within a single layer, and the 1×1 convolution trick that makes wider networks affordable.
5.4EfficientNet & Compound Scaling Balancing depth, width, and resolution together rather than scaling any one dimension alone, discovered via Neural Architecture Search.
5.5Normalisation Beyond Batch Norm Layer, Group, and Instance Normalisation, and choosing the right scheme based on architecture and batch size.
5.6Advanced Regularisation Strategies Label smoothing, Mixup, CutMix, and stochastic depth, and how they compound with dropout and weight decay.
5.7Neural Architecture Search (NAS) Automating architecture design via reinforcement learning, evolutionary search, and gradient-based methods like DARTS.
5.8Learning Rate Schedules & Warmup Cosine annealing, step decay, and one-cycle policies, and why warmup stabilises early training in large-batch settings.
5.9Mixed Precision & Large-Batch Training Training in FP16/BF16 to roughly halve memory and speed up matrix operations, with loss scaling to avoid underflow.
5.10Diagnosing & Debugging Training Failures A systematic checklist for when a network won’t train — exploding gradients, dead units, and learning rate issues.
06
Chapter Six · Core Depth

Sequence Models & Attention at Depth

Dissecting exactly how attention works — the seq2seq architecture it was invented to fix, the mechanics of positional encoding, and the efficient attention variants that let Transformers scale to very long sequences.

6.1Sequence-to-Sequence (Seq2Seq) Architectures The encoder-decoder framework that predates attention, and the fixed-length bottleneck problem attention was invented to solve.
6.2Attention Mechanics — Query, Key, Value in Full Detail The actual matrix operations behind attention, and why the √d_k scaling factor is necessary for stable training.
6.3Multi-Head Attention — Why Multiple Heads Help Running several attention operations in parallel on different learned projections, each capturing a different type of relationship.
6.4Positional Encoding — Absolute, Relative & Rotary Why Transformers need position injected explicitly, comparing sinusoidal, learned, relative, and Rotary (RoPE) encodings.
6.5Self-Attention vs. Cross-Attention Self-attention relates tokens within one sequence; cross-attention relates tokens across two sequences — mapped across Transformer variants.
6.6The Quadratic Cost Problem in Attention Why standard self-attention costs O(n²) as sequence length grows — the central scaling bottleneck of Transformers.
6.7Sparse & Linear Attention Variants Longformer and BigBird’s sparse patterns, and linear attention approximations like Performer that avoid the full n×n matrix.
6.8FlashAttention & Hardware-Aware Optimisation Achieving exact attention with far lower memory use by restructuring computation around GPU memory access patterns.
6.9State Space Models — An Alternative to Attention Mamba and other SSM architectures that process sequences in linear time, challenging attention’s dominance for long sequences.
07
Chapter Seven · Modern AI

Large Language Models — Architecture & Training

How a model goes from random weights to ChatGPT-like behaviour — pretraining objectives, scaling laws, tokenisation, and the alignment techniques that turn a raw language model into an assistant.

7.1Decoder-Only Architectures & Causal Masking Why GPT-family models use only the decoder stack, and how causal masking prevents attending to future tokens.
7.2Tokenisation Deep Dive — BPE, WordPiece & SentencePiece How subword tokenisers are trained, and why tokenisation choices affect cost, fairness, and arithmetic performance.
7.3Pretraining Objectives & Data Next-token prediction as the deceptively simple objective behind broad capability, and why data quality matters as much as volume.
7.4Scaling Laws — Predicting Capability From Compute The empirical relationships between model size, data, and compute that let labs predict performance before training.
7.5Emergent Abilities & In-Context Learning Why some capabilities appear only past a scale threshold, and how models perform new tasks purely from prompt examples.
7.6Mixture of Experts (MoE) Architectures Activating only a few expert sub-networks per token, increasing parameter count without proportionally increasing inference cost.
7.7Instruction Tuning & Supervised Fine-Tuning (SFT) Teaching a raw pretrained model to follow instructions via curated response pairs, and the risk of catastrophic forgetting.
7.8RLHF — Reinforcement Learning From Human Feedback The three-stage pipeline of preference collection, reward modelling, and policy optimisation that aligns model outputs to human preference.
7.9Direct Preference Optimisation (DPO) & Alternatives Reformulating RLHF into a simple classification loss on preference pairs, removing the need for a separate reward model.
7.10Parameter-Efficient Fine-Tuning — LoRA & QLoRA Freezing base weights and learning small low-rank adapters, and QLoRA’s combination with 4-bit quantisation for single-GPU fine-tuning.
7.11Context Windows & Long-Context Engineering Position extrapolation techniques and the “lost in the middle” problem where models attend less reliably to buried information.
08
Chapter Eight · Modern AI

Prompt Engineering & LLM Application Patterns

The techniques and architectural patterns that separate a toy LLM demo from a reliable production application — structured prompting, real RAG architecture decisions, and rigorous evaluation.

8.1Advanced Prompting Strategies Chain-of-thought prompting, few-shot example design, and self-consistency sampling for higher-stakes reasoning tasks.
8.2Structured Output & Function Calling Constraining LLM output to valid JSON or a schema, and the mechanics of how tool/function calling actually executes.
8.3Retrieval-Augmented Generation — Architecture in Depth The full RAG pipeline — chunk, embed, index, retrieve, and inject — and why it reduces hallucination without retraining.
8.4Chunking Strategies & Their Tradeoffs Fixed-size, semantic, and recursive chunking, and how chunk size directly affects retrieval precision.
8.5Embeddings & Vector Databases How embedding models map text to vectors, and choosing between vector databases based on scale and operational needs.
8.6Hybrid Search & Re-Ranking Combining dense vector retrieval with keyword search, then using a cross-encoder re-ranker for a more accurate second pass.
8.7Context Engineering — Managing What the Model Sees Curating system prompts, retrieved documents, and history, and managing context window budget to avoid the “lost in the middle” effect.
8.8Hallucination — Causes & Mitigation Why hallucination is structural to next-token prediction, and the grounding, citation, and verification layers that mitigate it.
8.9Evaluating LLM Applications LLM-as-judge evaluation, human rubrics, retrieval metrics, and building a regression test suite for production quality.
8.10Cost, Latency & Caching for LLM Applications Prompt caching, response caching, and model routing strategies to manage per-token cost at scale.
09
Chapter Nine · Modern AI

Generative AI Beyond Text

The mathematics and engineering of modern generative media — the diffusion process in full, latent-space efficiency tricks, and the multimodal models spanning images, audio, and video.

9.1The Diffusion Process — Forward & Reverse, in Full The fixed forward noising chain and the learned reverse process that predicts and removes noise step by step.
9.2Denoising Diffusion Probabilistic Models (DDPM) The noise schedule and loss formulation that made diffusion models practically trainable and competitive with GANs.
9.3Latent Diffusion & Why Stable Diffusion Is Fast Running diffusion in a compressed latent space, the key trick that makes models runnable on consumer GPUs.
9.4Conditioning Mechanisms — Text-to-Image Generation Cross-attention injecting text embeddings at each step, and classifier-free guidance for sharper prompt adherence.
9.5Samplers & Inference-Time Tradeoffs How samplers like DDIM and DPM-Solver cut denoising steps from hundreds to a handful while preserving quality.
9.6Fine-Tuning Diffusion Models — LoRA, DreamBooth & ControlNet Teaching a model a new subject from a few images, and adding precise structural control without retraining the base model.
9.7GANs Revisited — StyleGAN & Modern Variants StyleGAN’s disentangled latent space for fine-grained control, and GANs’ speed advantage over multi-step diffusion.
9.8Multimodal Models — Connecting Vision and Language CLIP’s contrastive training aligning image and text embeddings, and vision-language models that let an LLM reason about images.
9.9Audio & Speech Generation Text-to-speech architectures, Whisper-style speech-to-text, and the unique challenges of generating coherent long-form audio.
9.10Video Generation — Extending Diffusion Through Time Maintaining temporal consistency across frames, and why video diffusion costs far more than image diffusion.
9.11Evaluating Generative Models FID for realism and diversity, CLIPScore for text-image alignment, and why human evaluation remains essential.
10
Chapter Ten · Modern AI

AI Agents & Autonomous Systems

What happens when a model plans, acts, observes, and acts again in a loop — agent architectures, memory systems, multi-agent coordination, and the reliability problems unique to autonomous AI systems.

10.1What Makes a System an “Agent” The defining property of a genuine agent: a loop of observing, deciding, acting, and re-observing with autonomy over the process.
10.2The ReAct Pattern — Reasoning + Acting Interleaving explicit reasoning traces with tool actions and their results, improving both performance and debuggability.
10.3Planning Strategies for Agents Reactive loops versus upfront planning versus tree-of-thought exploration, and when the added latency is worth it.
10.4Tool Use & Tool Design for Agents Designing reliable, well-named tools with clear errors — often a bigger reliability factor than the model itself.
10.5Agent Memory Systems Short-term context memory versus persisted long-term memory, and the risk of treating retrieved memories as untrusted input.
10.6Multi-Agent Systems & Orchestration Specialised agents collaborating under an orchestrator, and debate/critique patterns that trade latency for quality.
10.7Agent Frameworks in Practice How LangGraph, AutoGen, and CrewAI model state and control flow differently, and choosing based on control versus convenience.
10.8Failure Modes Unique to Agents Infinite loops, compounding errors, and goal drift, and the guardrails — step limits, human checkpoints — that contain them.
10.9Evaluating Agentic Systems Looking beyond final-answer correctness to the full trajectory of tool use, step count, and safety of actions taken.
11
Chapter Eleven · Engineering

MLOps & Production Machine Learning Systems

What happens after deployment — monitoring, retraining, and the operational discipline that keeps a model trustworthy for months and years, not just for a demo.

11.1The MLOps Maturity Model Mapping a practice from manual notebooks through automated pipelines to full CI/CD/CT, and matching maturity to actual project risk.
11.2CI/CD for Machine Learning Why ML pipelines must validate data and model quality, not just code tests, before gating a deployment.
11.3Model Registries & Versioning Tracking every model artefact with its data version, hyperparameters, and lineage, and promoting through staging gates.
11.4Deployment Patterns — Shadow, Canary & Blue-Green Comparing risk-free shadow testing, gradual canary rollouts, and instantly reversible blue-green deployments.
11.5A/B Testing for Model Decisions Designing statistically valid experiments, sizing samples correctly, and avoiding the pitfall of peeking at results early.
11.6Monitoring Models in Production Tracking prediction distributions, latency, and proxy quality metrics when ground-truth labels aren’t immediately available.
11.7Data Drift & Concept Drift Detection Distinguishing input distribution shift from a changed input-output relationship, using statistical tests to catch both.
11.8Retraining Strategies & Pipelines Scheduled versus trigger-based retraining versus continuous online learning, and the tradeoffs of each.
11.9Observability for LLM Applications Tracing prompts, retrieved context, and tool calls end-to-end, since LLM failures are often about reasoning quality, not errors.
11.10Infrastructure as Code & Reproducible Training Defining training and serving infrastructure declaratively so environments can be recreated exactly across teams.
12
Chapter Twelve · Engineering

Model Optimisation & Efficient AI

Making a trained model smaller, faster, and cheaper to run — quantisation, pruning, distillation, and the deployment formats that let models run efficiently from cloud GPUs to phones.

12.1Why Model Efficiency Matters The cost-latency-accuracy triangle every production deployment must balance as a design constraint, not an afterthought.
12.2Quantisation — Reducing Numerical Precision Converting weights to 16-, 8-, or 4-bit representations, and the risk of silently degrading accuracy on sensitive layers.
12.3Pruning — Removing Unnecessary Weights Unstructured versus structured pruning, and why structured pruning yields real speedups on standard hardware.
12.4Knowledge Distillation Training a small student model to mimic a large teacher’s output distribution, transferring capability into far fewer parameters.
12.5Efficient Architectures by Design MobileNet and SqueezeNet built from the ground up for low compute, versus compressing a larger model after training.
12.6Model Export Formats — ONNX & Beyond ONNX as a framework-agnostic representation, and hardware-specific compilers like TensorRT for further optimisation.
12.7Inference Serving Optimisation Dynamic batching, KV-cache management, and continuous batching techniques that dramatically improve LLM serving throughput.
12.8Edge & On-Device AI Deployment Memory, power, and connectivity constraints unique to phones and embedded devices, and the runtimes built for them.
12.9Benchmarking & Profiling Model Performance Measuring latency percentiles and real throughput under load, and profiling to find the actual bottleneck before optimising.
13
Chapter Thirteen · Engineering

Advanced Computer Vision

The architectures and techniques that pushed vision past convolution alone — vision transformers, self-supervised pretraining, 3D understanding, and video.

13.1Vision Transformers (ViT) Treating an image as a sequence of patches fed through a standard Transformer, and the data requirements this introduces.
13.2Hybrid CNN-Transformer Architectures Swin Transformer’s shifted-window attention, reintroducing locality and multi-scale processing into the Transformer framework.
13.3Self-Supervised Learning for Vision Contrastive learning (SimCLR) and masked image modelling (MAE), reducing dependence on expensive labelled datasets.
13.4Modern Object Detection — DETR & Beyond Reframing detection as direct set prediction with a Transformer, eliminating anchor boxes and non-maximum suppression.
13.5Segment Anything & Promptable Segmentation Foundation models that segment from a point, box, or text prompt and generalise to objects never seen in training.
13.63D Computer Vision Point clouds, voxels, and how NeRF and Gaussian Splatting render novel viewpoints from sparse 2D photographs.
13.7Video Understanding 3D convolutions, two-stream networks, and video Transformers applying spatio-temporal attention across frames.
13.8Multi-Object Tracking Maintaining consistent object identity across frames using motion prediction and appearance re-identification.
13.9Production Vision Pipeline Considerations Camera calibration, lighting variation, and the latency budgets that real-time vision systems must operate within.
14
Chapter Fourteen · Systems & Frontiers

AI System Design & Architecture Patterns

Composing models, data, and infrastructure into a coherent system that solves a real business problem reliably — the end-to-end thinking expected in senior AI engineering roles.

14.1A Framework for AI System Design Clarifying constraints and success metrics, mapping data flow end-to-end, and choosing models only after that.
14.2Choosing Between Build, Fine-Tune & Buy A decision framework based on task genericity, data privacy needs, and whether existing architectures fit the problem.
14.3Designing for Latency, Throughput & Cost Together Why these constraints trade off against each other and accuracy, and architecting systems that hit real targets.
14.4Model Cascades & Routing Architectures Using a cheap model for most requests and escalating only ambiguous cases to cut average cost without losing quality.
14.5Designing Recommendation Systems The two-stage candidate generation and ranking pattern, and handling cold-start users and items.
14.6Designing Search & Retrieval Systems Combining lexical search, semantic search, and learned ranking into a unified retrieval architecture.
14.7Designing Fraud & Anomaly Detection Systems Extreme class imbalance, adversarial actors, and the low-latency real-time scoring requirement unique to fraud detection.
14.8Designing Conversational AI Systems Intent routing, context management, fallback strategies, and the safety checks needed before and after generation.
14.9Failure Mode Analysis & Graceful Degradation Designing explicit fallback paths for timeouts, missing data, or low-confidence predictions instead of unpredictable failures.
14.10Communicating AI System Design Writing design documents that state the problem, chosen approach, alternatives, and accepted tradeoffs clearly.
15
Chapter Fifteen · Systems & Frontiers

Advanced AI Safety, Evaluation & Research Frontiers

The technical mechanisms behind alignment and rigorous evaluation, and where AI research is actively moving — knowledge an intermediate practitioner needs to operate responsibly and stay current.

15.1Alignment Techniques in Technical Depth Reward hacking, reward model overoptimisation, and why a KL penalty prevents the policy from drifting during RLHF.
15.2Constitutional AI & Self-Critique Methods Using a model to critique and revise its own outputs against written principles, reducing reliance on human labels.
15.3Red-Teaming & Adversarial Testing Systematically probing for unsafe outputs before deployment, and why defending against jailbreaks is an ongoing arms race.
15.4Mechanistic Interpretability Moving past post-hoc tools like SHAP toward circuit-level analysis of what’s actually happening inside model weights.
15.5Rigorous Benchmark Evaluation Benchmark contamination, overfitting to leaderboard quirks, and the gap between benchmark scores and real-world performance.
15.6Fairness Metrics — Formal Definitions & Tradeoffs Demographic parity, equalised odds, and the proven impossibility of satisfying several fairness criteria simultaneously.
15.7Privacy-Preserving Machine Learning Differential privacy’s formal leakage guarantee, and federated learning’s approach to training without centralising data.
15.8AI Governance for Practitioners Translating the EU AI Act’s risk-tier requirements into practical engineering and compliance checklists.
15.9Current Research Frontiers Long-horizon agentic reliability, inference-time compute scaling, world models, and neuro-symbolic approaches.
15.10Building Your Intermediate-to-Advanced Learning Path Contributing to open-source AI infrastructure, reproducing recent papers, and specialising into a research or applied track.

Leave a Reply

Your email address will not be published. Required fields are marked *