Intermediate · module I9 · Sublevel Advanced
Generative AI and Large Language Models in Practice
By the end: Explain how an LLM produces text, use prompting techniques reliably, call an LLM from Python, and build a simple retrieval-based assistant
- Covers
- How LLMs work and how to build useful applications on top of them
- Contents
- 4 chapters, 19 topics
- Time
- About 4 hours
- Level
- Intermediate
- Your progress
- 0 / 19
This module builds on Neural Networks and Deep Learning Essentials. We suggest looking at it first, but the choice is yours.
Chapter 1 How LLMs Work
- 1.110 min Read Activity
What Is a Large Language Model?
Next-token prediction at very large scale
Interactive: predict the next token
- 1.28 min Read Activity
Tokens and Context Windows
How text is split into tokens, and why limits and costs follow
Interactive: count tokens
- 1.310 min Read Activity
- 1.410 min Read Activity
How LLMs Are Trained
Pre-training, instruction tuning and learning from human feedback
Interactive: the three training stages
- 1.58 min Read Activity
Chapter 2 Prompt Engineering
- 2.112 min Read Activity
Prompting Techniques
Zero-shot, few-shot, step-by-step reasoning and role prompts
Interactive: compare techniques on one task
- 2.210 min Read Activity
- 2.312 min Read Activity
Testing and Improving Prompts
Building a small test set and comparing versions
Lab: evaluate three prompts
Chapter 3 Building with LLMs
- 3.115 min Read Activity
Using an LLM API from Python
Messages, parameters, errors, cost and keeping keys safe
Code: a homework helper
- 3.215 min Read Activity
- 3.320 min Read
Retrieval-Augmented Generation
Answering from your own documents
Code: a question-answering bot for a PDF
- 3.415 min Read
- 3.510 min Read Activity
Fine-Tuning and Adapting LLMs
When to prompt, retrieve or fine-tune, and how LoRA keeps fine-tuning cheap
Code: count the parameters LoRA trains
W′ = W + BA
- 3.610 min Read Activity
Image Generation
How diffusion models create images, and responsible use
Lab: create and compare images
- 3.710 min Read Activity
Multimodal AI Models
Models that link images, text and audio in a shared embedding space
Code: match pictures to captions
Chapter 4 Quality and Safety
- 4.110 min Read Activity
Hallucinations and Grounding
Why LLMs invent facts and how grounding reduces it
Lab: compare grounded and ungrounded answers
- 4.225 min Read Activity
Evaluating a RAG Assistant
Hit@k, MRR, answer correctness, grounding, abstention, failure diagnosis and automated judges
Lab: audit twenty college FAQ responses and diagnose failures
MRR = mean of 1 ÷ rank of the first relevant passage
- 4.310 min Read Activity
- 4.415 min Read Activity