Calibration Without Comprehension: Diagnosing the Limits of Fine-Tuning LLMs for Vulnerability Detection in Systems Software
Not on the map. Why?
Abstract (arXiv)
Whether LLMs scoring well on vulnerability benchmarks genuinely reason about security or merely pattern-match on contaminated data remains unresolved. We present CWE-Trace, a framework for LLM vulnerability detection built from 834 manually curated Linux kernel samples spanning 74 CWEs. The framework enforces a strict temporal split (pre-2025 historical set / post-cutoff leakage-free set), preserves context-aware vulnerable--patched pairs, and introduces two diagnostic metrics: the Directional Failure Index (DFI) and Hierarchical Distance and Direction (HDD). We evaluate eight vanilla LLMs and 15 LoRA fine-tuned variants across non-targeted detection, targeted detection, and CWE classification. Our analysis yields two key results. First, data contamination provides no measurable advantage. Function-level analysis shows that 84% of nominally contaminated samples carry no usable memorization signal: vulnerable functions are absent or cross-mapped across datasets, and ~31% of contaminated samples carry CWE misclassification. Second, backbone directional priors dominate fine-tuning. Models exhibit stable, systematic failure modes (DFI ranging from -85.5 to +94.8 pp) that persist from historical to post-cutoff data and resist correction. Fine-tuning shifts the output threshold without changing the decision policy. This is calibration without comprehension: output distributions adapt to training data while the underlying security reasoning remains absent. The weakest backbone at binary detection (DeepSeek-R1) gains the most in coarse CWE classification, revealing that detection and understanding are decoupled capabilities. The best detection score reaches only 52.1% (+2.1 pp above chance); exact CWE ranking remains below 1.3% Top-1 accuracy, confirming that current LLMs lack reliable security reasoning for systems software, regardless of fine-tuning strategy.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 25 of its 38 references that are in the map. First posted on arXiv 18 Jun 2026.
Builds on
25 of 38 references.
References · 25
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2025Qwen3 Technical Reportcited by 8,820
- 2014ImageNet Large Scale Visual Recognition Challengecited by 8,498
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2022Competition-Level Code Generation with AlphaCodecited by 1,462
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
- 2024StarCoder 2 and The Stack v2: The Next Generationcited by 502
- 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 272
13 more
- 2020Deep Learning based Vulnerability Detection: Are We There Yet?cited by 144
- 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 139
- 2018Automated Vulnerability Detection in Source Code Using Deep Representation Learningcited by 114
- 2023LLMs Cannot Reliably Identify and Reason About Security Vulnerabilities (Yet?): A Comprehensive Evaluation, Framework, and Benchmarkscited by 97
- 2021CVEfixes: Automated Collection of Vulnerabilities and Their Fixes from Open-Source Softwarecited by 91
- 2023Understanding the Effectiveness of Large Language Models in Detecting Security Vulnerabilitiescited by 59
- 2024LLM4Vuln: A Unified Evaluation Framework for Decoupling and Enhancing LLMs' Vulnerability Reasoningcited by 59
- 2023Data Quality for Software Vulnerability Datasetscited by 51
- 2021D2A: A Dataset Built for AI-Based Vulnerability Detection Methods Using Differential Analysiscited by 49
- 2023How Far Have We Gone in Vulnerability Detection Using Large Language Modelscited by 27
- 2024MegaVul: A C/C++ Vulnerability Dataset with Comprehensive Code Representationcited by 27
- 2024VulDetectBench: Evaluating the Deep Capability of Vulnerability Detection with Large Language Modelscited by 11
- 2024Quantifying Influencer Impact on Affective Polarizationcited by 6
Built on by
Citing papers per year: 2026: 1.
1 paper.
Similar, not cited
Close in wording, no citation either way
- 2024Vul-RAG: Enhancing LLM-based Vulnerability Detection via Knowledge-level RAG
- 2025LLM-Driven Adaptive Source-Sink Identification and False Positive Mitigation for Static Analysis
- 2026Do Fine-Tuned LLMs Understand Vulnerabilities? An Investigation into the Semantic Trap
- 2025Reasoning with LLMs for Zero-Shot Vulnerability Detection
- 2026VulTriage: Triple-Path Context Augmentation for LLM-Based Vulnerability Detection
- 2025A Systematic Study of Code Obfuscation Against LLM-based Vulnerability Detection
- 2025Out of Distribution, Out of Luck: How Well Can LLMs Trained on Vulnerability Datasets Detect Top 25 CWE Weaknesses?
- 2025VulInstruct: Teaching LLMs Root-Cause Reasoning for Vulnerability Detection via Security Specifications