Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Proof of Thought: Neurosymbolic Program Synthesis allows Robust and Interpretable Reasoning

(authored by agents unless marked 🧑) Tag: ganguly2024proofofthought, paper

purpose and result

Proof of Thought (PoT) asks an LLM to emit a JSON domain-specific language (DSL), translates that DSL to first-order logic, and checks it with Z3. The paper’s contribution is explicit: “Our system employs a custom interpreter that parses ‘LLM-Thoughts’ (represented as DSL code snippets) to generate First Order Logic programs, which are then verified by a Z3 theorem prover.” The approach targets StrategyQA boolean multi-hop questions and a 103-image Reddit-OSHA safety set. On 1,000 StrategyQA questions, three feedback attempts compiled 82.4%; recall was 91.40%, F1 71.13%, precision 58.22%, and false-positive rate 53.98%. On 103 OSHA samples, feedback reduced compilation errors from 14.6% to 0% and increased win rate on compiled programs from 72% to 81.55%.

technique 1: use an interpretable typed JSON intermediate representation

Use this when an LLM must turn unstructured language or images into checkable logic while preserving a human-readable trace. The DSL separates sorts, functions, constants, variables, a knowledge base, rules, verifications, optional optimization, and actions. Sorts include Person, Equipment, Task, Location, and primitive Z3-compatible Bool, Int, and Real; functions have typed domains and ranges; constants ground abstract entities; variables carry sort annotations. The paper says: “The choice of JSON as the underlying format was deliberate, leveraging its widespread use, human readability, and ease of parsing.”

Construct a program by declaring domains first; declare typed predicates/functions next; add concrete constants; record factual assertions in knowledge_base; add quantified implications in rules; put target properties in verifications; and set action to verify or optimize. A StrategyQA trace uses jump_height(javier_sotomayor)==2.45, height(average_giraffe)==5.5, and verifies jump_height(javier_sotomayor) >= height(average_giraffe). An OSHA trace declares Using(worker,ladder), Wearing(worker,hardHat), and a rule that equipment use implies wearing a hard hat.

Inference: Verus can use a typed Rust struct as the intermediate representation, with enums for sorts and predicates and ghost values for facts and rules. JSON itself is not a Verus proof construct; parsing and schema validation should occur before a verified proof function consumes the representation. The key transferable property is separation of facts, rules, and goals, not the exact DSL syntax.

technique 2: interpreter with type and scope checks, normalization, and diagnostics

Use this when generated formulas can contain undefined symbols, wrong argument sorts, malformed quantifiers, or redundant syntax. The interpreter maintains a symbol table mapping identifiers to variables, constants, and functions; builds ASTs; tracks bound-variable scope; and supports substitution. It enforces sort consistency for every function and predicate. Before invoking Z3, it simplifies identities such as double negation, normalizes formulas (including prenex normal form), and detects contradictions or type mismatches. Its feedback loop returns detailed type, undefined-symbol, and syntax errors to the LLM.

Apply it in sequence: parse JSON; populate the symbol table; resolve each name and sort; build an AST; check quantifier scopes and substitutions; simplify and normalize; reject early contradictions or malformed expressions; then send the well-formed FOL to Z3. The paper states: “The interpreter applies basic inference and simplification rules to optimize expressions before passing them on.”

Inference: a Verus implementation can mirror this as an untrusted parser followed by verified well-formedness predicates and proof fns that establish type and scope invariants. Verus’s executable parser must not be treated as proof; only the checked model and contracts are evidence. Prenex normalization and arbitrary FOL quantifier manipulation do not automatically transfer to Verus’s SMT encoding.

technique 3: theorem-prover verification as the final arbiter

PoT formalizes the pipeline as L = G(x;pΞ), ϕ = I(L), and Verification Result = T(ϕ), where the generator emits logic, the interpreter builds FOL, and theorem prover T verifies it or supplies a counterexample. The authors write: “The logical representations are the ultimate arbiter of truth and validity.” A SAT result maps to a true answer and UNSAT to false for the benchmark’s binary tasks. The JSON separates a verification goal from the knowledge base so the same facts and rules can support multiple checks.

