论文精选

CWE-Trace框架揭示微调LLM在漏洞检测中的局限性

Calibration Without Comprehension: Diagnosing the Limits of Fine-Tuning LLMs for Vulnerability Detection in Systems Software

精选理由

这篇论文用800多个Linux内核漏洞样本做了严谨测试,发现LLM微调后只是改分数线,不是真懂安全。检测率刚过50%,别指望它们当安全审计员。

AI 摘要

研究提出CWE-Trace框架,基于834个手动整理的Linux内核样本(覆盖74个CWE)评估LLM的漏洞检测能力。实验发现数据污染对性能无实质帮助:84%的污染样本不携带可用记忆信号。微调仅改变输出阈值(DFI范围-85.5至+94.8 pp),而不改变底层决策策略,模型在历史数据和截止后数据上表现一致。最佳检测准确率仅52.1%(高出随机2.1个百分点),CWE排名Top-1准确率低于1.3%,表明当前LLM缺乏可靠的安全推理能力。

原文 · arXiv: DeepSeek

Calibration Without Comprehension: Diagnosing the Limits of Fine-Tuning LLMs for Vulnerability Detection in Systems Software

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.