VeriLogic: Reinforcement Learning over Verifiable Logical Reasoning Traces

ZeLiang Chen, Yunyao Zhang, Xinglang Zhang, Wenbing Li, Junqing Yu, Zikai SongarXiv 2026

Imagine you’re grading a math test. One student gets the right answer but their "work" is a nonsensical jumble of numbers. Another student has a brilliant, logical derivation but makes a tiny arithmetic error at the very end, leading to the wrong result. In standard machine learning, we usually just reward the first student and penalize the second.

This "outcome-only" approach is exactly what the authors of VeriLogic are trying to fix. They’ve developed a way to peek inside the "black box" of Large Language Model (LLM) reasoning, verify the individual steps using a formal proof assistant, and train the model to be right for the right reasons.

TL;DR

VeriLogic moves beyond just checking if an LLM got the right answer; it uses a formal verifier (Lean4) to provide fine-grained feedback on the model's internal reasoning steps. By decomposing logic into verifiable "traces" and using a novel reinforcement learning objective, it significantly boosts reasoning accuracy and reduces logical "hallucinations."

What Problem Does This Paper Address?

LLMs are surprisingly good at logical reasoning, but they suffer from a major transparency issue. They often produce "heterogeneous correctness": a correct final answer might be supported by invalid logic, or a valid reasoning path might be discarded due to a minor final slip-up.

Current Reinforcement Learning (RL) methods typically use outcome-level rewards. They look at the final answer and say "good" or "bad." This is a blunt instrument. It fails to provide the model with targeted signals about which specific part of its reasoning chain was actually flawed. As shown in Figure 1, a model might "shortcut" its way to a correct answer with an erroneous proof, and standard RL would mistakenly encourage that bad behavior.

Figure 1. Heterogeneous correctness in logical reasoning. A final answer may conceal errors in intermediate reasoning views or proofs, while fine-grained supervision distinguishes and corrects these cases.

Methods

The authors introduce a "Grounding - Optimization - Refinement" pipeline to turn fuzzy natural language reasoning into hard, checkable logic.

  1. Verifiable Reasoning Environment Construction: Instead of just asking for an answer, VeriLogic forces the model to explore three distinct paths: Positive (trying to prove the statement is True), Negative (trying to prove it's False), and Unknown (explaining why the information is insufficient). These paths are "grounded" by translating the natural language problem into Lean4, a formal programming language used for mathematical proofs.
  2. Logical Structured Policy Optimization (PSAR-GRPO): This is the "secret sauce." They use a variant of Group Relative Policy Optimization (GRPO) but add Path-Specific Advantage Routing (PSAR). Essentially, the model gets a global reward for the final answer and local rewards for each reasoning path based on whether the Lean4 verifier accepted the proof. This allows the model to learn that a correct proof is valuable even if the final answer was wrong, and vice versa.
  3. Verifier-Guided Iterative Refinement: If a proof fails, the model doesn't just give up. It takes the error messages from the Lean4 compiler—just like a human programmer would—and tries to "debug" its reasoning in an iterative loop.
Figure 2. Overview of VeriLogic. VeriLogic follows a unified Grounding–Optimization–Refinement pipeline: it constructs explicit and verifiable reasoning paths, combines global outcome supervision with path-specific local advantages through PSAR-GRPO, and iteratively repairs unsuccessful proofs using Lean4 feedback at inference time.

Datasets

The researchers evaluated VeriLogic on six diverse logical reasoning benchmarks, all normalized into a unified True/False/Unknown format:

  • MultiLogic: Diverse logical forms and rule combinations.
  • ProofWriter: Rule-based natural language reasoning.
  • FOLIO: First-order logic annotations.
  • ProverQA: Large-scale first-order logic reasoning.
  • LogiQA: Reading comprehension-style logic.
  • e-SNLI: Natural language inference with explanations.

Key Insights and Ideas

  • Traceability is Trainability: By making the internal reasoning process explicit and verifiable, you transform a "black box" into a series of learnable objects.
  • The Power of Formal Languages: Using Lean4 acts as a "hard" constraint. Unlike a "reward model" (which is just another fallible LLM), a formal verifier provides an objective, mathematical ground truth.
  • Local Rewards Prevent Over-Optimization: Standard RL often leads to "reward hacking" where models find weird ways to maximize score. Local path-level rewards keep the model's "thinking" honest and aligned with the actual rules of logic.

Key Results

VeriLogic consistently outperformed strong baselines across multiple model families:

  • Average Improvements: It achieved average accuracy gains of 6.39% on Qwen3-4B and 5.00% on Llama-3.1-8B.
  • Ablation Success: As seen in Figure 3, while simply formalizing the problem into Lean4 provides a massive boost (from ~80% to 90%), the full VeriLogic suite (RL + Refinement) pushes performance even further to 96.53%.
  • Robustness: The model showed significantly better performance on high-complexity problems compared to vanilla RL methods, which tend to collapse as the reasoning chain gets longer.
Figure 3. Component ablation of VeriLogic on Qwen3-8B. Macro-averaged accuracy over six logical reasoning datasets under formalization, GRPO, PSAR-GRPO, verifier-guided refinement, and full VeriLogic configurations.

Limitations and Future Work

  • The Formalization Bottleneck: The system relies on a "template translation" to turn natural language into Lean4. If this translation is flawed, the verification is meaningless. Improving the "informal-to-formal" translation is a key next step.
  • Computational Overhead: Running a formal verifier and performing iterative refinement at inference time is more computationally expensive than a single forward pass.
  • Beyond Pure Logic: While great for "hard" logic, it remains to be seen how well this approach scales to "softer" reasoning tasks (like legal or ethical reasoning) where there isn't a clear mathematical proof.

Summary updated

Abstract

Logical reasoning derives conclusions from premises through explicit intermediate inference steps, providing a natural basis for process-level verification and supervision. However, existing learning methods often rely on response-level outcome signals, which overlook heterogeneous correctness within the reasoning trace: a correct answer may contain invalid reasoning, while valid intermediate steps may also appear in an incorrect response. To address this issue, we introduce Reinforcement Learning on Verifiable Logical Reasoning (VeriLogic), which turns internal reasoning traces into explicit and verifiable learning objects. Rather than treating a response as an indivisible learning unit, VeriLogic decomposes logical reasoning into explicit intermediate judgments, proofs, and final decisions, and organizes them into a unified "Grounding - Optimization - Refinement" pipeline: (1) Verification-Grounded Reasoning Environment Construction grounds logical reasoning into explicit intermediate states and formally checkable proof obligations, making the internal reasoning process accessible to verification and learning; (2) Logical Structured Policy Optimization learns from verifier feedback through complementary global and local rewards, jointly optimizing the overall reasoning outcome while providing targeted optimization signals to different intermediate reasoning paths; and (3) Verifier-Guided Iterative Refinement acts on verifier feedback by leveraging proof states and error messages to iteratively diagnose and repair failed reasoning. Experiments on six logical reasoning benchmarks show consistent gains over strong baselines, with average improvements of 6.39% and 5.00% on Qwen3 and Llama-3.1. These results highlight the value of making logical reasoning traces verifiable, learnable, and refinable beyond final-answer supervision.
BibTeX
@misc{chen2026verilogic,
  author = {ZeLiang Chen and Yunyao Zhang and Xinglang Zhang and Wenbing Li and Junqing Yu and Zikai Song},
  title = {{VeriLogic: Reinforcement Learning over Verifiable Logical Reasoning Traces}},
  year = {2026},
  eprint = {2611.29147},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.29147},
}
Figure