When Phishing Detectors Don’t Generalize: A Diagnostic Study of BERT-Based Models Under Cross-Distribution Stress
Phishing detectors built on BERT-style encoders often report macro-F1 above 0.95, but usually on a held-out slice of the corpus they were trained on. We wanted to know how much of such a score survives outside that corpus. We fine-tuned a DistilBERT model with 24 handcrafted features, reaching a macro-F1 of 0.97 on its own test split, and ran the same checkpoint through five diagnostic tests. Deleting exclamation marks cost 0.003 F1 and shuffling word order cost 0.044, so the model leans mainly on which words appear. On six other email sources F1 fell to 0.89, with most of the loss on CEAS-08 (0.87) and a merged file (0.86); on two phishing-only sources the model still caught 95–98% of phishing emails. On URLs it was close to chance (0.51), although fine-tuning on 500 labelled URLs brought it back to 0.94. SHAP on a tree-based proxy ranked exclamation density first, a cue the network barely uses. The handcrafted features, fed in unscaled, did not beat DistilBERT alone (0.97 versus 0.98, one seed). Everything here comes from one model and one training corpus, so we offer the tests as a protocol for checking other detectors.
Authors
- Shweta Sankhwar (ORCID: https://orcid.org/0000-0003-0743-6854)
- Shreyas Rajendra Hole (ORCID: https://orcid.org/0000-0002-1432-2196)
- Rahul Nayak
Institutions
- University of Delhi (IN)
- Symbiosis International (Deemed University) (IN)
- VIT-AP University (IN)
Publication Details
- Journal
- Research Square
- Published
- 2026-11-24
- DOI
- https://doi.org/10.21203/rs.3.rs-11105894/v1
- Primary Topic
- Spam and Phishing Detection
- Type
- preprint
Funders
- University of Delhi