Beyond True or False: Why You Can't Trust the Reasoning in LLM-Generated Vulnerability Reports

arXiv:2602.06687 · cs.CR · Submitted 2026-02-06 · Read on arXiv

Listen

Radio episode about this paper

Transcript

Introduction to the show: ident: Security Radio. Generated commentary on the latest security and cryptography papers.

Nadia: We're looking at the paper: "Beyond True or False".

Title and authors: Nadia: So, moving past just defining the test, they look at why these models fail. They did a qualitative analysis on twelve different ways models mess up when they are reasoning through a vulnerability report, labeling those errors things like analytical focus errors or logical analysis errors.

Elias: That’s the big finding: it’s not just one big mistake; there are twelve distinct patterns where the model starts making mistakes because its internal logic isn't sound. They show these issues are mostly about understanding the code and deriving conclusions, rather than just random things they make up on their own.

Priya: If we look at that thirty-six point four percent of correct verdicts that come from irrelevant logic, that suggests a lot of incorrect confidence in the system we use for security checks. That kind of uncertainty is a big deal for anyone trying to automate defense.

Nadia: That means a good chunk of what we rely on for automated security checks is based on shaky reasoning, and they found their framework addresses this by modeling the entire thinking process as a Directed Acyclic Graph, or DAG.

Elias: The DAG idea is important because instead of just following one path like a linear chain of thought, the DAG forces the model to show how all those different reasoning steps connect and depend on each other in a structured way.

Priya: So it’s about putting structure on how the AI thinks, making sure every single part of its logic has a place and that it doesn't just jump around randomly between points.

The paper's summary: Nadia: To fix this, they put forward DAGVUL. This framework models vulnerability reasoning as generating a Directed Acyclic Graph to enforce structural consistency in the causal inference, which is different from just a simple linear chain of thought approach.

Elias: They also add Reinforcement Learning with Verifiable Rewards, or RLVR. This part is designed to align the model's reasoning trace with what we know about actual program logic itself, using a hybrid reward function that balances how close the logic is and how correct the final reasoning is.

Priya: So this isn't just some new way to write a better prompt; it’s actually a structural change in how we train or guide the model so that its internal process follows these logical rules instead of just trying to mimic correct answers.

Nadia: Right. The authors show that this DAGVUL framework improves the reasoning F1 score by an average of eighteen point nine percent over all the baselines they tested, which is a solid gain when you look at it compared to things like Retrieval Augmented Generation and Supervised Fine-Tuning.

Elias: That improvement is substantial, even though they built this on an eight billion parameter model, showing that structuring the reasoning process helps more than just making the model bigger.

The paper's improvements: Nadia: So to wrap up, this paper with its framework called DAGVUL shows us how to move beyond just looking at final scores in vulnerability detection by forcing the model's reasoning process into a structured graph that enforces consistency.

Elias: It’s about making sure every step of the analysis has a verifiable place, and using reinforcement learning to tie that reasoning process back to actual program logic.

Priya: From my side, I think what this really means is we need these kinds of frameworks if we want to trust AI for security because it tackles the issue of flawed reasoning rather than just trying to get better statistical probabilities on top of a broken foundation.

Nadia: Exactly. The whole point is that by enforcing structural consistency through the DAG, we are making the AI's analysis more reliable and less likely to rely on superficial patterns.

Elias: It bridges that gap between just detecting something and actually understanding why it’s there by aligning the model's trace with the underlying causal logic of a vulnerability report.

Priya: I just hope we see this kind of structured reasoning applied more widely, because right now, when we use these models for critical tasks, we have to keep asking if the reasoning is actually sound or if it’s just lucky.

Nadia: We'll be looking at what comes next soon. We've been talking about how these structured reasoning frameworks can make AI more dependable in security work.

Conclusion: Nadia: So we've been looking at how models can just get lucky with vulnerability reports, and this paper, "Beyond True or False: Why You Can't Trust the Reasoning in LLM-Generated Vulnerability Reports," introduces a framework called DAGVUL to fix that.

Elias: It’s about taking those results and structuring the reasoning process as a Directed Acyclic Graph to make sure the causal inference is consistent, not just random.

Priya: I’m still thinking about how they built their test because if the benchmark isn't good, then whatever improvement they suggest won't really translate to real-world security tools.

