Récits curieuxTIME FOR A STORY
ONCE UPON A TIME: AI / LESSON 02

How does an AI learn?

Examples, expected answers, then a test: discover supervised learning with a deck of cards.

Your missionDistinguish training examples from test examples.

The game of cards

We prepare cat and dog cards with their labels, model settings are adjusted, then a different card is used to test a response.
Labeled cards are used for training. The model settings change. Then we test with other cards.

Imagine cards with drawings of cats and dogs. On each one, someone wrote the correct answer: “cat” or “dog”. This answer is a label. The program is given the drawings and their labels to train it.

During training, the program adjusts numbers in a model. Here, “model” does not mean a miniature replica: it is a calculation tool built from data. It will be used to suggest a category for another image.

The little trap of the blue background

The training examples show cats on blue and dogs on yellow. The test shows a cat on yellow. A false dog response illustrates the color shortcut, without reporting an actual test.
An invented example: if the model relies on the background, a cat on yellow may fool it. The background colour does not define the animal.

In our imaginary game, all the cat cards have a blue background. All the dog cards have a yellow background. What easy clue could mislead the program? The background colour! In our examples, it goes with the right answer, but it does not describe the animal.

Now let’s try a cat on a yellow background. A model that mainly relies on the background might classify it as a dog. We have not run this experiment here: it is an invented example to understand how a bad shortcut can arise.

To prepare better examples, we vary the backgrounds and the animals. We also check the labels. Adding cards is not enough if they all repeat the same trap.

Training is not the same as passing the test

Some cards are reserved for training, others for testing. A fictitious result shows eight green successes and two red errors, or eight out of ten in this test alone.
We separate the training and test cards. In this fictional example, 8 out of 10 correct answers give 80%: this describes only these 10 cards.

Other cards are kept aside to evaluate the model. They are not used for this training. The goal is to see how he responds to new examples, not just those he has already met.

If the program passes eight out of ten cards in an imaginary test, it would be 80% on those ten cards. This calculation does not mean that it will succeed 80% of all the images in the world. The result describes this precise test.

YOUR TURN

The little question

Which card is useful to look for the background color trap?

  1. Another cat on a blue background.
  2. A cat on a yellow background, never used for training.
See the answer and understand

Answer B. The second card changes the background without changing the animal. It helps to test the shortcut. A single test is not enough to measure all the capabilities of the model.

To go further

Examples are imagined to explain. The concepts are based on these references.

The card game, error and score are fictional and labelled as such. The calculation 8 ÷ 10 × 100 = 80 is reproducible; no real model was trained or evaluated in this exercise.

Course prepared with the assistance of artificial intelligence. Sources consulted on October 13, 2026.

ONE TITLE, ONE GENDER, ONE ENVIE

Find your next reading.

Your preferences

Your favorites, reading position and settings are stored only in this browser. No account is required.

Adsterra and MGID are waiting for your agreement. Monetag is loaded from the opening of the page, regardless of this choice.

Find out more