Neuro-Symbolic Reasoning for Vulnerability Detection
On the map: LLM reasoning → Reasoning benchmarks and evaluation
Abstract (arXiv)
Ask a large language model (LLM) whether a pointer dereference is safe, and it can often produce a plausible justification for ``yes''. The difficulty is that a fluent justification is not a proof. This gap is precisely where automated vulnerability detection lives: deciding, for a given operation in source code, whether a memory safety defect such as a null dereference, use-after-free, or double free can actually occur. We trace the unreliability of LLM-based vulnerability detection to a mechanism, the premature discharge of safety obligations, and argue that the remedy is not better prompting but a separation of roles: the component that interprets the code must not also be the one that decides a safety obligation is met. In this paper, we present LeanGuard, a neuro-symbolic framework that assigns each act to the side equipped for it. On the neural side, an LLM serves strictly as a semantic filter over candidate facts extracted from the abstract syntax tree (AST): it prunes spurious facts and keeps the real ones, but never discharges an obligation or decides the verdict on its own. On the symbolic side, the surviving facts are compiled into a verification model in Lean 4 (a formal proof assistant whose kernel accepts a conclusion only when it is formally proved), where every dangerous operation must be matched by a guard that provably covers it in scope; absent such a guard, the obligation stays open rather than being argued away. Because a function rarely arrives with full context, this symbolic model is necessarily partial: an unproved obligation is not yet a defect. An evidence-aware adjudicator therefore weighs the symbolic and neural verdicts by the quality of each. We instantiate the framework on five CWE classes to ask how far this division of labor can be pushed.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Reasoning benchmarks and evaluation, one of 17 directions in LLM reasoning. Builds on 11 of its 47 references that are in the map. First posted on arXiv 4 Jul 2026.
Builds on
11 of 47 references.
References · 11
- 2021Training Verifiers to Solve Math Word Problemscited by 10,109
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
- 2025DeepSeek-Prover-V2: Advancing Formal Mathematical Reasoning via Reinforcement Learning for Subgoal Decompositioncited by 287
- 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 139
- 2023DiverseVul: A New Vulnerable Source Code Dataset for Deep Learning Based Vulnerability Detectioncited by 102
- 2021CVEfixes: Automated Collection of Vulnerabilities and Their Fixes from Open-Source Softwarecited by 91
- 2025A benchmark for vericoding: formally verified program synthesiscited by 20
- 2025SecVulEval: Benchmarking LLMs for Real-World C/C++ Vulnerability Detectioncited by 19
- 2025R2Vul: Learning to Reason about Software Vulnerabilities with Reinforcement Learning and Structured Reasoning Distillationcited by 7
- 2025QLPro: Automated Code Vulnerability Discovery via LLM and Static Code Analysis Integrationcited by 6
- 2024CleanVul: Automatic Function-Level Vulnerability Detection in Code Commits Using LLM Heuristicscited by 4
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026NeuroLog: Reasoning You Can Audit -- Neuro-Symbolic Vulnerability Discovery via LLM Facts, Datalog, and SMT ↗
- 2026Dissecting the Black Box: Circuit-Level Analysis of LLM Vulnerability Detection
- 2026Routing Ceilings Are Domain-Independent: Structural Prior Injection in Code Security Vulnerability Detection
- 2024To Err is Machine: Vulnerability Detection Challenges LLM Reasoning
- 2026SafeSeek: Universal Attribution of Safety Circuits in Language Models
- 2026Do Fine-Tuned LLMs Understand Vulnerabilities? An Investigation into the Semantic Trap
- 2025Worst-Case Symbolic Constraints Analysis and Generalisation with Large Language Models
- 2025Current Practices for Building LLM-Powered Reasoning Tools Are Ad Hoc -- and We Can Do Better