- Archived full text: Full archived text, with credits
- Link: https://arxiv.org/html/2503.03586
What it says
The paper introduces JitVul, a pairwise JIT vulnerability-detection benchmark built from 879 CVEs (1,758 vul-intro/vul-fix pairs across 91 CWEs) so that models must tell a vulnerable function apart from its patched benign version, not just label isolated functions. It compares Plain LLM, Dependency-Augmented LLM (fixed Top-5 Jaccard callers/callees), and ReAct agents with CoT and few-shot variants on GPT-4o-mini and GPT-4o. ReAct agents win on pairwise accuracy (pAcc) across all prompting strategies (up to 16.61% better than LLM variants), while Plain/Dep-Aug LLMs post higher F1 scores that mostly reflect over-predicting the vulnerable label. Few-shot and CoT prompting help plain LLMs’ pAcc (1.26% to 17.76% gains) but do little for ReAct agents, which need agent-specific prompting; weak models like Llama-3.1-8B fail the agent loop entirely and default to the benign label.
Claims drawn from this source
- ReAct agents beat plain and dependency-augmented LLMs on pairwise vulnerability accuracy. ReAct achieves higher pAcc than LLMs across all prompting strategies, improving over Dep-Aug LLMs on average by 9.46% (GPT-4o-mini) and 8.42% (GPT-4o); the largest single gain is 16.61% with GPT-4o and vanilla prompting.
- Plain LLM and Dep-Aug LLMs post higher F1 scores but that metric is misleading. LLMs predict the vul label more than 90% of the time in certain settings, boosting recall while precision stays around 50%; pAcc shows the ReAct advantage that F1 hides.
- CoT and few-shot prompting lift plain LLMs’ pairwise accuracy but barely help ReAct agents. CoT instructions like ‘Solve this problem step by step’ and pairwise few-shot examples improve pAcc by 1.26% to 17.76% for LLM variants, while ReAct agents gain less because singleton FS examples do not exercise interprocedural context.
- ReAct’s advantage comes from adaptive, on-demand interprocedural context. ReAct invokes tools one to three times per case, pulling callers, callees, and definitions as needed, whereas Dep-Aug feeds a fixed Top-5 similarity-ranked caller/callee set at once, which can inject noise and sometimes lower pAcc below Plain LLM.
- LLMs and agents struggle to distinguish vulnerable from patched versions. Pairwise-vulnerable failures dominate: 40%-95% for LLMs and roughly 35%-50% for ReAct agents (excluding Llama-3.1-8B), and methods over-analyze patched benign guards while missing root causes in the vulnerable version.
- Weak foundation models break the ReAct loop and collapse to the benign label. Llama-3.1-8B frequently fails format/instruction requirements, so its ReAct agents fail to link outputs and inputs and mostly default to the ben label; GPT-4o outperforms GPT-4o-mini, and prompting strategies must be customized per model.
- ReAct analysis is inconsistent across the two versions of a pair. The agent averages 5.85 tool invocations on the vulnerable version versus 1.79 on the benign one (GPT-4o-mini, vanilla), showing the same loop cannot reliably apply the same standard to both sides.