Seedlabs
Source research

VulTriage: Triple-Path Context Augmentation for LLM-Based Vulnerability Detection

Wenxin Tang, Xiang Zhang, Junliang Liu, Jingyu Xiao, Xi Xiao, Jinlong Yang et al. · 2026 · 5 citationsRead the paper

Automated vulnerability detection is a fundamental task in software security, yet existing learning-based methods still struggle to capture the structural dependencies, domain-specific vulnerability knowledge, and complex program semantics required for accurate detection. Recent Large Language Models (LLMs) have shown strong code understanding ability, but directly prompting them with raw source code often leads to missed vulnerabilities or false alarms, especially when vulnerable and benign functions differ only in subtle semantic details. To address this, we propose VulTriage, a triple-path context augmentation framework for LLM-based vulnerability detection. VulTriage enhances the LLM input through three complementary paths: a Control Path that extracts and verbalizes AST, CFG, and DFG information to expose control and data dependencies; a Knowledge Path that retrieves relevant CWE-derived vulnerability patterns and examples through hybrid dense--sparse retrieval; and a Semantic Path that summarizes the functional behavior of the code before the final judgment. These contexts are integrated into a unified instruction to guide the LLM toward more reliable vulnerability reasoning. Experiments on the PrimeVul pair test set show that VulTriage achieves state-of-the-art performance, outperforming existing deep learning and LLM-based baselines on key pair-wise and classification metrics. Further ablation studies verify the effectiveness of each path, and additional experiments on the Kotlin dataset demonstrate the generalization ability of VulTriage under low-resource and class-imbalanced settings. Our code is available at https://github.com/vinsontang1/VulTriage

What the full text shows

Working prototype
  • VulTriage achieved state-of-the-art performance on the PrimeVul pair test set, outperforming DL-based and other LLM-based baselines. — F1-score of 0.6907 vs. 0.6287 (ConColl) and 0.5628 (VulTrial) (PrimeVul pair test set (435 pairs/870 functions))
  • VulTriage demonstrated generalization in low-resource and class-imbalanced settings on a Kotlin dataset. — F1-score of 0.57 vs. 0.44 (ConColl) (Kotlin dataset)
  • The Knowledge Path received the highest overall attention from the model, particularly in middle layers. (Attention score analysis using Qwen3-8B proxy model on 30% of test pairs)
  • Control Info received relatively higher attention in late layers, indicating structural dependencies are most useful near the decision stage. (Attention score analysis using Qwen3-8B proxy model on 30% of test pairs)
Setup
Evaluated on PrimeVul pair split (3,789 training, 480 validation, 435 test pairs) and a Kotlin dataset; compared against DL models (CodeBERT, CodeT5, UniXCoder, LineVul) and LLM methods (GPT-4o based CoT, GPTLens, VulTrial, ConColl).
How
The framework uses a triple-path augmentation: a Control Path (verbalizing AST, CFG, and DFG), a Knowledge Path (hybrid dense-sparse retrieval of CWE patterns), and a Semantic Path (LLM-generated functional summaries). These contexts are integrated into a unified prompt for a final LLM judgment.
Limitations
The Control Path requires parsing source code into graphs (AST, CFG, DFG) before verbalization. · Performance depends on the quality of the CWE-derived knowledge base for the Knowledge Path.

Summarized by Gemma 4 from the open-access full text · 22 Nov 2026. Read it