LLMs detect vulnerabilities at only 52.1% and rank CWEs below 1.3%, showing no real security reasoning
Fine-tuning LLMs only calibrates output thresholds without improving underlying security reasoning
AI/ML arXiv 18 Jun 2026 Measurement Prototype evidence
Published as “Calibration Without Comprehension: Diagnosing the Limits of Fine-Tuning LLMs for Vulnerability Detection in Systems Software”
Why it matters
Current LLM fine-tuning cannot be trusted for automated vulnerability triage in systems software, so security teams should not rely on these models without additional safeguards.
Summary
Fine-tuning LLMs for Linux kernel vulnerability detection does not yield genuine security reasoning; detection accuracy stays near random and CWE classification remains far below operational usefulness. Across eight vanilla models and 15 LoRA-fine-tuned variants, performance clusters around 50% accuracy with strong directional bias, and fine-tuning merely shifts output distributions without improving understanding.
What they found 2
- Fine-tuning does not improve security reasoning, leaving detection near chance.
“Across both settings, our results reveal calibration without comprehension: fine-tuning adjusts outputs without instilling security reasoning, leaving detection near chance and CWE understanding below operational utility.”
- Base models exhibit extreme directional bias despite near-random overall accuracy.
“DeepSeek-R1 is strongly paranoid (δ = +94.8 pp on PBD, +90.8 pp on LFD), effectively flagging code as vulnerable and accumulating true positives at the cost of false positives.”
Caveats 3
- DeepSeek-R1-32B improves on every fine-tuning dataset (+9.2 to +25.9 pp on PBD; +9.4 to +25.9 pp on LFD), showing that some backbones gain coarse CWE placement despite overall detection failure.
- Qwen3-4B coverage increases from 36.9% to above 91% after fine-tuning, yielding apparent accuracy gains of +27.5 to +41.5 pp, though these gains stem from reduced abstention rather than learned vulnerability semantics.
- We note that temperature = 0 may amplify each model’s dominant output mode, and non-zero temperatures could in principle reduce DFI magnitude.
What’s new here 4
- Introduces CWE-Trace, a context-aware benchmark of 834 vulnerable-patched code samples from 417 Linux kernel CVEs with function-level contamination checks.
- Applies a temporal split (historical PBD vs. leakage-free LFD) to separate memorization from generalization.
- Defines two diagnostic metrics, Directional Failure Index (DFI) and Hierarchical Distance and Direction (HDD), to expose bias and hierarchical error structure beyond aggregate accuracy.
- Systematically evaluates eight vanilla LLMs and 15 LoRA-fine-tuned backbones across five major vulnerability datasets under matched contamination controls.