AI Cybersecurity Lab

Intrusion and anomaly detection, malware analysis, threat intelligence, phishing, security logs and incident response: defensive experiments that really compute in your browser on synthetic data, with algorithms, datasets, projects and quizzes.

28interactive experiments

BERT and DistilBERT

Algorithm Library · Algorithm NLP Models Explained only

This algorithm is explained only: this version has no in-browser training experiment for it and shows no performance numbers.

The idea

Transformer language models fine-tuned for text classification; DistilBERT is a smaller, faster distilled version.

The problem it addresses

Contextual understanding of phishing language.

Data it needs

Text.

Equations

\operatorname{Attn}(Q,K,V)=\operatorname{softmax}\Big(\tfrac{QK^\top}{\sqrt{d_k}}\Big)V

Steps

  1. Tokenise the text\nPass it through the layers\nFine-tune a classification head

Pseudocode

bert-distilbert.txt
# شرح فقط

Strengths

  • Contextual understanding

Limitations

  • Compute cost
  • Does not run in the browser here

Uses in cybersecurity

  • Phishing-message classification

Common pitfalls

  • Do not send user text to external services without consent and a privacy policy.

Suggested datasets

Related experiments

See also

References

  1. Arp, Quiring, Pendlebury, Warnecke, Pierazzi, Wressnegger, Cavallaro, Rieck (2024). Pitfalls in Machine Learning for Computer Security. Communications of the ACM 67(11), pp. 104-112. doi:10.1145/3643456