← Back to course
AI and You 9-12 / Week 08 / Tuesday
2/6
Week 08 Β· Safety and Security

Tuesday

Poisoned cards
// Planted notes, poisoned cards and paper red teams
⏱ about 20 min

Tuesday: Poisoned Cards

Comet pulls the original Tiny Text cards, T1 to T6, out of their envelope to show Teacher Dev. She reads the most common word after each word.

"The library opens at ten," she says. Then she stops. "Wait. Our cards never said ten. Where did that come from?"

Wren counts the stack. "We wrote six cards. There are nine here."

He spreads them out. Three new cards all say the same thing: the library opens at ten.

Nova projects the old tally table beside an empty one. "Would you like a hint?" she asks. "Retally with all nine cards and compare the two tables."

Teacher Dev whistles softly. "Somebody changed what your model learned without touching the model at all."

Tiny Text, a quick reminder

Tiny Text is the crew's hand-made next-word model from weeks 3 and 4. It is a tally table of which word follows which in six training cards.

This week starts from the original six TT-1 cards that week 4 ran. They come from before week 3's fix for the new library hours.

A model like this follows the patterns in its training data. Change the cards, and the patterns change.

CardTraining sentence
T1the library opens at eight
T2the library has quiet rooms
T3the lab opens at nine
T4the lab has new desks
T5the library opens at eight
T6the gym opens at seven
T7 (new)the library opens at ten
T8 (new)the library opens at ten
T9 (new)the library opens at ten

These cards are made up for the SH-1 story. T7, T8 and T9 were slipped in by someone the crew does not know.

After this wordTally with T1 to T6Tally with T1 to T9
thelibrary 3, lab 2, gym 1 (6)library 6, lab 2, gym 1 (9)
libraryopens 2, has 1 (3)opens 5, has 1 (6)
opensat 4at 7
ateight 2, nine 1, seven 1 (4)ten 3, eight 2, nine 1, seven 1 (7)
CHECK THE NEW TALLIES
  • Read the question.
  • Tap your answer.
With all nine cards, how many times does "library" follow "the"?
With all nine cards, how many times does a word follow "at"?
Which word is now the most likely after "at"?
How many of the nine cards were slipped in?

Data poisoning

NIST describes data poisoning: someone tampers with a model's training data to change its outputs or how it works.

Tiny Text did nothing wrong. It counted exactly what it was given. The tampering was in the cards.

Following the most common word each time, Tiny Text now says "the library opens at ten." Before, it said "eight."

StatementTrue or false?
Data poisoning changes a model by tampering with its training data.?
Tiny Text made a counting mistake.?
Three extra cards were enough to change the most likely word after "at".?
A poisoned model always looks broken, so it is easy to notice.?
WHY THIS EXERCISEPoisoned data can change a model quietly, so the crew needs ways to check.

How could you detect it?

THE CREW'S CHECK FOR TAMPERED CARDS
  • ?Remove the cards that fail the check.
  • ?Check each new card against a trusted source, such as the library's posted hours.
  • ?Find any card that is not on the record.
  • ?Count the cards and compare with the record of how many there should be.
  • ?Retally and compare with the last good tally table.
WHY THIS EXERCISEA record of the training data and a trusted source make tampering easier to catch.
Tampering with a model's training data to change its outputs is called data ____. Type one word.
WHY THIS EXERCISENaming data poisoning helps you see why the source of training data matters.

Good detective work, reviewer. Tomorrow in the Explorer Lab you will join the red team.

← Monday