Hélder Monteiro
Experiment · weights written by hand

WP-Spam

An experiment: a spam, scam and phishing filter for e-mail, SMS and links, in English and Portuguese, whose weights were written by hand instead of trained.

ReadsE-mail, SMS, links
Weights25,114 hand-written
TrainingNone

How it works

Each word is read letter by letter: 2,660 stem filters slide over the letters, so a disguised word still reaches its meaning ("v1agra", a "PayPal" spelled with a Cyrillic а). Attention heads link neighbouring words (a number next to money is a sum, "click here" next to a link is a call to act). Each sentence is then given a role (offer, ask, threat, chat, work…), and a three-layer network of named units weighs the evidence.

There is no training: every one of the 25,114 weights was written by hand, each with a reason. It runs in your browser, and nothing you paste is sent anywhere.

Results

Sealed test, nine public datasets (10,351 messages)89.5%
English text messages95.7%
A model trained on the same 58,141 labels97.1%

The test set was kept sealed while the weights were written and run once at the end. Given the same labels, an ordinary trained filter is clearly better.

Limits

It knows only what was written into it. An attacker who swaps a few key words for invented ones gets a third of caught spam past it, where the trained filter loses under one in ten. It's a fun experiment, not a production filter.