Nadia: They used a dual benchmark, so one part is real-world vulnerabilities with expert answers, and the other part is code changes that look similar but have different structures to test robustness against those changes.

Elias: And they use reinforcement learning with verifiable rewards to align the model’s trace with actual program logic using a reward function that balances logical closeness and reasoning correctness.

Priya: That makes sense because it’s about imposing structure on how the AI thinks, making sure every part of its logic has a place and that it doesn't just make random leaps between points.

Nadia: Right. They show this DAGVUL framework improves the reasoning F1 score by eighteen point nine percent over all the baselines they tested, which is a solid gain when you look at the comparison against things like retrieval augmented generation and supervised fine-tuning.

Elias: That improvement is substantial, even though they built it on a large parameter model, showing that structuring the reasoning process helps more than just scaling up the size of the model.

Priya: From my side, I think what this really means is we need these kinds of frameworks if we want to trust AI for security because it tackles the issue of flawed reasoning rather than just trying to get better statistical probabilities on top of a broken foundation.

Nadia: Exactly. The whole point is that by enforcing structural consistency through the DAG, we are making the AI's analysis more reliable and less likely to rely on superficial patterns.

Elias: It bridges that gap between just detecting something and actually understanding why it’s there by aligning the model's trace with the underlying causal logic of a vulnerability report.

Priya: I just hope we see this kind of structured reasoning applied more widely, because right now, when we use these models for critical tasks, we have to keep asking if the reasoning is actually sound or if it’s just lucky.

Nadia: We've been talking about how these structural frameworks can make AI more dependable in security work by focusing on verifiable reasoning instead of just output scores.

Elias: It's a step toward making sure the AI’s internal thinking matches the actual logic of the software, not just some statistical fluke.

Priya: I think if we can get this kind of structural alignment working reliably across different languages, that would really change how we deploy these tools in practice.

Nadia: That's what it is. We’ll be looking at how these structured reasoning methods are being applied to other domains next, so stay tuned.

Huazhong University of Science and Technology · Peking University

cs.CR

Submitted: 2026-02-06

Updated: 2026-11-24

Comments: This paper was accepted by the 49th IEEE/ACM International Conference on Software Engineering (ICSE 2027, Research Track)

License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/

Importance score: 100/100

The gist: Large Language Models frequently yield correct detection verdicts based on hallucinated logic or superficial patterns that deviate from the actual root cause.<ref:2602.06687#pg2>.

Key concepts

Flawed Reasoning, Correct Answer
This phenomenon occurs when an LLM provides a correct final answer because its internal logic is based on irrelevant or hallucinated patterns instead of sound analysis. The study found this accounts for 36.4% of correct binary verdicts in current benchmarks.
DAGVUL Framework
DAGVUL models vulnerability reasoning as generating a Directed Acyclic Graph (DAG). This structure forces the model to map causal dependencies explicitly, ensuring that every step in the reasoning process is logically connected and verifiable, unlike linear methods.
Reinforcement Learning with Verifiable Rewards (RLVR)
RLVR aligns the model's reasoning trace with actual program logic by using a hybrid reward function. This function balances how logically close the intermediate steps are to the ground truth and whether the final verdict is correct, guiding learning toward structurally sound analysis.
Dual-Component Benchmark
This benchmark tests LLM reasoning on two types of data: real-world Common Vulnerabilities and Exposures (CVEs) and a robustness dataset featuring code with semantic-preserving transformations. This allows researchers to evaluate if the model's reasoning holds up against both complex, real-world scenarios and subtle code changes.

Terminology

Summary

Large Language Models frequently yield correct detection verdicts based on hallucinated logic or superficial patterns that deviate from the actual root cause. p. 0<ref:2602.06687#pg2>. The paper addresses this gap by constructing a benchmark with real-world vulnerabilities and semantically equivalent code perturbations to evaluate reasoning robustness. p. 0<ref:2602.06687#pg4>. The authors propose DAGVUL, a framework that models vulnerability reasoning as a Directed Acyclic Graph (DAG) generation task to enforce structural consistency in causal inference. p. 1<ref:2602.06687#pg5>. Experimental results demonstrate that the framework improves the reasoning F1-score by an average of 18. p. 09% over all the baselines. p. 0<ref:2602.06687#pg5>

