Posts Tagged ‘scratch’

How to explain Generative AI in the classroom

Wednesday, January 28th, 2026

Generative AI is fast becoming an everyday tool across almost every field and industry. Teaching children about it should include an understanding of how it works, how to think critically about its risks and limitations, and how to use it effectively. In this post, I’ll share how I’ve been doing this.

My approach is to take students through six projects that give a practical and hands-on introduction to generative AI through Scratch. The projects illustrate how generative AI is used in the real world, build intuitions about how models generate text, show how settings and prompts shape the output, highlight the limits (and risks) of “confidently wrong” answers, and introduce some practical techniques to make AI systems more reliable.

As with the rest of what I’ve done with Machine Learning for Kids, my overall aim is AI literacy through making. Students aren’t just told what language models are – they go through a series of exercises to build, test, break, and improve generative AI systems in Scratch. That hands-on approach helps to make abstract ideas (like “context” or “hallucination”) more visible and memorable.

I’ve long described Scratch as a safe sandbox, and this makes it ideal to experiment with the sorts of generative AI concepts they will encounter in daily tools such as chatbots, writing assistants, translation apps, and search experiences.

Core themes

Across the six projects, students repeatedly encounter three core questions:

1. How does a model decide what to say next?
Students learn that language models generate text one word at a time, guided by patterns in data and the recent conversation (“context”).

2. Why do outputs vary, and how can we steer them?
Students discover how settings and prompting techniques can balance creativity vs reliability, and how “good prompting” is about being clear on the job you want done.

3. When should we not trust a model, and what do we do then?
Students experiment with hallucinations, outdated knowledge, semantic drift, and bias. They practise mitigations to these problems, such as retrieval (adding trusted information) and benchmarking (testing systematically).

All of this is intended to be a (much simplified!) mirror of real-world practice. Professional uses of generative AI combine generation (writing), grounding (bringing in trusted sources), instruction (prompting), and evaluation (testing and comparing). Children can be introduced to all of these aspects through hands-on experiences.

(more…)

Explaining role prompting in Scratch

Sunday, January 11th, 2026

In this post, I want to share a recent worksheet I wrote for Machine Learning for Kids. It is a hands-on project to give students an insight into an aspect of prompt engineering with language models.

Students create a Scratch project that lets them have a conversation with a small language model. They try to have the same conversation multiple times, and they set up the Scratch project so that adds a short role instruction to the context at the start (e.g. “Answer like a pirate”).

The instruction changes how the model answers, and students have to try and work out from the responses they get from the model which persona has been selected.


screen recording of the Scratch project on YouTube

By repeating the activity several times, they should notice something important: the same language model gives very different answers to the same questions, just because of a small change in the instructions. This observation is the key lesson here.

(more…)

Introducing LLM benchmarks using Scratch

Saturday, October 18th, 2025

In this post, I want to share a recent worksheet I wrote for Machine Learning for Kids. It is perhaps a little on the technical side, but I think there is an interesting idea in here.

The lesson behind this project

The idea for this project was to get students thinking about the differences between different language models.

There isn’t a “best” model, that is the best at every task. Each model can be good at some tasks, and less good at other tasks.

The best model for a specific task isn’t always necessarily going to be the largest and most complex model. Smaller and simpler models can be better at some tasks than larger models.

And we can identify how good each model is at a specific task by testing it at that task.

(more…)

Exploring Language Models in Scratch with Machine Learning for Kids

Sunday, March 2nd, 2025

In this post, I want to share the most recent section I’ve added to Machine Learning for Kids: support for generating text and an explanation of some of the ideas behind large language models.


youtu.be/Duw83OYcBik

After launching the feature, I recorded a video using it. It turned into a 45 minute end-to-end walkthrough… longer than I planned! A lot of people won’t have time to watch that, so I’ve typed up what I said to share a version that’s easier to skim. It’s not a transcript – I’ve written a shortened version of what I was trying to say in the demo! I’ll include timestamped links as I go if you want to see the full explanation for any particular bit.

The goal was to be able to use language models (the sort of technology behind tools like ChatGPT) in Scratch.

youtu.be/Duw83OYcBik – jump to 00:19

For example, this means I can ask the Scratch cat:

Who were the Tudor Kings of England?

Or I can ask:

Should white chocolate really be called chocolate?

Although that is fun, I think the more interesting bit is the journey for how you get there.

(more…)

Using books data in Scratch

Sunday, May 19th, 2024

In this post, I want to share a Scratch extension that I’ve been working on today: enabling access to books data from the OpenLibrary API through new Scratch blocks.

Most of the work I do on Machine Learning for Kids involves adding machine learning models into Scratch. To enable students to create interesting projects, it also helps to make it easier to get external data into Scratch that they can use for training and classifying. A few examples of where I’ve done this in the past include creating Scratch blocks to access weather data, data from Spotify, and data from Wikipedia.

New blocks

The new blocks I’ve worked on today use the OpenLibrary API to enable access to information about books.

(more…)

MQTT extension for Scratch

Saturday, August 5th, 2023

screenshot

Extensions in Scratch let you add additional blocks to the palette. I’ve written about how to create extensions before, but in this post I want to share my latest extension which adds MQTT support.

I don’t have a particular Scratch project in mind for this yet, but publishing and subscribing to an MQTT broker from a Scratch project would allow multiple web browsers each running Scratch to communicate with each other. I’m sure there are some fun things this could be used for.

(more…)

Catching the carpool cheats

Monday, July 24th, 2023

I’ve added a new project worksheet to Machine Learning for Kids, based on the idea of a traffic camera in a carpool lane.

Students create training examples by labelling pictures of cars with random passengers in.


recording of creating the training examples at youtu.be/KtDrKcAwECU

(more…)

What children can learn about artificial intelligence

Sunday, May 21st, 2023

One of the conference presentations I gave last year was a talk at Heapcon, sharing some stories of AI/ML lessons I’ve run in schools. The focus of the talk was how I’ve seen children understand and react to machine learning technologies.

I’ve since expanded the ideas in this talk into a mini-book at MachineLearningForKids.co.uk/stories but here is a recording of where some of these stories started.