Intermediate · module I9
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, 16 topics
- Time
- About 3 hours
- Level
- Intermediate
- Your progress
- 0 / 16
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 minBeing written
Tokens and Context Windows
How text is split into tokens, and why limits and costs follow
Interactive: count tokens
- 1.310 minBeing written
Embeddings and Meaning
How models represent meaning as vectors
Interactive: semantic search demo
- 1.410 minBeing written
How LLMs Are Trained
Pre-training, instruction tuning and learning from human feedback
Interactive: the three training stages
- 1.58 minBeing written
Sampling and Temperature
Why answers vary, and how to control it
Interactive: change the temperature
Chapter 2 Prompt Engineering
- 2.112 minBeing written
Prompting Techniques
Zero-shot, few-shot, step-by-step reasoning and role prompts
Interactive: compare techniques on one task
- 2.210 minBeing written
Structured Outputs
Asking for JSON and tables, and checking them
Code: extract fields from text
- 2.312 minBeing written
Testing and Improving Prompts
Building a small test set and comparing versions
Lab: evaluate three prompts
Chapter 3 Building with LLMs
- 3.115 minBeing written
Using an LLM API from Python
Messages, parameters, errors, cost and keeping keys safe
Code: a homework helper
- 3.215 minBeing written
Building a Chatbot with Memory
Keeping conversation history within limits
Code: a multi-turn chatbot
- 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 minBeing written
Image Generation
How diffusion models create images, and responsible use
Lab: create and compare images
Chapter 4 Quality and Safety
- 4.110 minBeing written
Hallucinations and Grounding
Why LLMs invent facts and how grounding reduces it
Lab: compare grounded and ungrounded answers
- 4.210 minBeing written
Safety, Privacy and Cost
Prompt injection, private data and token budgets
Case study discussion
- 4.315 minBeing written
Module Review and Assessment
Exercises and a scored quiz
Graded build task