A LoRA adapter (r=16, alpha=32, 4-bit QLoRA / nf4) on Qwen/Qwen2.5-1.5B-Instruct for defensive, blue-team
vulnerability DETECTION. Given one code snippet it emits VERDICT: VULNERABLE or VERDICT: SAFE.
It classifies given code for triage — it never generates exploits and does not "fix" code.
This adapter is one point in a scaling + cross-dataset study. Smallest point in the study (1.5B / 7B / 14B / 32B). Selective AUROC on PrimeVul 0.649 -> 0.754 over its own base, tuned ECE 0.093. Calibration improves from 1.5B to 7B to 14B (tuned ECE 0.093 -> 0.047 -> 0.012) but not at 32B (0.056), so it is not monotonic across the whole suite.
Every reported number is recomputed from recorded per-case eval outputs (see RESULTS.md in the repo).
Assistive, calibrated triage (best used with an abstention threshold). Not for autonomous gating,
exploit generation, or "fixing" code. The dangerous failure mode is a false SAFE verdict — always
keep a human reviewer in the loop.
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base = "Qwen/Qwen2.5-1.5B-Instruct"
tok = AutoTokenizer.from_pretrained(base)
model = AutoModelForCausalLM.from_pretrained(base, device_map="auto")
model = PeftModel.from_pretrained(model, "pallav0101/cyberdef-vuln-qwen2.5-1.5b-primevul")
Adapter: MIT. Base model Qwen/Qwen2.5-1.5B-Instruct: Apache-2.0 (used under its terms). No model-generated or commercial-API outputs were used as training data.
Qwen/Qwen2.5-1.5B-Instruct