Français
Applied AI · Beginner 🟢 · Session 3
📝 Teacher's Guide
← Return to program 📄 Source .md

Teacher's Guide — Session 3: The language of machines 🟢

Program : Applied AI — Beginner Level Instructor: Yann Isola Recommended duration: 2 hours (adaptable 1h30 – 2h30) Audience : general public from 12 years old, no technical prerequisites Previous session: Session 2 (discovery of chatbots) Next session: Session 4


🎯 Educational objectives

At the end of the session, each participant should be able to:

  1. Explain in his own words that a computer don't understand the text: he calculate with numbers .
  2. Define what a token and cut a simple word into plausible tokens.
  3. Explain the idea of embedding : words transformed into coordinates, where words close in meaning are close on the map.
  4. Describe the context window as limited “working memory”.
  5. Recognize a hallucination of AI and cite 2 reflexes to spot it.
  6. Explain the effect of temperature on the responses of an AI.

🧭 Common theme of the session

The big idea: when you write to an AI, it doesn’t “read” your words like you do. She cuts them into pieces, transforms them into numbers, calculates... then converts numbers back into words. All the magic — and all the limits — come from there.

Spinning metaphor to use throughout the session: AI is a tourist with a dictionary of numbers. She doesn't speak our language, but she has a huge book of letters and an awesome calculator.


⏱️ Unfolded minute by minute

Time Activity Format
0–10 mins Home + session 2 reminder + shocking question Plenary
10–25 mins Part 1 — The computer understands nothing (and yet…) Interactive presentation
25–45 mins Part 2 — Tokens and vocabulary Presentation + mini-game
45–60 mins Part 3 — Embeddings: the word map Presentation + webpage demo
60–70 mins ☕ Break
70–85 mins Part 4 — The context window (working memory) Presentation + telephone game
85–100 mins Part 5 — Hallucinations: when AI invents Presentation + examples
100–110 mins Part 6 — Temperature: the creativity slider Webpage demo
110–115 mins Final activity — The parameters laboratory Pair workshops
115–120 mins Quiz + summary + teaser session 4 Plenary

📖 Detailed content per game

Part 0 — Opening (0–10 min)

Shocking question to ask at the start:

“When you text “Hello, how are you?” at ChatGPT…is it bed your message ? »

Leave to discuss for 2 minutes. Most will say yes. Answer to reveal:

" No. He never sees your words. He sees a sequence of numbers. Today, we are discovering the secret language of machines. »

Express reminder session 2 (2 min): we learned to chat with a chatbot. Today we open the hood.


Part 1 — The computer doesn't understand anything (10–25 min)

Key message: a computer only manipulates numbers. Always. The text, the images, the music: everything becomes numbers.

To say:

Demonstration on the board: Write “CAT” → show that the machine sees something like [67, 72, 65, 84] (letter codes) or, for modern AI, a single token number, e.g. 9846(exact numbers vary between models — give this as an illustrative example, not an official value).

Analogy for 12 year olds:

“Imagine a friend who only speaks the language of telephone numbers. To talk to him, you have to translate each word into a number. To understand his answer, you have to translate his numbers back into words. AI is that friend. »

Trap to avoid: do not say “the AI ​​understands the meaning”. Say instead: “AI calculates relationships between numbers, and these relationships imitate understanding — often very well.”


Part 2 — Tokens and vocabulary (25–45 min)

Simple definition:

A token = a piece of text that the AI ​​processes at once. Sometimes a whole word, sometimes a piece of a word, sometimes just punctuation or a space.

Examples to write on the board (the exact cutouts vary depending on the model; these are illustrative and realistic) :

Text Possible division into tokens
cat chat (1 token)
intelligence intelli + gence (2 tokens)
Today aujourd + ' + hui (3 tokens)
unconstitutionally anti + constitution + nellement (3–5 tokens)
😀 1 to 3 tokens (emojis are also cut out!)

