BIGGER PICTURE Public & everyday services
Catching spam that hides behind misspelled words
A scammer can alter a word with look-alike letters, invisible characters or deliberate typos. RETVec helped Gmail’s filters recognise the underlying pattern instead of being distracted by the spelling trick.

- Paper’s production test
- Caught 38% of previously missed spam
- Comparison boundary
- Same model test; text vectorizer replaced
- Public artefact
- Open code; repository archived in 2025
How the idea works
Vary suspicious spellings
Training includes typos and adversarial character substitutions.
Preserve the underlying word pattern
Similar forms receive resilient numerical representations.
Classify and check false alarms
The spam model is evaluated on missed spam and legitimate mail.
A spelling change should not defeat a defence
Spam filters need a numerical representation of text before they can classify it. Attackers exploit that step by changing how suspicious words are written while keeping them understandable to a reader. Google developed RETVec to make that representation resilient to character manipulations, so small surface changes would not so easily hide the message’s signal.
Sources: [2]
Practise on the distortions attackers use
The released method combines a compact character encoder with similarity learning. Training includes insertions, deletions, look-alike characters and other changes, teaching the representation to keep related word forms close. It supports UTF-8 text without relying on a fixed word dictionary. The project published code and examples for researchers and developers to inspect.
Sources: [3]
What the 38% result actually means
In the paper’s internal production evaluation, replacing the previous vectorizer caught 38% of spam the baseline had missed, at a fixed false-positive rate. That is not a 38-percentage-point jump in all spam detection. Google’s deployment report separately described fewer legitimate messages misclassified and lower computing use. These are related but distinct reported comparisons.
A small component can protect a large inbox
The benefit is a less easily evaded filter, not a guarantee that malicious mail disappears. The public repository was archived in April 2025, so it should be treated as a research artefact rather than an actively maintained product recommendation. The design lesson remains useful: strengthen the representation at the point an attacker is manipulating.
Sources: [3]
The original sources
- Bursztein and colleagues, NeurIPS 2023RETVec: Resilient and Efficient Text Vectorizer
- Google Security BlogImproving Text Classification Resilience and Efficiency with RETVec
- Google ResearchRETVec: implementation and archive notice