AIQ AIQ
Learning from Examples · Lesson 3.1.1

Teaching "Learning from Examples" to Architect mode (ages 15–18)

Part of the Learning from Examples lesson guide. Teaching a different grade? 🌈 Explorer (5–7) · 🔧 Builder (8–10) · 💻 Hacker (11–14)

Hook & Warm-Up

Open with the app's own framing, delivered plainly — this age group doesn't need a game to buy in, just a reason to take the material seriously:

"Supervised learning powers most AI you use daily — from spam filters to voice assistants.
Let's examine the math and methods behind it."

Ask: "If you've looked at any machine learning material online — a course, a YouTube explainer, a job posting for a data role — you've probably seen terms like loss function, regularization, or cross-validation thrown around without much explanation. By the end of this lesson you should be able to define all four ideas in this quiz precisely enough to explain them to someone else, not just recognize the right multiple-choice answer." This framing matters for Architect mode specifically — it's the band the app pitches toward portfolios and career paths, so treat the vocabulary as something they may genuinely need again, in an interview or a project write-up.

Frame the stakes plainly: every one of the four quiz terms in this lesson — bias-variance tradeoff, regularization, the Adam optimizer, cross-validation — is standard vocabulary in any real machine learning course, textbook, or job interview. This lesson isn't simplifying the field for a younger audience anymore; it's teaching the actual terms practitioners use, just compressed into 5–15 minutes. Treat today's session as the first real technical lesson of the app, not a preview of one.

Main Activity

The app's three scenes cover the same ground as every other age band; here, walk through each one and layer in the precise statistical framing this age band's quiz demands.

