PenQWEN
A 442K-example dataset, synthetic-data pipeline, and two-stage LoRA setup for a cybersecurity LLM
The Challenge
Penetration testing teams spend the first 4+ hours of every engagement on boilerplate reconnaissance: port scanning, service enumeration, vulnerability identification, and report scaffolding. Senior pentesters doing $200/hour work were wasting time on tasks that should be automated. General-purpose LLMs (GPT-4, Claude) produce plausible-looking but technically dangerous output... recommending tools that don't exist, generating commands with wrong flags, or suggesting techniques that violate scope agreements. The security domain requires extreme precision: a hallucinated Nmap flag could scan out-of-scope networks, and a fabricated CVE reference wastes hours of investigation time. No existing LLM solution understood OPSEC constraints, tool-specific syntax, or the structured methodology (PTES) that professional assessments follow.
The Approach
Aggregated ~18GB of public security data (MITRE ATT&CK, CVE databases, ExploitDB, HackTricks, SecLists, Sigma/YARA rules, tool docs) into a 1.7M-record knowledge base, then distilled it into a 442,000-example instruction dataset: agentic tool-calling traces against a 51-tool schema, ReAct reasoning chains, multi-turn OPSEC scenarios, and domain-knowledge examples, all quality-filtered and validated by an ~8,700-line Python pipeline. Designed a two-stage LoRA curriculum (domain adaptation, then agentic tool-use) for Qwen2.5-Coder-32B using Axolotl with FSDP full-shard across 8 A100 GPUs.
Tech Decisions
Technical Challenges
The Solution
Stage-one domain adaptation ran to completion on a rented 8x A100 pod (346 steps, final loss ~1.25), producing a 3.6GB LoRA adapter. The value that persists on disk is the reusable pipeline: a normalized 1.7M-record security knowledge base with hybrid graph and full-text retrieval, a 442K-example training corpus, the synthetic-data generation and validation scripts, and reproducible training configs and cost model. The design targets reconnaissance automation, vulnerability prioritization, and PTES-methodology report scaffolding with scope-aware, OPSEC-conscious tool calling.
Key Takeaways
Related Projects
Have a similar challenge?
I help teams solve complex technical problems. Let's discuss your project.