Learning from Failures: A Failure-Driven Prompt Refinement for LLM-Based Vulnerability Analysis
Mandana Ghadamian, David Mohaisen
Key points
From the paper's conclusion- The results show that failure-driven refinement improves the reliability of LLM-based vulnerability analysis while yielding reusable prompt design principles.
Abstract
Large Language Models have emerged as promising tools for software vulnerability analysis, but their effectiveness depends heavily on prompt design. Existing research primarily compares prompting strategies using aggregate performance metrics, providing limited insight into why models fail or how prompts can be improved systematically. We propose Failure-Driven Prompt Refinement (FDPR), a methodology that analyzes recurring model failures to guide evidence-based prompt refinement. Using the Damn Vulnerable Java Application (DVJA), we identify recurring failure modes, including false positives, false negatives, unsupported reasoning, and CWE misclassification, and translate them into targeted prompt refinements. We then evaluate the resulting prompt on the Juliet Test Suite and perform cross-model validation to assess generalizability. The results show that failure-driven refinement improves the reliability of LLM-based vulnerability analysis while yielding reusable prompt design principles. More broadly, this work demonstrates that recurring model failures provide a principled foundation for prompt engineering, enabling the systematic development of more reliable LLM-based vulnerability analysis systems.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Assessing and Improving Prompting Large Language Models for Software Vulnerability AnalysisACM Transactions on Software Engineering and Methodology · 2026
- On the Reliability of LLM-Based Vulnerability Patching BenchmarksarXiv · 2026
- Modern Approaches to Software Vulnerability Detection: A Survey of Machine Learning, Deep Learning, and Large Language ModelsElectronics · 2025
- How Much Does the Harness Matter, and for Whom? A Multi-Model Study of Context in LLM-Driven Vulnerability DiscoveryarXiv · 2026
- Do Coding Agents Catch Their Own Bugs? (They Don't.)arXiv · 2026
- Silence of Commit Messages: An Empirical Study for Vulnerability Commit Message Generation using Large Language ModelsProceedings of the ACM on Software Engineering · 2026