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

Institutions

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

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

When Phishing Detectors Don’t Generalize: A Diagnostic Study of BERT-Based Models Under Cross-Distribution Stress

Shweta Sankhwar, Shreyas Rajendra Hole, Rahul Nayak
1 links
Research Square
Spam and Phishing Detection
preprint

When Phishing Detectors Don’t Generalize: A Diagnostic Study of BERT-Based Models Under Cross-Distribution Stress

Shweta Sankhwar, Shreyas Rajendra Hole, Rahul Nayak
preprint en

Abstract

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.

Research Square
University of Delhi (IN), Symbiosis International (Deemed University) (IN), VIT-AP University (IN)
University of Delhi
Spam and Phishing Detection
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon
When Phishing Detectors Don’t Generalize: A Diagnostic Study of BERT-Based Models Under Cross-Distribution Stress — Shweta Sankhwar, Shreyas Rajendra Hole, et al. · Research Square (2026) | TGRS Research Map | TGRS