Large Language Models and Generative AI
How large language models and diffusion models are built, trained, adapted and used.
AI-410 Year 4 3 credits 12 lessons · 5 h 33 min
Offered by HSM University · Artificial Intelligence
This is the American version of this course. See the Canadian version.
What you'll learn
- Explain next-token pretraining, cross-entropy and perplexity, subword tokenization, decoder-only and mixture-of-experts transformers, and estimate parameters, training compute and memory
- Explain causal self-attention, rotary position embeddings, the KV cache and its reduction by grouped-query and sliding-window attention, efficient attention kernels and context extension
- Apply scaling laws to predict loss, allocate compute between model size and data, and explain over-training for inference, emergence, data limits and test-time compute
- Describe how pretraining data is sourced, extracted, filtered, deduplicated with MinHash and mixed, estimate the value of repeated and synthetic data, and detect benchmark contamination
- Describe supervised fine-tuning, RLHF with Bradley-Terry reward models, DPO, AI feedback, reinforcement learning with verifiable rewards and parameter-efficient fine-tuning, and recognize reward hacking
- Evaluate language models with benchmarks, pass@k, confidence intervals, paired comparisons, Bradley-Terry preference ratings and validated model judges, and build application evaluation sets
- Use sampling settings, prompting, retrieval-augmented generation, tool use and agents effectively and securely, estimate inference memory and cost, and describe the US regulatory context
- Explain prefill and decode bottlenecks, batching and KV memory management, quantization, speculative decoding, distillation and the cost and energy of inference
- Explain diffusion, classifier-free guidance, latent diffusion, diffusion transformers and multimodal language models, and the provenance, deepfake and copyright issues of generative media
- Train and use embeddings with contrastive learning, explain CLIP and text embedding models, and build approximate nearest-neighbor search with measured recall
- Apply layered safeguards, red-teaming, calibrated classifier thresholds, watermarking, privacy protection and fairness testing to deploy language models responsibly
- Specify, build, evaluate and operate a language model application, using evaluation-driven development, cost and latency models and staged launch
Course content
12 lessons · 5 h 33 min total · final exam
- 1 Pretraining language models at scale 27 min · quiz
- 2 Attention, positions and long context 27 min · quiz
- 3 Scaling laws 29 min · quiz
- 4 Data for language models 29 min · quiz
- 5 Fine-tuning and learning from human feedback 28 min · quiz
- 6 Evaluating language models 26 min · quiz
- 7 Prompting, retrieval and tool use 30 min · quiz
- 8 Efficient inference and serving 29 min · quiz
- 9 Diffusion and multimodal models 29 min · quiz
- 10 Embeddings, contrastive learning and vector search 27 min · quiz
- 11 Safety, misuse and responsible deployment 26 min · quiz
- 12 Building language model applications: a project 26 min · quiz
- E Final exam 20 questions
Requirements
Recommended background. You can start any course at any time.
Description
How large language models and diffusion models are built, trained, adapted and used.
Part of the Science stream, typically taken in year 4.