In 30 seconds
Matthew Berman explains DarkBERT, a 2023 research model further pretrained on English Tor-site text. The paper compares it with BERT and RoBERTa on page classification, ransomware leak-site detection and forum-thread analysis. Its results are promising for the selected datasets but do not establish universal superiority or eliminate the need for human review.
- 1A domain corpusThe authors crawled Tor pages, selected English text and filtered their training corpus.
- 2RoBERTa initializationDarkBERT adapts a previously pretrained general model, rather than replacing its architecture.
- 3Leak-site detectionThe preprocessed model reports 84.11 F1 on the study’s ransomware leak-site evaluation.
- 4Forum triageThe model identifies noteworthy threads, but its 45.13 recall in one setting shows substantial misses.
- 5Privacy and language limitsThe researchers masked or removed sensitive text and limited pretraining to English.
Takeaways
- DarkBERT continues pretraining from RoBERTa rather than training a model entirely from scratch.
- The researchers collected around 6.1 million pages and filtered and processed an English corpus.
- Its reported gains vary by dataset and task; some general-model baselines are close.
- In noteworthy-thread detection, preprocessed DarkBERT achieved 45.13 recall in the reported test.
- Masking and removing sensitive text reduces exposure but cannot prove that all privacy risks are absent.
- The model was trained on English text; the paper notes limitations for other languages.
Read the edited text by chapter
Dark-web language and domain adaptation
Berman introduces the research and explains why specialized text can challenge general models. The paper tests a RoBERTa-based model against selected baselines.
Much of the web people use is readily accessible through ordinary browsers and search engines. The dark web includes services that require special network software, such as Tor, and can host illicit markets or leaked information. It is not a separate internet, however, and not all unindexed pages are dark-web sites or all dark-web activity illegal.
Berman argues that specialized jargon and unusual formatting can make dark-web text difficult for models trained on general text. The researchers investigate whether additional domain-specific pretraining helps. This does not mean ordinary language models cannot be used on such text: the paper compares their actual performance and finds the gap varies by task.
The 2023 paper [DarkBERT: A Language Model for the Dark Side of the Internet](https://arxiv.org/abs/2305.08596) presents an English-language model adapted to text collected through Tor. The intended uses include research and cyber threat intelligence. It is a RoBERTa-based masked language model, not a general-purpose chat assistant or proof of superiority on every dark-web task.
The authors report that a DarkBERT-based classifier outperformed the selected BERT and RoBERTa baselines on the activity-classification datasets they studied. They suggest that domain-specific pretraining can improve representations of distinctive vocabulary and page structures. The comparison is against specific models and data, rather than all language models in all settings.
Data and pretraining
Researchers crawled Tor pages, filtered text and continued pretraining from RoBERTa. They compared raw and preprocessed variants.
To collect data, the team started with onion-domain seed addresses from a search service and public lists, crawled linked pages and saved page titles and body text. They collected around 6.1 million pages and selected English text. This is a sample from accessible Tor services, not a census of the entire dark web.

Instead of training from scratch, the authors initialized from RoBERTa and continued pretraining on their corpus, preserving general English representations. They chose an existing architecture partly to reduce computational load. Berman suggests a different architecture is necessary, but the paper shows domain adaptation using the existing RoBERTa architecture.
The researchers filtered low-information and duplicate pages and balanced categories. They built both a raw-text and a preprocessed version for evaluation; their reported pretraining corpora were 5.83 GB and 5.20 GB respectively. Masking or removing selected sensitive strings is a mitigation, not proof that every private detail was eliminated.
Classification and security use cases
The paper evaluates activity classification, leak-site detection and noteworthy forum threads. Results vary by task and require human review.

For page classification they use the DUTA and CoDA datasets, which categorize activities differently, and train separate classifiers. DarkBERT leads the reported aggregate comparisons, although BERT and RoBERTa are relatively close in some settings. The authors suggest familiar categories such as drugs, electronics and gambling can be easier for general models too.
One application is identifying ransomware leak sites, where attackers may publish stolen material or claims about victims. An automated classifier could help analysts prioritize pages for review; a model flag alone does not establish that a breach or claim is genuine. The paper uses a particular labeled dataset and cross-validation, so results may not transfer unchanged to new sites.

In the leak-site experiment, the preprocessed DarkBERT setting reports an F1 score of 84.11, compared with 44.31 for RoBERTa and 70.77 for uncased BERT under the preprocessed-input setting. These metrics summarize the study's test conditions, not an operational guarantee. The paper attributes some benefit of preprocessing to reducing uninformative tokens.
A second task identifies noteworthy forum threads that might matter to security teams, such as discussions involving sensitive data or vulnerabilities. Analysts could review flagged items rather than reading every post manually. The paper's preprocessed DarkBERT result has 72.44 precision, 45.13 recall and 54.17 F1; the recall shows that many labeled noteworthy threads were still missed.
Word predictions and limitations
A masked-word example illustrates contextual differences. The authors discuss sensitive information and English-only training.
The authors also compare masked-word predictions in a drug-related context. A general BERT model suggests several occupations, while DarkBERT produces terms more related to the context. The example illustrates how surrounding domain language changes likely words; it is not proof that every prediction is correct.
Sensitive data is an important concern because collected text can contain private identifiers. The researchers describe masking identifiers or removing text in the preprocessed corpus, and said they planned to release only the preprocessed model rather than the raw version. They did not plan to publicly release the pretraining corpus; neither filtering nor their tests establish zero privacy risk.

The authors limit pretraining to English and cite prior work estimating that about 90% of dark-web text is English. That estimate is source- and sample-dependent, not an exact measurement of the entire dark web. They say non-English applications may need additional language-specific pretraining and evaluation.
DarkBERT demonstrates the potential value of domain adaptation for selected cybersecurity classification and text-analysis tasks. The strongest takeaway is bounded by the datasets, baselines, language and period studied: it does not establish that DarkBERT is the only such model or that it performs best on every dark-web task. Human verification remains important.
More from this channel
34:21EN
0:36EN
25:50EN
32:20EN
1:03:37EN
0:53EN