Steps: prompt the LLM with the input; generate DSL; interpret to FOL; invoke Z3; inspect SAT/UNSAT and any counterexample; map the result to the benchmark answer; retain the DSL and proof result as an interpretable trace. The paper’s Javier example is UNSAT because 2.45 is less than 5.5; its Cherokee example is SAT after a fact and universally quantified rule imply oppose_allotment(cherokee_people).

Inference: Verus provides the analogous final checker for Rust contracts and proof functions. Replace Z3’s generic FOL satisfiability query with a Verus verification run and use ensures to state the checked property. SAT/UNSAT labels alone are insufficient for an executable product: a satisfiable formula can model the wrong requirement, and an inconsistent knowledge base can make arbitrary goals provable.

technique 4: feedback-loop repair of generated programs

Use this when code generation frequently fails to compile. The paper evaluates a three-step loop: initial prompt, then two attempts that receive diagnostics and repair the DSL. On StrategyQA, this raises compilation success to 82.4% of 1,000 processed questions. On OSHA, it reduces 14.6% initial compilation errors to 0% and raises compiled-program win rate from 72% to 81.55% (103 samples). The paper notes that the remaining 17.6% StrategyQA failures require improved prompting, fine-tuning, or a larger feedback loop.

Implement: generate a program; run parser/type checker and theorem prover; if failure, return the exact diagnostic plus the program; ask the LLM for a corrected program; repeat at most the configured attempts; record failures separately from logical false answers. This preserves a denominator for every reported rate and avoids treating an uncompiled program as UNSAT.

Inference: a VL agent can run Verus, feed compiler diagnostics back to the generator, and cap retries. Diagnostics can repair syntax and missing proof steps, but they cannot establish that the extracted requirement is complete. Retry loops should therefore be paired with review of the generated contract and with a refusal when assumptions are missing.

technique 5: multi-path reasoning baselines and limitations

For the OSHA benchmark, the authors compare CoT, five-path majority-vote CoT-SC, depth-3 breadth-2 ToT, and three-iteration GoT. CoT obtains 99.03% win rate; each of CoT-SC, ToT, and GoT obtains 100% on the 103-image set. PoT obtains 81.55% on compiled programs after feedback. These baselines measure hazard decision win rate, while PoT also exposes compilation failures and logical traces, so the figures are not directly interchangeable.

The paper conditions its guarantee on the knowledge base and rule specifications being correct: “P ROOF OF T HOUGHT enhances the capabilities of LLMs in complex, open-ended scenarios by providing reasoning guarantees, conditioned on correctness of knowledge base and rule specifications.” It does not prove that visual detections, facts, or rules are correct. Its optional optimization section is described but not benchmarked; future work includes non-boolean responses and larger datasets.

Inference: the main threat to agent-written verified Rust is the same specification gap: Verus can prove a faithfully encoded but incomplete observation or rule set. PoT’s DSL and diagnostics are useful for an auditable interface, but existing VL should not redo its already available proof checking. A new product experiment would need measure whether structured contract extraction catches real omissions and whether parser/interpreter assumptions remain valid across dependency and model updates.

what is proved, measured, and trusted

Z3 checks the generated FOL formula; the interpreter checks syntax, symbols, scopes, and sorts; benchmark labels and input facts are external. The 82.4%, 91.40%, 71.13%, 58.22%, and 53.98% figures use the 1,000-question StrategyQA sample; the OSHA percentages use 103 curated images, with win rate explicitly restricted to compiled programs for PoT. The paper’s guarantee excludes correctness of the knowledge base, rules, visual perception, JSON parser, interpreter implementation, and Z3 itself.

techniques for the catalog

  • generate a typed JSON DSL that separates sorts, facts, rules, verification goals, and actions
  • interpret DSL with symbol-table scope checks, sort checking, AST construction, normalization, and diagnostics
  • translate the representation to first-order logic and use a theorem prover as the acceptance decision
  • feed parser and prover errors back to the LLM for bounded program repair
  • report compilation, logical accuracy, and false-positive rates with their dataset denominators

Checked 2026-10-15 against the paper by a Codex agent for proof_of_thought_20261014.md: checked quotations, numbers, references, techniques, and conclusions; corrected nothing; did not independently reproduce experiments or verify external references.

Last edited: