# Exercises — Session 3: The language of machines 🟢

**Program:** Applied AI — Beginner Level · Instructor: Yann Isola
**Material:** paper + pencil. For exercise 3: the interactive session page or a chatbot.

---

## Exercise 1 — The human tokenizer ✂️ (15 min)

The AI cuts the text into **tokens**: pieces of words. Today, YOU are the tokenizer!

### Part A — Cut like a machine

Cut each word into “logical” pieces, like an AI would do. Rules of the game: frequent pieces (prefixes, suffixes, small common words) remain intact; rare words get cut out.

| Word | Your cutting | Number of tokens |
|-----|-----------------|------------------|
| cat | ______________________ | ____ |
| chatbot | ______________________ | ____ |
| intelligence | ______________________ | ____ |
| today | ______________________ | ____ |
| incredibly | ______________________ | ____ |
| unconstitutionally | ______________________ | ____ |
| smurfology | ______________________ | ____ |

### Part B — Questions for reflection

1. Which word cost you the most tokens? Why, in your opinion?
2. Why doesn't the AI ​​just give EVERY word in the dictionary a number? (Hint: How many forms does the verb “to be” have? What about invented words?)
3. Did your neighbor cut the same as you? What does this tell us about different AI models?

### Part C — LEGO Challenge 🧱

With these 6 tokens: `re` + `faire` + `dé` + `mont` + `er` + `able`
How many French words can you make by combining them? (Examples to get you started: *redo*, *dismantle*…)

> 💡 **To remember:** tokens are reusable bricks. This is what allows AI to process even words it has never seen.

### ✅ Corrected (for the teacher)

**Part A** — *plausible* divisions (⚠ each model has its own, accept any coherent answer):
- cat → `chat` (1)
- chatbot → `chat` + `bot` (2)
- intelligence → `intelli` + `gence` or `intel` + `ligence` (2)
- today → `aujourd` + `'` + `hui` (3)
- incredibly → `in` + `croyable` + `ment` (3)
- unconstitutionally → `anti` + `constitution` + `nelle` + `ment` (4, between 3 and 6 acceptable)
- smurfology → invented word, very cut up: `sch` + `troumpf` + `ologie` (3–6)

**Part B**: 1. Rare/invented words cost more. 2. Too many possible forms (conjugations, plurals, new words): the vocabulary would explode; the pieces recombine. 3. Different cuts = normal, each model learns its own cut.

**Part C**: redo, dismantle, reassemble, assemble, dismantle, reassemble, make, assemble… (accept any valid word).

---

## Exercise 2 — Hallucination hunter 🕵️ (15 min)

An AI answered the questions below. **Each answer contains at least one hallucination** (invented or false information) slipped among true information. It's up to you to flush them out!

### Answer #1 — History

> “The Eiffel Tower was built for the 1889 Universal Exhibition by Gustave Eiffel. It measures approximately 330 meters and was painted blue-white-red for the 1924 Olympic Games. It was to be dismantled after 20 years. »

**True ✅ or invented ❌?** Underline the suspicious passage(s): ____________________

### Answer #2 — Sciences

> “The Moon is the natural satellite of the Earth. It is approximately 384,000 km from us.Its hidden side is home to the Poincaré-Dumas crater, discovered in 1897 by the French astronomer Élise Chantereine using the first liquid mirror telescope. »

**Suspicious passage(s):** ____________________

### Answer #3 — Literature

> “Antoine de Saint-Exupéry wrote *The Little Prince*, published in 1943. He also wrote *Night Flight* and the famous novel *The Stars of the Desert*, which received the Goncourt Prize in 1938.”

**Suspicious passage(s):** ____________________

### Questions for reflection

1. What made these hallucinations difficult to spot? (Hint: look at the level of detail, the tone…)
2. Name 2 reflexes to check an AI response.
3. Why does AI invent instead of saying “I don’t know”?

### ✅ Corrected (for the teacher)

- **n°1:** ❌ “painted blue-white-red for the 1924 Olympic Games” — invented. The rest is true (1889, Gustave Eiffel, ~330 m, dismantling planned after 20 years).
- **n°2:** ❌ The “Poincaré-Dumas crater”, “Élise Chantereine” and the “liquid mirror telescope of 1897” are invented. The hidden side was only observed in 1959 (Soviet Luna 3 probe) — it was impossible to discover a crater there in 1897! Distance ~384,000 km: true.
- **n°3:** ❌ *The Stars of the Desert* does not exist and Saint-Exupéry did not receive the Goncourt in 1938 ⚠ (he received other prizes, including the Grand Prix du roman of the French Academy for *Terre des hommes* in 1939). *The Little Prince* (1943) and *Night Flight*: true.

**Reflection:** 1. The true/false mix + the precise details (names, dates) + the confident tone. 2. Check elsewhere, ask for sources and check them, be wary of being too precise, cross-reference several sources. 3. It calculates the most *plausible* text, not the most *true*; “I don’t know” is rarely the most likely outcome.

---

## Exercise 3 — The temperature experiment 🌡️ (20 min)

The **temperature** regulates the randomness of the responses: low = wise and predictable, high = creative and surprising.

### Material
The interactive session page (“Temperature Lab” tab), or a real chatbot giving it style instructions.

### Protocol

**Step 1.** Choose ONE starting question:
- “Tell me a story that begins with: Once upon a time there was a robot…”
- “Give me an idea for a name for a science club.” »
- “Describe the ideal breakfast. »

**Step 2.** Get 3 answers to the same question:

| Fashion | On the interactive page | With a real chatbot, ask… |
|------|-----------------------|---------------------------------|
| 🧊 Cold (T ≈ 0) | Cursor left | “Answer in the most classic and predictable way possible. » |
| 🌤️ Medium (T ≈ 1) | Slider in the middle | “Answer normally. » |
| 🔥 Hot (T ≈ 2) | Cursor right | “Answer in a very original, surprising, daring way. » |

**Step 3.** Complete the observation table:

| | 🧊 Cold | 🌤️ Medium | 🔥 Hot |
|---|---|---|---|
| Was the response predictable? (0–10) | | | |
| Are there any surprising ideas? | | | |
| Does the answer remain consistent? | | | |
| My pleasure rating (0–10) | | | |

**Step 4.** Reflection Questions:
1. To **translate a text**, what temperature would you choose? For what ?
2. To **invent birthday party ideas**, what temperature? For what ?
3. What did you notice in very hot 🔥 mode? When does creativity become nonsense?
4. Bonus: repeat the same question twice in 🧊 cold mode.Are the answers identical or almost identical? And in 🔥 fashion?

### ✅ Corrected (for the teacher)

1. Low: for a translation we want fidelity, not fantasy.
2. High (or medium-high): we look for varied and original ideas.
3. In very hot mode, the answers go in all directions and can lose all coherence: too much chance breaks the logical thread.
4. Cold: almost identical answers (the most likely token almost always wins). Hot: very different answers each time.

> 💡 **To remember:** there is no absolute “good” temperature — there is the right temperature **for a given task**. ⚠ Most consumer chatbots don't allow you to adjust the temperature directly, but the style guidelines produce a comparable effect.