Secure Domain Adaptation and Retrieval Augmented Generation for Compact Language Models Using Archived Cybersecurity Intelligence

Abstract Security analysts must reconcile vulnerability, exploit and malware records that are scattered across public repositories, yet it is unclear whether compact, locally deployable language models can reason over such archives. We present SecureLLM, an open framework that normalizes 161,190 records from the National Vulnerability Database, the Known Exploited Vulnerabilities catalog, ExploitDB and MalwareBazaar into one corpus, which we use both to continue pretraining Qwen2.5-1.5B-Instruct and to build a dense retrieval index. We compare the adapted model with its base and three other compact models on 1,000 stratified security prompts, with and without retrieval (10,000 responses), using paired non-parametric tests. Continued pretraining lowered validation loss by 12% during training but left cybersecurity-term coverage in closed-book answers statistically unchanged (Holm-adjusted p = 0.062). With retrieval, the adapted model's answers agreed less with the retrieved context than those of its base (cosine similarity 0.41 versus 0.46; adjusted p < 0.001). On a balanced 10,000-sample EMBER malware test set, gradient-boosted trees reached 0.856 accuracy, whereas the zero-shot language models reached 0.646 (base) and 0.630 (adapted), with precision near 0.91 but recall of only 0.32 and 0.29. In a 100-sample pilot, adding retrieved-neighbor statistics to the prompt made the model label every sample benign. We trace these outcomes to four causes: a mismatch between raw-text pretraining and instruction-style use, a mismatch between the prompt set and the corpus, encoder truncation, and uninformative retrieval neighborhoods. We release the pipeline and propose a leakage-controlled evaluation protocol for cyber-intelligence language models.

Authors

Institutions

Publication Details

Journal
Research Square
Published
2026-11-04
DOI
https://doi.org/10.21203/rs.3.rs-11209286/v1
Primary Topic
Adversarial Robustness in Machine Learning
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
preprint

Secure Domain Adaptation and Retrieval Augmented Generation for Compact Language Models Using Archived Cybersecurity Intelligence

Anas Alsobeh, Izzat Mahmoud Alsmadi, Syrus Redhouse
Research Square
Adversarial Robustness in Machine Learning
preprint

Secure Domain Adaptation and Retrieval Augmented Generation for Compact Language Models Using Archived Cybersecurity Intelligence

Anas Alsobeh, Izzat Mahmoud Alsmadi, Syrus Redhouse
preprint en

Abstract

Abstract Security analysts must reconcile vulnerability, exploit and malware records that are scattered across public repositories, yet it is unclear whether compact, locally deployable language models can reason over such archives. We present SecureLLM, an open framework that normalizes 161,190 records from the National Vulnerability Database, the Known Exploited Vulnerabilities catalog, ExploitDB and MalwareBazaar into one corpus, which we use both to continue pretraining Qwen2.5-1.5B-Instruct and to build a dense retrieval index. We compare the adapted model with its base and three other compact models on 1,000 stratified security prompts, with and without retrieval (10,000 responses), using paired non-parametric tests. Continued pretraining lowered validation loss by 12% during training but left cybersecurity-term coverage in closed-book answers statistically unchanged (Holm-adjusted p = 0.062). With retrieval, the adapted model's answers agreed less with the retrieved context than those of its base (cosine similarity 0.41 versus 0.46; adjusted p < 0.001). On a balanced 10,000-sample EMBER malware test set, gradient-boosted trees reached 0.856 accuracy, whereas the zero-shot language models reached 0.646 (base) and 0.630 (adapted), with precision near 0.91 but recall of only 0.32 and 0.29. In a 100-sample pilot, adding retrieved-neighbor statistics to the prompt made the model label every sample benign. We trace these outcomes to four causes: a mismatch between raw-text pretraining and instruction-style use, a mismatch between the prompt set and the corpus, encoder truncation, and uninformative retrieval neighborhoods. We release the pipeline and propose a leakage-controlled evaluation protocol for cyber-intelligence language models.

Research Square
Texas A&M University – San Antonio (US), Utah Valley University (US)
Adversarial Robustness in Machine Learning
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