🏷️ Supervised Learning. Beyond the training/validation/test split (covered at Hacker level too), introduce the framing that ties the rest of the lesson together: every supervised model makes an error on any given prediction, and that total error can be decomposed into bias (error from a model that's too simple to capture the real pattern — underfitting) and variance (error from a model so sensitive to its specific training data that it fits noise along with signal — overfitting). Critically, these two trade off against each other: a model simple enough to have low variance usually has higher bias, and a model flexible enough to have low bias usually has higher variance. There is no free way to drive both to zero at once — model selection is largely the search for a good balance point. Frame it with a concrete pair of examples: a model that always predicts the average value of its training labels, regardless of input, has near-zero variance but usually very high bias — it's underfit, ignoring real signal. A model with enough parameters to pass exactly through every training point has near-zero bias on that training data but very high variance — a tiny change in which examples it trained on would produce a very different model. Neither extreme generalizes well; useful models sit somewhere between.

👨‍🏫 Teaching AI. Ground "Wrong = Adjust" in the actual optimization landscape. The loss function (introduce or review the term) is minimized via gradient descent, but plain gradient descent using a fixed step size for every parameter has real weaknesses — it can be slow to converge, and different parameters often need different step sizes. The Adam optimizer, one of the most widely used in practice, improves on this by maintaining an adaptive, per-parameter learning rate combined with momentum — it remembers a running average of recent gradients (momentum) and scales each parameter's step size based on how consistently large or small its recent gradients have been. The practical upshot: faster, more stable convergence than plain gradient descent on most real problems, which is why it's a default choice in most modern training code.

Then connect this back to bias-variance directly: regularization (L1 and L2 are the two standard forms) is a technique for deliberately pushing a model toward the lower-variance, higher-bias side of that tradeoff, on purpose, when a model would otherwise overfit. It works by adding a penalty term to the loss function that grows with the size of the model's parameters — so the optimization is no longer just "minimize prediction error," it's "minimize prediction error while also keeping the parameters small." Large, extreme parameter values are usually a symptom of a model fitting noise rather than signal, so penalizing them nudges the model toward smoother, more generalizable behavior.

🌍 Real Examples. Use this scene to introduce cross-validation as the practical tool that ties bias-variance, regularization, and honest evaluation together. Rather than a single train/test split, k-fold cross-validation repeatedly splits the training data into different train/validation partitions, trains and evaluates on each split, and averages the results — giving a much more reliable estimate of how a model (or a specific amount of regularization, or a specific hyperparameter) will generalize, without touching the final test set at all. Walk through how you'd use it for one of the four real examples: choosing how much regularization a medical-imaging model needs is exactly the kind of decision cross-validation is for, since getting it wrong in either direction — too little (overfits) or too much (underfits, misses real cases) — has real consequences.

Close the activity by asking the class to trace the full pipeline for one real example, out loud, using every term introduced today in order: labeled X-rays form the training set; a model is fit by minimizing a loss function via an optimizer like Adam; regularization strength and other hyperparameters are chosen using cross-validation to balance bias against variance; and the final, chosen model is evaluated once, honestly, on a test set it has never influenced in any way. That full chain — not any single term in isolation — is what "training a supervised model" means in practice.

Discussion

Quiz Walkthrough

Each answer below is stated the way it would need to be stated in a technical context, not just simplified for a multiple-choice screen — encourage students to answer discussion follow-ups in complete, precise sentences rather than single words, since that's the actual skill this age band's quiz is building toward.

The bias-variance tradeoff states that... (Training should be fast / Bigger models are always better / Reducing model bias increases variance and vice versa / More data is better)
Reducing model bias increases variance and vice versa. A simpler model (higher bias, lower variance) underfits; a more flexible model (lower bias, higher variance) risks overfitting. Model selection is largely about finding an acceptable point on that tradeoff, not eliminating both sides.
Regularization (L1/L2) prevents overfitting by... (Penalizing large parameter values in the loss function / Removing layers / Adding more data / Stopping training early)
Penalizing large parameter values in the loss function. Adding a penalty that grows with parameter size discourages the model from relying on extreme, noise-fitting parameter values, nudging it toward simpler, more generalizable solutions.
Adam optimizer improves on basic SGD by... (Using more data / Using less memory / Being simpler / Maintaining adaptive per-parameter learning rates with momentum)
Maintaining adaptive per-parameter learning rates with momentum. It tracks a running average of past gradients (momentum) and adjusts each parameter's step size based on its own recent gradient behavior, which usually converges faster and more stably than a single fixed learning rate applied to every parameter.
Cross-validation serves to... (Validate the hardware / Estimate generalization performance and select hyperparameters / Validate user identity / Cross-check data labels)
Estimate generalization performance and select hyperparameters. By training and evaluating across multiple data splits and averaging the results, it gives a more reliable read on how a model (or a choice like how much regularization to apply) will perform on unseen data, without spending the held-out test set on that decision.

Wrap-Up & Extension

Close with: "Bias-variance, regularization, Adam, cross-validation — these aren't separate topics to memorize. They're four different points where practitioners manage the exact same tension: a model flexible enough to actually learn the pattern, but not so flexible it just memorizes its training data. That tension is the central design problem in almost all of supervised learning."

Extension activity — See overfitting happen: If devices and time allow, have students try Google's free, no-code Teachable Machine tool: train a tiny image or pose classifier on a very small number of examples (3–5 per class) and test it on new examples — it will typically perform poorly, a hands-on look at high variance from too little data. Then retrain with many more examples per class and compare. Where devices or time don't allow this, run it as a paper exercise instead: give students a tiny toy dataset (10 points on a hand-drawn scatter plot, two classes) and have them sketch by hand both a very simple decision boundary (high bias) and a very wiggly one that touches every point exactly (high variance), then discuss which would likely generalize better to a new point drawn from the same distribution.

For a group that wants to go further, have them try the same Teachable Machine experiment with regularization in mind: after training on a small dataset that overfits, ask them to predict what effect adding many more (but noisier or lower-quality) examples would have compared to adding fewer but carefully chosen ones — then, if the tool and time allow, test both and compare. There's no single correct outcome to engineer here; the point is practicing the habit of forming a hypothesis about a model's behavior before testing it, which is the actual daily work behind the vocabulary this lesson introduces. Either version stretches the 10–15 minute core lesson into a full class period and makes the bias-variance tradeoff something they've seen rather than just defined.

← Lesson overview ← AI Perception Challenge (Architect) Finding Patterns (Architect) →