The Evaluation Gap in Current Benchmarks

The current evaluation paradigm for automated vulnerability detection focuses on binary classification, which ignores the intermediate logic necessary to distinguish genuine understanding from superficial pattern matching.<ref:2602.06687#pg2>. The authors identify a critical reliability gap where models often produce correct verdicts through flawed reasoning rather than sound analysis. p. 0<ref:2602.06687#pg2>. This issue is exacerbated because contemporary benchmarks lack the granular ground truth required to evaluate the underlying reasoning process. p. 0<ref:2602.06687#pg2>. The study reveals a concerning “Flawed Reasoning, Correct Answer” phenomenon, where 36. p. 04% of correct binary verdicts stem from hallucinatory or irrelevant logic. p. 1<ref:2602.06687#pg2>

The Proposed DAGVUL Framework

DAGVUL is introduced as a novel framework that models vulnerability reasoning as a Directed Acyclic Graph (DAG) generation task to enforce structural consistency in causal inference.<ref:2602.06687#pg5>. This approach differs from linear chain-of-thought (CoT) by explicitly mapping causal dependencies to enforce structural consistency. p. 0<ref:2602.06687#pg5>. The framework further introduces Reinforcement Learning with Verifiable Rewards (RLVR) to align model reasoning trace with program-intrinsic logic. p. 0<ref:2602.06687#pg5>. This alignment is achieved by defining a hybrid reward function Rtotal that balances logical closeness and reasoning correctness. p. 6<ref:2602.06687#pg6>

The Dual-Component Benchmark

To rigorously test reasoning fidelity, the authors construct a dual-component benchmark consisting of two datasets.<ref:2602.06687#pg4>. The first component is a real-world dataset of 5,078 CVEs across 149 CWE types featuring fine-grained ground truths. p. 1<ref:2602.06687#pg4>. The second component is a robustness dataset featuring 26 semantic-preserving transformations, with 100 critical samples manually annotated to ensure vulnerability characteristics remain unchanged. p. 1<ref:2602.06687#pg4>. This benchmark allows for the systematic evaluation of reasoning against both real-world complexity and semantic robustness. p. 1<ref:2602.06687#pg4>

Performance Gains and Failure Taxonomy

The empirical study shows that DAGVUL achieves an average 18.9% F1-score improvement over all baselines. p. 1<ref:2602.06687#pg5>. The taxonomy of failure modes identified through manual open coding reveals 12 distinct error patterns categorized into four high-level dimensions: Analytical Focus Errors, Code Comprehension Errors, Logical Analysis and Reasoning Errors, and Generative Bias. p. 9<ref:2602.06687#pg6>. These failures are primarily driven by deficits in code comprehension and logical derivation rather than sporadic hallucinations. p. 9<ref:2602.06687#pg6>

Structural Advantages of DAGVUL

DAGVUL imposes architectural rigor on the reasoning process to reduce logical errors through several structural benefits.<ref:2602.06687#pg5>. Acyclicity prevents circular dependencies, while node atomicity mandates that logical leaps remain verifiable through single assertion steps. p. 5<ref:2602.06687#pg6>. The framework’s metrics, Logical Closeness and Reasoning Correctness, ensure that no intermediate assertions are left dangling and the final verdict is exhaustive. p. 5<ref:2602.06687#pg6>. This structural constraint helps distinguish genuine causal derivation from superficial features found in unstructured baselines.<ref:2602.06687#pg6>

Conclusion on Reasoning Reliability

The results confirm that DAGVUL consistently achieves the highest reasoning performance across almost all tested configurations.<ref:2602.06687#pg6>. The framework demonstrates that structured reasoning mechanisms can be more effective than simply scaling model size for complex program analysis tasks. p. 1<ref:2602.06687#pg5> DAGVUL achieves an average improvement of 18. p. 19% in reasoning F1-score over all the baselines and even surpasses specialized reasoning models. p. 1<ref:2602.06687#pg6>. The results confirm that our method effectively mitigates reasoning failures by promoting superior logical consistency compared to linear or unstructured baselines.<ref:2602.06687#pg6>. The framework bridges the gap between detection and reasoning by aligning model reasoning trace with the underlying causal logic of program vulnerabilities. p. 3<ref:2602.06687#pg6>

