All courses

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. 1.1

    What Is a Large Language Model?

    Next-token prediction at very large scale

    Interactive: predict the next token

    10 min Read Activity
  2. 1.2

    Tokens and Context Windows

    How text is split into tokens, and why limits and costs follow

    Interactive: count tokens

    8 minBeing written
  3. 1.3

    Embeddings and Meaning

    How models represent meaning as vectors

    Interactive: semantic search demo

    10 minBeing written
  4. 1.4

    How LLMs Are Trained

    Pre-training, instruction tuning and learning from human feedback

    Interactive: the three training stages

    10 minBeing written
  5. 1.5

    Sampling and Temperature

    Why answers vary, and how to control it

    Interactive: change the temperature

    8 minBeing written

Chapter 2 Prompt Engineering

  1. 2.1

    Prompting Techniques

    Zero-shot, few-shot, step-by-step reasoning and role prompts

    Interactive: compare techniques on one task

    12 minBeing written
  2. 2.2

    Structured Outputs

    Asking for JSON and tables, and checking them

    Code: extract fields from text

    10 minBeing written
  3. 2.3

    Testing and Improving Prompts

    Building a small test set and comparing versions

    Lab: evaluate three prompts

    12 minBeing written

Chapter 3 Building with LLMs

  1. 3.1

    Using an LLM API from Python

    Messages, parameters, errors, cost and keeping keys safe

    Code: a homework helper

    15 minBeing written
  2. 3.2

    Building a Chatbot with Memory

    Keeping conversation history within limits

    Code: a multi-turn chatbot

    15 minBeing written
  3. 3.3

    Retrieval-Augmented Generation

    Answering from your own documents

    Code: a question-answering bot for a PDF

    20 min Read
  4. 3.4

    Introduction to AI Agents

    LLMs that use tools and take steps

    Code: an agent with a calculator tool

    15 min Read
  5. 3.5

    Image Generation

    How diffusion models create images, and responsible use

    Lab: create and compare images

    10 minBeing written

Chapter 4 Quality and Safety

  1. 4.1

    Hallucinations and Grounding

    Why LLMs invent facts and how grounding reduces it

    Lab: compare grounded and ungrounded answers

    10 minBeing written
  2. 4.2

    Safety, Privacy and Cost

    Prompt injection, private data and token budgets

    Case study discussion

    10 minBeing written
  3. 4.3

    Module Review and Assessment

    Exercises and a scored quiz

    Graded build task

    15 minBeing written