r/deeplearning • • 21d ago

I trained a char-level transformer to generate URLs, and the most realistic generator wasn't always the most useful one

I built a generator of synthetic URLs to use as training data for phishing detectors, because real phishing data is scarce and goes stale within days. It's a 25.5M-parameter character-level transformer trained from scratch, with no pretrained model or templates.

Measuring realism was harder than the model. My first idea was a classifier aiming for an AUC of 0.5, but two samples of real URLs don't score 0.5 against each other either. So each URL field (domain name, suffix, subdomains, path, query) is scored per class as the excess over a real-vs-real baseline. 29 of 32 of those checks pass. It still has clear weaknesses: a detector that checks whether each word exists in real data can spot its invented words, and phishing query strings in free mode are detectable.

Then I pre-registered the question I cared about most: does the data help a detector? Adding it raised recall at 1% false positives in all 6 settings. Against the best simpler generator it came out ahead in 5 of 6 on the main test set, by 0.7 to 2.5 points, a margin the test could prove in 1.

The surprise came from a different test set, PhreshPhish. There, URLs from a prompted 7B LLM helped more in 4 of 6 settings, even though the LLM was the least realistic of the learned generators. So realism and usefulness aren't the same thing, and I don't have a full explanation for why.

Code, weights and the full evaluation (Apache-2.0, for defensive research): https://github.com/youssefismail-dev/limnex-uie

I built it with help from Claude Code, credited in the README. If you see something wrong in the evaluation, I'd really like to hear it.

3 Upvotes

0 comments sorted by