mlsanityData to 14 Oct 2026

Representation Matters: An Empirical Study of Program Representations for LLM Vulnerability Reasoning

arXiv 2606.25356 ↗First posted 24 Jun 2026cs.CR cs.SEcited by 0

On the map: LLM reasoning → Reasoning for agents, planning and code

Abstract (arXiv)

Large Language Models (LLMs) are increasingly used for automated vulnerability detection, but it remains unclear how program structure and semantics should be represented for LLM-based reasoning. Most prompting-based approaches provide raw source code, implicitly assuming that more source-level context gives the model better evidence. This paper challenges that assumption through RepBench, an empirical benchmark comparing raw source code with static-analysis-based program representations. RepBench converts real-world C/C++ vulnerability testcases into multiple representations: raw source, Abstract Syntax Trees (ASTs), Control-Flow Graphs (CFGs), Program Dependence Graphs (PDGs), their combinations, and an auxiliary track of enriched PDGs (ePDGs). Using a curated PrimeVul-derived corpus of 107 Joern-based testcases across five CWE categories, we evaluate ten representation variants under a fixed Chain-of-Thought and structured-output protocol, plus 19 additional ePDG cases generated through VulChecker/Hector. Representation choice substantially affects LLM vulnerability reasoning. The strongest variant, AST+PDG, achieves 83.2% accuracy, compared with 53.5% for raw source. At the family level, graph-only prompts outperform both source-only and source-plus-graph prompts while requiring far less prompt overhead. These results reveal a context dilution effect: adding raw source code to compact structural graph evidence can degrade reasoning by making vulnerability-relevant evidence less salient. Overall, our findings show that carefully selected structural representations offer a better accuracy-overhead tradeoff than simply giving LLMs more raw input, and suggest that static analysis can serve as an effective prompt-construction layer for security-focused LLM reasoning.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 3 of its 36 references that are in the map. First posted on arXiv 24 Jun 2026.

Builds on

3 of 36 references.

References · 3

  1. 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 139
  2. 2024Chain-of-Thought Prompting of Large Language Models for Discovering and Fixing Software Vulnerabilitiescited by 31
  3. 2021A Controlled Experiment of Different Code Representations for Learning-Based Bug Repaircited by 5

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2025SV-TrustEval-C: Evaluating Structure and Semantic Reasoning in Large Language Models for Source Code Vulnerability Analysis
  2. 2024LLM4Vuln: A Unified Evaluation Framework for Decoupling and Enhancing LLMs' Vulnerability Reasoning
  3. 2026VulWeaver: Weaving Broken Semantics for Grounded Vulnerability Detection
  4. 2025VulInstruct: Teaching LLMs Root-Cause Reasoning for Vulnerability Detection via Security Specifications
  5. 2026VulTriage: Triple-Path Context Augmentation for LLM-Based Vulnerability Detection
  6. 2025Reasoning with LLMs for Zero-Shot Vulnerability Detection
  7. 2026Do Fine-Tuned LLMs Understand Vulnerabilities? An Investigation into the Semantic Trap
  8. 2025Boosting Vulnerability Detection of LLMs via Curriculum Preference Optimization with Synthetic Reasoning Data