Course 3, lesson 26 of 100, Ages 7+

Spam filters

Keeping junk out of your inbox

Like I’m 5

Spam is junk email, like adverts and tricks you never asked for. A spam filter is an AI guard that spots the junk and keeps it out of your inbox.

The big idea

Spam filters learned from billions of emails that people marked as spam or not spam. They noticed clues: strange links, shouting in capitals, 'you won a prize!' and senders that send millions of messages.

Every new email gets a spam score. High scores go to the spam folder. Because spammers keep changing tricks, filters keep learning, especially from people pressing 'report spam'.

Examples

  • Prize tricks: 'Claim your free phone now!!!' goes straight to spam.
  • Fake bank emails: Filters warn you when a message pretends to be your bank.
  • Oops: Sometimes a real email lands in spam, so it's worth checking the folder now and then.

How it works

  1. The filter reads a new email and looks for clues.
  2. It gives the email a spam score.
  3. High scores go to spam; low scores reach your inbox.

Check your understanding

How did spam filters learn what spam looks like?
Options: From billions of emails people marked as spam or not; By guessing randomly; From a single rule.
Answer: From billions of emails people marked as spam or not. Labelled examples taught them the clues.
Why do spam filters need to keep learning?
Options: Spammers keep inventing new tricks; Emails never change; They get bored.
Answer: Spammers keep inventing new tricks. New tricks need new examples, so filters keep updating.

Remember

Spam filters score each email using clues they learned from labelled examples.

Talk about it

What clues might tell you an email or message is a trick?

Go deeper

Early filters used Naive Bayes, which multiplies the probabilities of words appearing in spam. Modern filters combine machine-learning models with sender reputation and link analysis.