Building Personalized Worked Example Generators with AI
Demonstrating Cognitive Load Theory Principles through Structured AI Outputs
Workshop Overview
Welcome to this 3-hour workshop on building AI-powered educational tools grounded in Cognitive Load Theory. You’ll learn a pattern for creating personalized worked examples by modifying a working template.
What You’ll Do
- See a complete demo: Experience the full complex application (3 domains, 16 concepts)
- Study the code: Understand how Pydantic and Marimo create structured AI outputs
- Modify a template: Add concepts to a simplified version (1 domain, 3 concepts)
- Design extensions: Plan how to apply this to YOUR teaching
What You’ll Build
You’ll modify a working Personalised Worked Example Generator (in your browser) that:
- Collects learner profile information (name, domain, interests, hobbies, goals, skill level)
- Generates customised worked examples in ONE domain (Programming)
- Weaves learner interests naturally into educational content
- Provides step-by-step solutions with personal relevance
- Runs in your browser (no installation required)
Note: The demo shows all 3 domains with 16 concepts. You’ll work with a SIMPLIFIED version (1 domain, 3 concepts) and add 1-2 more concepts to learn the pattern.
Learning Objectives
By the end of this workshop, you will:
- Understand the worked example effect and personalisation principle from Cognitive Load Theory
- Modify a working template to add your own concepts (in your browser)
- See how Pydantic ensures structured outputs from AI
- Recognise the pattern for building educational AI tools
- Design extensions for your own teaching context
Pedagogical Foundation
This workshop is grounded in Cognitive Load Theory (Sweller 1988), specifically:
The Worked Example Effect:
“A ‘worked example’ is a problem that has already been solved for the learner, with every step fully explained and clearly shown. The ‘worked example effect’ is the widely replicated finding that novice learners who are given worked examples to study perform better on subsequent tests than learners who are required to solve the equivalent problems themselves.”
Centre for Education Statistics and Evaluation (2023)
Why It Works:
- Unguided problem-solving overloads working memory
- Studying worked examples reduces cognitive load
- More working memory capacity available for schema construction
- Better learning outcomes for novices
Our Addition - Personalization:
- Familiar contexts reduce extraneous cognitive load
- Personal relevance increases germane load (motivation)
- Better schema formation and transfer
Workshop Schedule
3-Hour Schedule
| Time | Duration | Section | Activity |
|---|---|---|---|
| 9:00-0:10 | 10 min | Opening | Think-pair-share: Learning from examples |
| 9:10-9:40 | 30 min | Theory | Cognitive Load Theory principles |
| 9:40-10:00 | 20 min | Demo | See the complete application (all 3 domains) |
| 10:00-11:30 | 90 min | Build | Hands-on: Modify starter template, add concepts |
| 11:30-11:50 | 15-20 min | Extend | Choose: Discussion or Gallery Walk |
Prerequisites
Required Knowledge
- Basic Python: lists, dictionaries, functions (reading code, not writing from scratch)
- No statistics background required
- No prior AI/ML experience needed
Materials Required
Setup Required Before Workshop
That’s it. No installation needed.
What you need:
- Laptop with modern browser
- Internet connection (workshop uses HuggingFace Spaces)
- Optional: Notebook for reflecting on how you’d apply this to your teaching
No Python installation. No API keys. No troubleshooting.
Everything runs in your browser via an interactive web application.
Workshop Structure: A Worked Example Approach
The Worked Example Approach
This workshop follows the worked example pattern:
- ACTIVATE (Opening): Prior knowledge activation
- PRESENT (Theory + Demo): See the complete solution
- STUDY (Build): Examine and modify the code
- UNDERSTAND (Extend): Connect to pedagogical applications
- TRANSFER (Resources): Apply to your own teaching
Fading Scaffolding
Notice how support gradually decreases:
- Theory/Demo: Full explanation, complete working application shown
- Build: Scaffolded practice—modify template, add concepts
- Extend: Independent design—plan your own extensions
- After workshop: Transfer to new domains on your own
Technical Stack
Core Technologies
- OpenAI GPT-5.1: Latest language model with structured outputs
- Pydantic: Data validation using Python type hints
- Gradio: Web interface for the production tool
- Marimo: Reactive Python notebooks for interactive exploration
- HuggingFace Spaces: Free deployment platform
Two Applications in This Workshop
This workshop uses two different applications with distinct purposes:
1. Interactive Exploration App (Marimo)
- 5 hands-on labs for exploring concepts
- Embedded throughout this website
- Experiment with prompt design, personalization, data models
- Learn by doing, no installation required
2. Production Tool (Gradio)
- Complete deployable worked example generator
- Deployed to HuggingFace Spaces
Connection to Learning Science
This workshop demonstrates several evidence-based learning principles:
Get Started
Ready to begin? Start with the opening activity!