mlsanityData to 7 Oct 2026

A Neurosymbolic Approach to Loop Invariant Generation via Weakest Precondition Reasoning

arXiv 2512.15816 ↗First posted 17 Dec 2025cs.PL cs.AI cs.LOcited by 0

On the map: LLM reasoning → Reasoning benchmarks and evaluation

Abstract (arXiv)

Loop invariant generation remains a critical bottleneck in automated program verification. Recent work has begun to explore the use of Large Language Models (LLMs) in this area, yet these approaches tend to lack a reliable and structured methodology, with little reference to existing program verification theory. This paper presents NeuroInv, a neurosymbolic approach to loop invariant generation. NeuroInv comprises two key modules: (1) a neural reasoning module that leverages LLMs and Hoare logic to derive and refine candidate invariants via backward-chaining weakest precondition reasoning, and (2) a verification-guided symbolic module that iteratively repairs invariants using counterexamples from OpenJML. We evaluate NeuroInv on a comprehensive benchmark of 150 Java programs, encompassing single and multiple (sequential) loops, multiple arrays, random branching, and noisy code segments. NeuroInv achieves a 99.5% success rate, substantially outperforming the other evaluated approaches. Additionally, we introduce a hard benchmark of 10 larger multi-loop programs (with an average of 7 loops each); NeuroInv's performance in this setting demonstrates that it can scale to more complex verification scenarios.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Reasoning benchmarks and evaluation, one of 17 directions in LLM reasoning. Builds on 10 of its 29 references that are in the map. First posted on arXiv 17 Dec 2025.

Builds on

10 of 29 references.

References · 10

  1. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  2. 2024The Prompt Report: A Systematic Survey of Prompt Engineering Techniquescited by 115
  3. 2024Enchanting Program Specification Synthesis by Large Language Models using Static Analysis and Program Verificationcited by 55
  4. 2023Can Large Language Models Transform Natural Language Intent into Formal Method Postconditions?cited by 53
  5. 2024SpecGen: Automated Generation of Formal Program Specifications via Large Language Modelscited by 51
  6. 2023Lemur: Integrating Large Language Models in Automated Program Verificationcited by 49
  7. 2023Finding Inductive Loop Invariants using Large Language Modelscited by 35
  8. 2023Can ChatGPT support software verification?cited by 14
  9. 2018Invariant Generation for Multi-Path Loops with Polynomial Assignmentscited by 2
  10. 2019SymInfer: Inferring Program Invariants using Symbolic Statescited by 2

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2025Loop Invariant Generation: A Hybrid Framework of Reasoning optimised LLMs and SMT Solvers
  2. 2026Neuro-Symbolic Software Verification: Hyper-charging Local Language Models with Symbolic Reasoning at Scale
  3. 2026Not All Invariants Are Equal: Curating Training Data to Accelerate Program Verification with SLMs
  4. 2026Neuro-Symbolic Proof Generation for Scaling Systems Software Verification
  5. 2025Integrating Symbolic Execution with LLMs for Automated Generation of Program Specifications
  6. 2025Worst-Case Symbolic Constraints Analysis and Generalisation with Large Language Models
  7. 2026Neuro-Formal Verification: Agentic Language-Agnostic Formal Program Reasoning
  8. 2022Evaluating Step-by-Step Reasoning through Symbolic Verification