Future Research Directions

Future work will focus on adversarial training using semantic-preserving transformations to improve robustness.<ref:2602.06687#pg6>. Formal verification could be explored using formal languages like Datalog or Lean for increased reliability, though generalization remains a challenge.<ref:2602.06687#pg6>. Efforts will also be made to improve the identification of source nodes in the DAG by developing targeted training for evidence extraction.<ref:2602.06687#pg6>. The paper notes that while the framework is language-agnostic, its reasoning efficacy on other languages like Java or Python requires further testing.<ref:2602.06687#pg6>. The authors also acknowledge that manual validation of 200 samples only yielded a 3% error rate, confirming the high reliability of the approach despite potential subtle subjective biases from LLM-as-a-Judge. p. 2<ref:2602.06687#pg6>. The paper concludes by emphasizing that continued investment in verifiable reasoning frameworks is essential for ensuring AI remains a reliable asset in software security. p. 1<ref:2602.06687#pg6>

Related Work Context

Existing research explores various methods to apply LLMs to vulnerability detection, including integration with Static Analysis and Dynamic Analysis tools.<ref:2602.06687#pg2>. Approaches like LIFT and SCALE integrate LLMs into static analysis to capture code semantics and execution sequences. p. 3<ref:2602.06687#pg2>. Other methods involve LLM agent approaches that use multi-agent frameworks for complex inter-procedural vulnerabilities at the repository level. p. 3<ref:2602.06687#pg2>. The authors diverge from these streams by positing that reliability issues stem from a flawed core reasoning process. p. 3<ref:2602.06687#pg2>. Their work aligns with the emerging paradigm of trustworthy AI by bridging statistical probability and program-intrinsic logic. p. 1<ref:2602.06687#pg2>. The paper highlights the need for transparent reasoning to make AI-assisted auditing practically viable in real-world environments. p. 0<ref:2602.06687#pg2>

Limitations of the Study

The study has several limitations, including a focus primarily on C/C++ vulnerabilities, with cross-language applicability remaining an open question.<ref:2602.06687#pg6>. The reliance on GPT-5 as an automated judge is noted, though manual validation confirmed its high reliability. p. 4<ref:2602.06687#pg6>. Model generalization to out-of-distribution (OOD) CWE types is an open question requiring further studies. p. 1<ref:2602.06687#pg6>. The authors also note that the DAG baseline does not always surpass the CoT baseline, suggesting that structural constraints are powerful but not universally superior. p. 5<ref:2602.06687#pg6>. The paper also points out that external context often introduces distracting noise, as seen in the instability of RAG performance.<ref:2602.

Green — the paper says it, and the page is printed. Red — no passage carries it, so treat that sentence as unverified. The same check runs on your own text: check a summary against its source, $5.

Improvements for AI systems

  1. DAGVUL framework improves reasoning consistency by modeling vulnerability reasoning as a Directed Acyclic Graph (DAG) generation task, which explicitly captures causal dependencies to enforce structural consistency. This prevents errors common in linear chain-of-thought approaches by ensuring that every intermediate assertion contributes to a definitive and exhaustive audit verdict through the Logical Closeness metric.

  2. The system can achieve significant performance gains by aligning reasoning with program logic through Reinforcement Learning with Verifiable Rewards (RLVR), which leverages program semantics to guide the learning process. This results in an average 18.9% improvement in reasoning F1-score and allows the model's performance to surpass specialized models like Qwen3-30B-Reasoning.

  3. The improved system can be specifically trained using a two-stage approach: Coldstart SFT followed by RLVR, which internalizes the structured reasoning capabilities defined by DAGVUL. This training ensures that the model learns the DAGVUL format and the underlying program analysis semantics before optimizing for structural integrity.

  4. The AI system gains robustness against syntactic noise through semantic-preserving code perturbations, as evidenced by its ability to maintain performance despite transformations that test resilience against superficial pattern changes. This is achieved because it learns to focus on vulnerability-related features rather than being distracted by irrelevant syntactic variations.

  5. The system can be enhanced with a targeted evidence extraction strategy, focusing on improving the identification of source nodes in the DAG to address focus errors (FE) in long-context scenarios. This allows the model to better prioritize vulnerability-relevant segments within extensive codebases during complex semantic comprehension.

Sources

Related papers