Why cut? Three reasons to explain:

  1. There are too many words. In French alone: ​​hundreds of thousands of forms (conjugations, plurals, etc.). Impossible to number them all.
  2. The pieces recombine. With “anti”, “constitution” and “nelment”, we can make many other words. It's like LEGO bricks.
  3. Unfamiliar words become manageable. A never-before-seen word (“smurfology”) will be cut into small known pieces.

Vocabulary:

Mini-game “The human tokenizer” (8 min): In pairs, cut these words into “logical” pieces (like an AI would do): ordinateur , incroyablement , parapluie , chatbot , refaire Compare the divisions between pairs. Key point: there is no one right answer — each model has its own division, learned automatically according to the frequency of the pieces in its training texts.

Fun fact to share: French often “costs” more tokens than English to say the same thing (around 1.2× to 2× ⚠), because most models were trained mainly on English. This is why some services charge by token!

Transition : “OK, each token has a number. But number 9846 says nothing about the sense of “cat”. How does the machine know that “cat” looks more like “dog” than “wheelbarrow”? Answer: embeddings. »


Part 3 — Embeddings: the word map (45–60 min)

Simple definition:

A embedding (English word that can be translated as “diving” – remember above all: sense coordinates ) = transform each token into a point on a map. Words with a similar meaning are neighbors on the map .

Analogy of the map of France:

“On a map, Paris has coordinates, Lyon has coordinates. We can measure the distance between the two. Embeddings are the same, but instead of geography, the map represents MEANING. “Cat” and “dog” are neighbors. “Chat” and “bill” are opposites. »

To draw on the board (2D map):

        roi •        • reine
        homme •      • femme

   chien •  • chat
        • hamster            • pizza
                             • sushi

The magic of word arithmetic: Write the famous equation on the board:

king − man + woman ≈ queen 👑

Explanation: if we take the coordinates of “king”, remove the “man” direction and add the “woman” direction, we land near “queen”. The direction “masculine → feminine” is a arrow on the card, the same for many pairs of words.

Other examples to guess:

Honest precision: this arithmetic works well on old word models (like word2vec, 2013) and serves as an intuition here. Modern AIs use more complex embeddings, but the idea “direction = position on a map” remains valid.

Technical point to simplify: in reality, the “map” does not have 2 dimensions but hundreds, even thousands ⚠. Say: “Imagine a map not in 2D but in 1000D. Impossible for us to visualize, easy for the machine to calculate. We crush it in 2D to look at it. »

Demo webpage: open webpage/index.html , “Word map” tab. Slide words, show groups (animals, food, royalty, emotions). Test the “magic equation” mode.


☕ Break (60–70 min)


Part 4 — The context window (70–85 min)

Simple definition:

There context window = everything that the AI ​​can “keep in mind” at once: your conversation, your documents, its own responses. Measured in tokens.

Key message: the AI ​​has NO permanent memory of your conversation. With each message, she reread the entire conversation from the beginning (everything that fits in the window) and calculates the result.

Analogy of the work table:

“Imagine that you are doing your homework on a small table. You can place 10 sheets maximum on it. If an 11th leaf arrives, one must fall off — usually the oldest. The context window is this table: everything that is on it, the AI ​​sees it; everything that fell, she forgot. »

Concrete consequences to be given:

  1. In a very long conversation , the AI ​​may forget what you said at the beginning.
  2. If you open a new conversation , it starts from scratch (except special memory functions of certain apps ⚠).
  3. Recent models have increasingly larger windows — from a few thousand to over a million tokens ⚠ (figures which change very quickly, to be checked during the course). One million tokens ≈ several big novels.

Reverse telephone game (5 min): Ask a volunteer to memorize a list of 15 races read once. He retains ~7. Conclusion: “You have a window of context, too! That of AI is bigger, but it exists and it has a limit. »

Practical tip to give: if a conversation becomes very long and the AI ​​“loses the thread”, two reflexes:


Part 5 — Hallucinations (85–100 min)

Simple definition:

A hallucination = when the AI ​​confidently asserts something false or invented : a false date, a book that does not exist, a fabricated quote.

