TL;DR
VeryTrace is a zero-shot framework that formalizes natural-language Chain-of-Thought (CoT) reasoning into a structured, compilable Domain-Specific Language (DSL) to enable step-by-step verification and repair. By combining deterministic execution checks for math and constraints with targeted LLM audits for semantic steps, it eliminates error propagation and significantly boosts accuracy across diverse reasoning tasks without requiring domain-specific training.
What Problem Does This Paper Address?
While Chain-of-Thought (CoT) prompting has dramatically improved the reasoning capabilities of Large Language Models (LLMs), it remains fundamentally brittle. A single arithmetic slip, unstated assumption, or logical fallacy early in a multi-step derivation can silently propagate, leading to a confident but entirely incorrect conclusion.
Existing verification methods fall into two extreme camps:
- End-to-end verifiers or voting methods (like self-consistency): These only evaluate the final answer or require expensive multiple samples, offering no diagnostic granularity into why or where a reasoning chain failed.
- Formal theorem provers (e.g., Lean, Coq): These provide absolute mathematical rigor but demand expert-level syntax, extensive manual effort, and domain-specific formalization that fails to generalize to natural language constraints.
VeryTrace bridges this gap by treating reasoning traces as compilable programs, allowing step-level error localization and targeted repair while remaining domain-agnostic.
Methods
VeryTrace introduces a structured Generate-Verify-Repair loop powered by a lightweight, domain-agnostic Domain-Specific Language (DSL). The process unfolds in three main phases:
- Two-Stage DSL Conversion:
- Stage 1 (Context Extraction): A dedicated LLM reads only the user prompt to extract the problem context $\mathcal{K}$ (initial facts, assumptions, and invariant/goal constraints). Crucially, it does not see the generated reasoning trace, which prevents the model from hallucinating context to justify its own subsequent errors.
- Stage 2 (Trace Translation): A translation LLM takes the prompt, context, and natural-language CoT trace to produce a compilable DSL trace ($\mathcal{T}_{\text{DSL}}$).
-
The Typed Reasoning DSL: Reasoning is modeled as a sequence of state transitions. Steps are explicitly typed:
-
COMPUTE: Contains executable assignment expressions (e.g.,x = 2 * 15). ASSUME: Declares a premise directly from the static context.DEDUCE: Performs logical inference by instantiating standard deduction schemas (e.g., Modus Ponens, Transitivity, Conjunction).CONCLUDE: Declares the final conclusion.-
Hybrid Verification Pipeline: The verifier separates deterministic checks from semantic judgments:
-
Mechanical Checks: Validates structural integrity (detecting forward/circular references), executes math expressions in
COMPUTEsteps to verify state updates, and evaluates boolean constraint predicates. - Structured LLM Audits: For non-mechanizable semantic steps (
DEDUCEor natural-language constraints), a highly focused LLM audit checks if the claim logically follows from the specified premises.
If verification fails, VeryTrace generates localized, actionable error feedback (e.g., "Step 12's computation yields 42, but the state declares x = 35"), allowing the user LLM to iteratively repair only the problematic region.
Datasets
The authors evaluated VeryTrace across three distinct domains to stress-test different reasoning modalities:
- AIME 2025: 30 problems from the American Invitational Mathematics Examination, testing high-precision symbolic manipulation and arithmetic.
- LLM-BabyBench: A robotics planning benchmark where an agent must navigate a gridworld to a goal while respecting invariant constraints, testing long-horizon state tracking.
- CLUTRR: A benchmark focused on inferring kinship relations from natural-language stories, testing purely semantic relational reasoning.
Key Insights and Ideas
- Decoupling Context from Trace: Extracting the problem constraints before looking at the reasoning trace is a simple yet highly effective way to eliminate confirmation bias and prevent the model from ignoring prompt constraints.
- The "Verify Mechanically Wherever Possible" Principle: Full formalization is often impractical for natural language. By isolating quantitative state updates into executable
COMPUTEblocks, the framework offloads heavy lifting to a deterministic interpreter, reserving expensive and stochastic LLM calls only for soft semantic checks. - Hard Monitors for Soft Models: Even state-of-the-art reasoning-specialized models (like Qwen3-Next-80B-Thinking) benefit substantially from an external, rigid state-tracking monitor, proving that internal "thinking" steps can still benefit from externalized symbolic guardrails.
Key Results
VeryTrace consistently outperformed strong prompt-based verification baselines like Chain-of-Verification (CoVe) and Natural Program (NP) across multiple state-of-the-art open-weights models (Llama-3.3-70B-Instruct, Qwen3-80B-Instruct, and Qwen3-80B-Thinking).
- Mathematics (AIME 2025): It boosted the performance of the reasoning-specialized Qwen3-80B-Thinking model from an already strong 83.33% to 90.00%. For the standard Llama-3.3-70B-Instruct, accuracy jumped from 3.33% to 26.67%.
- Robotics Planning (LLM-BabyBench): VeryTrace maintained high success rates even as the planning horizon scaled up. For Qwen3-80B-Thinking, it achieved an overall success rate of 89.33% compared to the vanilla baseline of 60.33%.
Limitations and Future Work
- Verification Cost and Scalability: Because structural and constraint checks are performed per step, the number of verification calls scales linearly with the length of the reasoning trace. This can become computationally expensive and slow for long-horizon tasks or when multiple iterative repair loops are required.
- Stochasticity in Deductive Steps:
DEDUCEsteps still rely on black-box LLM audits for semantic transformations, which can introduce stochasticity into the verification outcomes. - DSL Expressiveness: The current library of structured inference schemas is intentionally small. The authors note that expanding this library to cover richer algebraic transformations, induction, and case analysis is a key direction for future work, alongside integrating stronger formal backends like SMT solvers or Lean.
Summary updated