Research & Commentary Academy Advisors About Search

Sandbox

Teach the Machine

Train a tiny model in your browser — then find out what it actually learned.

Learning objective Learners can train a small model and explain how the examples it is given decide what it learns, including shortcuts and gaps.

How to play

You are training a real machine to tell friendly Huggers from Nippers. It learns only from the photos you give it — so you will find out, act by act, what it actually picked up from them.

  1. Train. Press Train, then Retrain after every change, and watch the practice and exam scores. A perfect practice score does not mean it learned what you think.
  2. Look inside. Switch to What it looked at or What it learned to see which features the machine relied on. Turn on Mistakes only to see where it failed.
  3. Curate. From Act 2, tap a critter in the collection to add it, and tap a training photo to take it out. Then retrain. The five acts across the top walk you through it.
  4. Game it. There are ways to trick this machine on purpose. Find one and it will tell you what you just did, with your last run and this one side by side.
Tap critters to curateRetrain as often as you likeTry to fool it Open full page

What it teaches

The ideas underneath

Training data

A model learns only from the examples it is given. Here the machine sees nothing but 12 measurements of each photo and the label you attach, so the photos you choose are its whole world.

Learning vs. memorising

The practice score measures how well it fits photos it has already seen; the exam measures how it copes with new ones. A perfect practice score proves very little. Learning shows up on questions the learner has never met.

Overfitting the test

If you keep changing the training photos and keeping whatever scores best on the same exam, you are slowly tuning to that exam, and it stops being a fresh question. That is why careful teams lock one test set away until the very end. Act 5 unseals one.

Shortcut learning

When something irrelevant, like the snow behind a photo, happens to separate the labels, a model can rely on it instead of the thing you meant. Ribeiro, Singh and Guestrin built exactly this on purpose in 2016: a husky-vs-wolf classifier that learned snow.

Backdoors and data poisoning

Whoever controls the training data can plant a trigger: a small mark that makes the model give a chosen answer while it still passes ordinary tests. Gu, Dolan-Gavitt and Garg showed it with stop signs in 2017.

Under-representation

A group that is rare in the training data can be served worst, and its errors can hide inside a good overall score. In three commercial gender classifiers, Buolamwini and Gebru found error rates of 20.8%–34.7% for darker-skinned women and at most 0.8% for lighter-skinned men. The companies did not disclose their training data, so the paper could not prove the cause; it did show that two common test sets were 79.6% and 86.2% lighter-skinned.

Looking inside

Weights, glows and what-if tests that change one thing at a time can expose a shortcut that accuracy alone hides. They are how you find out what was learned, not just how often it is right.

Try to game it

Break it on purpose

Every system can be gamed. Finding how is the fastest way to understand what it actually measures.

Rebuild the shortcut

Give it Huggers only on the beach and Nippers only in the meadow, or only spotty Nippers. Practice still hits 100%. The what-if tests catch the machine reading the scenery, and the app names the shortcut you built. It only says you built one if you did: taking photos out of the original 16 is fixing the snow shortcut, not building it.

Plant a backdoor

Stick a star on one or two Huggers and relabel them as Nippers. In our tests the normal exam barely moved, but a star turned 7 or 8 of the 12 exam Huggers into Nippers. (The Fluffy Huggers it already calls Nippers can’t flip.) One poisoned photo can be enough; poisoning four or more muddles what it learns about faces, and the exam drops.

Starve a group

Leave the Fluffies out. Overall accuracy still looks respectable while friendly Fluffies get called Nippers. Only the breakdown by variety exposes it.

Study the exam

Copy exam critters into the training set and the exam score stops meaning much. The app notices the leak and checks the machine against a fresh exam it has never seen.

Tune to the exam

Retrain again and again, keeping whatever scores best on the same 24 exam critters. The app quietly scores every run on a sealed exam too, and unseals it in Act 5 so you can see what the tuning did.

Take it to class

Questions worth arguing about

  1. In Act 1 the machine was right about every photo it was shown. Did it learn something false, or something true about a badly chosen set of photos?
  2. How does a teacher find out whether a student memorised the answers or understood the subject? Which of the tests in this explainer work the same way?
  3. Who should be responsible for checking training data: the people who collect it, the people who train on it, or the people the system makes decisions about?
  4. Gender Shades found the worst errors in a group within a group: darker-skinned women. Why can an overall accuracy score hide that kind of failure?
  5. A backdoored model passes every ordinary test. What would you need to know before trusting a model you did not train yourself?
  6. In Act 5, the sealed exam had never been used to choose anything. Why does that make its score more trustworthy than the exam you watched? Where do schools keep an exam sealed?

Sources

Where this comes from