Fine-Tuned LLMs Fake Security Smarts: Calibration Without Comprehension
A new framework shows fine-tuned LLMs shift output thresholds without genuine security reasoning, with best detection at only 52.1% and CWE Top-1 accuracy below 1.3%.
In the year of our algorithm, 2024, a new study drops CWE-Trace—a framework built from 834 hand-picked Linux kernel samples spanning 74 CWEs. This is effectively a temporal firing range: a strict pre-2025 historical set and a post-cutoff leakage-free set, with context-aware vulnerable–patched pairs. It’s a rigorous evaluation of fine-tuned models, much like when we observed the shift from analog to digital warfare in the 1990s—the tools change, but the failure modes remain.
The central finding? Fine-tuning produces what the authors call “calibration without comprehension.” The output distributions shift to match training data, but the underlying security reasoning is absent. It’s like a trader who learns to mimic market patterns without understanding risk. The output threshold shifts, but the decision policy stays static. Evidence: stable systematic failure modes, with the Directional Failure Index (DFI) ranging from -85.5 to +94.8 percentage points, persisting from historical to post-cutoff data, resisting correction. The market was bleeding red like a bruised arm.
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. The best detection score reaches only 52.1% (+2.1 pp above chance); exact CWE ranking remains below 1.3% Top-1 accuracy. This confirms that current LLMs lack reliable security reasoning for systems software, regardless of fine-tuning strategy. It’s like short-selling truth—the yield on compliance just went ex-dividend.
Interestingly, the weakest backbone at binary detection (DeepSeek-R1) gains the most in coarse CWE classification, revealing that detection and understanding are decoupled capabilities. Improving one metric does not imply improvement in the other. This is a classic market inefficiency: you can pump the numbers without fixing the fundamentals.
These findings have direct implications for AI×crypto applications. On-chain vulnerability oracles relying on fine-tuned LLMs to audit smart contracts inherit the same failure modes, potentially missing nearly half of vulnerabilities. MEV and consensus-layer security tools using LLM-based agents may be evaded by adversarial inputs that exploit backbone directional priors. Zero-knowledge proof auditing, which requires precise classification of cryptographic bugs, is undermined by the <1.3% Top-1 CWE accuracy. Decentralized AI inference markets cannot infer reasoning quality from benchmark performance alone, as detection and understanding are decoupled. Finally, token-incentivized data-labeling markets cannot reliably price contamination risk, since contaminated samples carry weak memorization signals and frequent misclassifications. The interface was cold, the latency on that script was zero; it hit the target.
Provenance ledger
8/8 claims span-verified · SHA-256Every claim below is locked to a verbatim span of its source and re-verified against that source before publish. Citation markers in the text jump here.
[1] CWE-Trace is a framework for LLM vulnerability detection built from 834 manually curated Linux kernel samples spanning 74 CWEs. span-verified
We present CWE-Trace, a framework for LLM vulnerability detection built from 834 manually curated Linux kernel samples spanning 74 CWEs.
0078606fc0f64d5a2d2f4c70f545a77355574387243946d60812a2ae50d89448 [2] The framework enforces a strict temporal split (pre-2025 historical set / post-cutoff leakage-free set) and preserves context-aware vulnerable--patched pairs. span-verified
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).
243aea3be1d11687abacc616e939828fa18405052bb52bbf06178952a79e4f02 [3] Data contamination provides no measurable advantage: 84% of nominally contaminated samples carry no usable memorization signal. span-verified
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.
ef5379d1dc133ac68326a3a8791dff8ba26a91319f63e54c476cd026ffdbf1a8 [4] 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. span-verified
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.
fa4b1d1e42fc39f761f3c4e56e1fed52b2b30aff4071f2542fff6a371dba0e4f [5] Fine-tuning shifts the output threshold without changing the decision policy — calibration without comprehension. span-verified
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.
205126e6953c7511519a8c289dd274c65cdcce9dd9e15e91ec90150454a3f6a1 [6] The weakest backbone at binary detection (DeepSeek-R1) gains the most in coarse CWE classification, revealing detection and understanding are decoupled capabilities. span-verified
The weakest backbone at binary detection (DeepSeek-R1) gains the most in coarse CWE classification, revealing that detection and understanding are decoupled capabilities.
4bdb04e9c85cc539ad6cb1d6127a61f655a3cca5d1051786e4df810e338cb415 [7] The best detection score reaches only 52.1% (+2.1 pp above chance); exact CWE ranking remains below 1.3% Top-1 accuracy. span-verified
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.
649574ef90580536c9f63dd1493e06f690b31efcef639a645883ec673646e206 [8] ~31% of contaminated samples carry CWE misclassification. span-verified
~31% of contaminated samples carry CWE misclassification.
2aca4451e3860b4eb5cb48e037bfa43096d44355b385803a3427b102ea47030d