Why does this happen? (the explanation that follows from the whole session):

Formula to remember:

“AI is a machine for producing plausible , not of TRUE . Often the two coincide. Not always. »

Typical examples of hallucinations to cite:

How to spot them – the 4 reflexes to display:

  1. 🔍 Check important facts elsewhere (search engine, official source) — especially dates, figures, names, quotes.
  2. 🎯 Be wary of being too specific : the more precise and unverifiable a detail is, the more we must be wary.
  3. 🔗 Ask for sources : “Where does this information come from? Give me the source. » (Warning: AI can also invent sources ⚠ — you have to click and check.)
  4. ⚖️ Stakes rule : the more important the decision (health, money, graded homework), the more it is necessary to check.

Point of nuance: hallucinations are decreasing with new models and built-in search tools ⚠, but they have not disappeared. The verification reflex remains essential.


Part 6 — Temperature (100–110 min)

Simple definition:

There temperature = a slider which adjusts the randomness in the choice of tokens. Low = the AI ​​almost always chooses the most likely token (wise, predictable responses). High = it gives less likely tokens a chance (surprising, creative… or incoherent answers).

End-of-Sentence Distributor Analogy: Write on the board: “The sky is…” and the imaginary probabilities:

“Low temperature: the AI ​​almost always says “blue”. Average temperature: sometimes “gray” or “beautiful”. Very high temperature: one day, she will say “cheese”. »

When to use what (practical table):

Situation Temperature
Summary, translation, code, math Bass 🧊
Balanced writing, emails Average 🌤️
Brainstorming, poetry, crazy ideas High 🔥

Note: in most consumer chatbots, you cannot adjust the temperature directly — it is set by the service. Some developer interfaces allow this. But we can imitate it with instructions: “answer in a very classic way” vs “be bold and surprising”.

Demo webpage: “Lab temperature” tab. Same question, cursor at 0 → 1 → 2. Make the room laugh with chaotic mode.


Final activity — The parameters laboratory (110–115 min)

In pairs, on the interactive web page (or on a real chatbot if connection available):

  1. Choose a question in the temperature lab.
  2. Test in cold/medium/hot. Note the preferred answer and why.
  3. In the tokenizer, find the French word that costs the most tokens .
  4. On the word map, find the most surprising pair of words (close even though you didn't expect it).

Flash restitution: each pair gives their favorite discovery in one sentence.


Closing (115–120 min)

The 6 sentences to remember (repeat or display):

  1. The computer does not understand words: it calculate with numbers .
  2. The text is divided into tokens , each has a number .
  3. THE embeddings place the words on a meaning map: close in meaning = close in coordinates.
  4. There context window is the AI’s working memory — large, but limited.
  5. AI produces plausible , not of TRUE : beware of hallucinations , we check.
  6. There temperature adjusts the slider between predictable and creative.

Teaser session 4: “Now that we know HOW the machine reads…next time, we learn to TALK to it to get exactly what we want.” »

10 question quiz (see quiz/quiz.md ) — in whole class or individual.


⚠️ Educational pitfalls and anticipated FAQ

“But then the AI ​​doesn’t understand anything at all? » Nuanced answer: she doesn't have an understanding like ours, but her calculations capture so many relationships between words that the result works like understanding in many cases. The philosophical debate “is it understanding?” » is open — and it's a great question.

“Why did the AI ​​lie to me then? » She does not “lie” (lying presupposes an intention). It produces the most probable text. Avoid moral vocabulary; prefer “she was wrong” or “she was hallucinating”.

“ChatGPT remembers me every time! » Some apps add a memory function (notes stored separately and reinjected into the context) ⚠. It's not the model that remembers: it's the application that pastes notes into the window.

“What are the real token numbers? » They depend on the model. Emphasize: the examples in the course are illustrative. What matters is the principle.

Sensitivity of numbers: everything marked ⚠ (vocabulary sizes, window sizes, hallucination rate) evolves quickly. Check before each session.


📦 Material