🟢 Session 2 — Exercises: How does AI learn?
Applied AI — Yann Isola · Beginner Level Three exercises, to do alone, in pairs or in groups. No computer required (unless noted). Corrections at the end of the document — don't cheat... or just a little. 😉
Exercise 1 — 🎲 The ranking game: what way to learn?
Duration: 15 min · Format: pairs then sharing
An AI can learn in 3 ways:
- 👩🏫 Supervised : we give him examples WITH the correct answers (the teacher who corrects).
- 🍬 Unsupervised : we give her examples WITHOUT answers, she finds groups on her own (sorting candy).
- 🎮 Reinforcement : she tries, wins or loses points, and improves (the video game).
For each situation below, indicate the learning mode (👩🏫, 🍬 or 🎮) and justify in one sentence:
| # | Situation | Fashion ? |
|---|---|---|
| 1 | We show an AI 100,000 photos of fruits, each with its name (“apple”, “banana”, etc.), so that it can learn to recognize them. | |
| 2 | An AI plays 10 million games of chess against itself; she gains points when she puts checkmate. | |
| 3 | A streaming site gives an AI the listening history of millions of users, without any instructions, and it discovers “families” of listeners with similar tastes. | |
| 4 | A bank shows an AI thousands of transactions labeled “fraud” or “normal” so it can learn to spot fraud. | |
| 5 | A virtual vacuum robot bumps into walls (-10 points) and covers a clean surface (+1 point per m²), and improves its route over time. | |
| 6 | An AI receives 50,000 press articles in bulk and automatically groups them by theme, without being given the list of themes. | |
| 7 | We train an AI to translate by showing it millions of French sentences with their English translation. | |
| 8 | 🌶️ (Trap !) A conversational AI is first trained on huge amounts of text, then humans rate its responses (👍/👎) to improve it. |
Bonus thought question: for situation 1, what would happen if 10% of the labels were false (bananas labeled “apple”)? Respond with the teacher’s analogy.
Exercise 2 — 🔍 Hunting for overfitting: the “by heart” student detector
Duration: 15 min · Format: individual then collective correction
Reminder : L'overfitting (overlearning) is when the AI learns its training examples “by heart” instead of understanding. Result: excellent on what she knows, poor on what is new. To detect it, we compare:
- THE training score (on the exercises already seen)
- THE test score (on exercises kept secret)
Part A — Diagnosis
Four AIs were trained to recognize road signs. Here are their scores. For each, make your diagnosis: good learning , 🧠 overfitting (by heart), or 😴 underfitting (not learned enough).
| AI | Training score | Test score | Diagnosis? |
|---|---|---|---|
| HAS | 95 % | 93 % | |
| B | 99,9 % | 61 % | |
| C | 55 % | 54 % | |
| D | 88 % | 85 % |
Questions :
- Which one would you choose to equip a real car? For what ?
- AI B has the best training score of all. Why is this a trap?
- What advice should I give to the IA C team? (Hint: Think about the student who didn’t work hard enough.)
Part B — The curves that speak
Here is the evolution of an AI's scores during its training:
Score
100 %| ______ Entraînement
| ______/
90 %| _____/
| _/ ...•••••••...
80 %| _/ ..•• ••..
| /..• ••.. Test
70 %| /.• ••..
| /• ••
60 %| •
+---------|---------|---------|---------→
Début Étape 1 Étape 2 Étape 3 Temps
- At first, the two curves rise together. What is happening?
- When does overfitting start? How do you see it?
- If you were the engineer, when would you have stopped training?
- 🌶️ Transfer question: tell the same story but with a human student who prepares for a test by doing THE SAME exercises 50 times. What is he good at doing? What is he missing?
Exercise 3 — 🏗️ Build your own training dataset
Duration: 20-25 min · Format: small groups of 3-4 · The most creative of the three!
You are a team of AI engineers. Assignment : design the dataset on paper to train an AI (supervised learning). You don't collect the real data — you write the collection plan , like the pros.
Step 1 — Choose your project (or invent one)
- 🐶 An AI that recognizes whether a photo shows a dog or a cat
- 🎵 An AI that guesses whether a song is “happy” or “sad”
- ✉️ An AI that detects mean messages on a social network
- 🍅 An AI that spots ripe tomatoes for a picking robot
- 💡 Your idea: ______________________
Step 2 — Complete the design sheet
- Starters : what do we give to AI? (photos? sounds? texts?)
- Labels : what are the response categories? (2 minimum)
- Quantity : how many examples per category? Justify. (Hint: 10 is too few. Why?)
- Diversity : list at least 5 variations absolutely to be included for AI to generalize. (Ex. for dogs: different breeds, indoor/outdoor, day/night, front/back, puppies/adults, etc.)
- Who labels? Who will give the right answers, and what if two people disagree? (Ex.: is this song happy or sad? Not so simple!)
- Test data : How much do you keep secret for the final exam? Why should the AI NEVER see them during training?
Step 3 — The crash test 😈
Exchange your sheet with another group. Each group seeks the flaws of the plan of others:
- “And if we show your AI a fox, what does it say? » (ambiguous cases)
- “Are your photos all from the same phone? » (lack of diversity)
- “Who decides what is “bad”? Would everyone agree? » (bias and subjectivity)
- “Would your AI work in another country? In winter? » (generalization)
Write down the top 2 flaws found, then correct your plan accordingly.
Step 4 — Final pitch (1 min per group)
Present: your AI, your data plan, the worst flaw found by the other group, and your fix.
💡 What this exercise teaches you: In real AI projects, collecting and preparing data is often THE biggest part of the work — much more than the training itself. The best AI engineers are first and foremost obsessed with data quality.
🔑 Fixed
Exercise 1
| # | Answer | Justification |
|---|---|---|
| 1 | 👩🏫 Supervised | Examples + correct answers (fruit names = labels). |
| 2 | 🎮 Reinforcement | Trials + reward (victory) / punishment (defeat). |
| 3 | 🍬 Unsupervised | No labels: the AI discovers groups alone. |
| 4 | 👩🏫 Supervised | Transactions labeled “fraud”/“normal”. |
| 5 | 🎮 Reinforcement | Points gained/lost according to actions, improvement by trials. |
| 6 | 🍬 Unsupervised | Bulk articles, themes discovered without instructions. |
| 7 | 👩🏫 Supervised | Each sentence has its “right answer”: translation. |
| 8 | 🌶️ Mix! | Pre-training on texts, THEN reinforcement based on human notes (👍/👎 = rewards). Real AI often combines several modes. |
Bonuses: it’s like a teacher who corrects with a wrong answer 1 time out of 10: the student partly learns from the mistakes. AI will sometimes confuse apples and bananas — false labels “poison” learning. Quality > quantity.
Exercise 2
Part A:
| AI | Diagnosis | For what |
|---|---|---|
| HAS | Good learning | High AND close scores: it generalizes. |
| B | 🧠 Overfitting | Almost perfect on the training, catastrophic on the new one: she learned by heart. |
| C | 😴Underfitting | Bad everywhere: she didn't learn enough (not enough data, training, or too simple model). |
| D | Good learning | A little weaker than A, but healthy (close scores). |
- AI A : best score on NEW data — and on the road, everything is new.
- The practice score only measures recitation. Only the test score measures true competence. B is the student who memorized the workbook.
- For C: more data, more training, or a stronger model. It is the student who simply has to work harder.
Part B:
- The AI learns general regularities, useful everywhere: both scores go up.
- Towards stage 1-2: the test curve reaches a peak then goes back down as the training curve continues to rise. The divergence of the curves = signature of overfitting.
- At the top of the TEST curve (around stage 1-2). The pros call it early termination (early stopping).
- The student becomes unbeatable... on these 50 precise exercises (he knows the answers by heart). But he fails every new exercise: he has memorized answers instead of understanding methods. This is exactly AI B.
Exercise 3
No single answer key — evaluation grid for the facilitator:
| Criteria | We wait… |
|---|---|
| Entries/labels | Consistent and precise (categories without fuzzy overlap) |
| Quantity | Hundreds/thousands per category, AND balanced between categories |
| Diversity | ≥ 5 relevant variations (conditions, angles, styles, populations, etc.) |
| Labeling | Awareness of subjectivity; idea of having several people vote in case of disagreement |
| Test data | A part (often ~10-20%) kept secret; if the AI sees them, the exam is rigged (it could “recite” them) |
| Crash test | Relevant flaws found AND concrete fixes |
Discussion points to bring out: ambiguous cases (fox? bittersweet song?), bias (“bad” according to whom?), and the fact that the data decides EVERYTHING the AI will know — and everything it will ignore.
Applied AI — Yann Isola · Beginner Level 🟢 · Session 2 — Exercises