A QLoRA fine-tune of
Qwen3-32B that maps a free-text
CVE description to the
CWE weakness
ID(s) it corresponds to. The LoRA adapter is merged into the base and released in 16-bit, so it
loads directly with
transformers. A smaller/faster variant is available at
exploitintel/cve-cwe-qwen3-8b.
Trained only on labels where
NVD and the CNA agree after roll-up to
CWE View-1003 — see the
cve-cwe-consensus dataset.
1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4mid = "exploitintel/cve-cwe-qwen3-32b"
5tok = AutoTokenizer.from_pretrained(mid)
6model = AutoModelForCausalLM.from_pretrained(mid, torch_dtype="auto", device_map="auto")
7
8messages = [
9 {"role": "system", "content": "You are a vulnerability analyst. Given a CVE description, "
10 "reply with only the CWE ID(s) it maps to, comma-separated."},
11 {"role": "user", "content": "A SQL injection vulnerability in the login endpoint allows an "
12 "unauthenticated attacker to execute arbitrary SQL via the username parameter."},
13]
14inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
15out = model.generate(inputs, max_new_tokens=32, do_sample=False)
16print(tok.decode(out[0][inputs.shape[-1]:], skip_special_tokens=True))
17# -> CWE-89
ChatML (Qwen3 standard). Fixed system prompt; the description is the only user input.
Apache-2.0 (inherited from Qwen3-32B). Dataset derives from public upstreams (NVD, MITRE CVE/CWE).