Skip to main content
QUICK REVIEW

[Paper Review] Don't Trust: Verify -- Grounding LLM Quantitative Reasoning with Autoformalization

Jin Zhou, Charles Staats|arXiv (Cornell University)|Mar 26, 2024
Artificial Intelligence in LawSocial Sciences3 citations
TL;DR

This paper proposes Don't Trust: Verify (DTV), a method that improves large language model (LLM) quantitative reasoning by autoformalizing informal math problems and solutions into Isabelle, then verifying them via automated theorem proving. DTV outperforms vanilla majority voting by over 12% on GSM8K and consistently improves accuracy across model sizes and datasets without additional training.

ABSTRACT

Large language models (LLM), such as Google's Minerva and OpenAI's GPT families, are becoming increasingly capable of solving mathematical quantitative reasoning problems. However, they still make unjustified logical and computational errors in their reasoning steps and answers. In this paper, we leverage the fact that if the training corpus of LLMs contained sufficiently many examples of formal mathematics (e.g. in Isabelle, a formal theorem proving environment), they can be prompted to translate i.e. autoformalize informal mathematical statements into formal Isabelle code -- which can be verified automatically for internal consistency. This provides a mechanism to automatically reject solutions whose formalized versions are inconsistent within themselves or with the formalized problem statement. We evaluate our method on GSM8K, MATH and MultiArith datasets and demonstrate that our approach provides a consistently better heuristic than vanilla majority voting -- the previously best method to identify correct answers, by more than 12% on GSM8K. In our experiments it improves results consistently across all datasets and LLM model sizes. The code can be found at https://github.com/jinpz/dtv.

Motivation & Objective

  • To address the persistent issue of LLMs making unjustified logical and computational errors in quantitative reasoning.
  • To develop a lightweight, training-free method to identify correct answers among multiple LLM-generated solutions.
  • To leverage autoformalization and automated theorem proving to verify solution consistency and correctness.
  • To improve upon vanilla majority voting, the prior state-of-the-art heuristic, by filtering only verifiable solutions.

Proposed method

  • Autoformalize informal math problems and solutions into Isabelle formal language using few-shot prompting with LLMs.
  • Apply symbolic and neural filters to improve the reliability of formal statement translation.
  • Generate formal solution sketches instead of direct translations to bridge gaps in low-level reasoning steps.
  • Use an automated theorem prover (ATP) to fill in missing steps and verify the formal proof.
  • Select the final answer via majority voting, but only over solutions that pass formal verification.
  • Evaluate the method on GSM8K, MATH (three subsets), and MultiArith, comparing against vanilla majority voting.
Figure 1: A pictorial illustration of Don’t Trust: Verify . Left : starting from an informal statement, an informal solution is generated by a large language model. The informal statement and solution are then translated into their formal counterparts. Multiple informal solutions for each problem ar
Figure 1: A pictorial illustration of Don’t Trust: Verify . Left : starting from an informal statement, an informal solution is generated by a large language model. The informal statement and solution are then translated into their formal counterparts. Multiple informal solutions for each problem ar

Experimental results

Research questions

  • RQ1Can autoformalization of LLM-generated solutions into formal logic improve the accuracy of quantitative reasoning?
  • RQ2Does formal verification via automated theorem proving reduce reliance on flawed majority voting in LLM reasoning?
  • RQ3Can the method consistently improve performance across different LLM sizes and reasoning datasets?
  • RQ4How effective is the combination of autoformalization and ATP in identifying correct answers among multiple candidate solutions?

Key findings

  • DTV improves performance by more than 12% on the GSM8K dataset compared to vanilla majority voting.
  • The method consistently improves accuracy across all evaluated LLM sizes, including 8B, 64B, and 540B parameter models.
  • DTV achieves state-of-the-art results on GSM8K, MATH (three subsets), and MultiArith without requiring model fine-tuning.
  • Case studies show that DTV successfully identifies correct answers and filters out incorrect or unjustified solutions.
  • The approach is complementary to existing prompting methods that operate solely in the informal reasoning domain.
  • Limitations include restricted support in formal theorem provers for domains like geometry and probability, and errors in autoformalization due to LLMs.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.