Don't Trust: Verify -- Grounding LLM Quantitative Reasoning with Autoformalization

Jin Peng Zhou, Charles Staats, Wenda Li, Christian Szegedy, Kilian Q. Weinberger +1 more
3/26/2024
cs.AIcs.CLcs.LG

Official code: jinpz/dtv (37 stars, MIT, last commit 2025-03-09).

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.

View on arXivView PDF

Code Implementations(1)

jinpz/dtvOfficial100%
MIT

The official code release for Don't Trust: Verify -- Grounding LLM Quantitative Reasoning with Autoformalization

379PythonMar 10, 20241 years agoMIT

Similar Papers

Cite this paper

@article{zhou2024dont,
  title  = {Don't Trust: Verify -- Grounding LLM Quantitative Reasoning with Autoformalization},
  author = {Jin Peng Zhou and Charles Staats and Wenda Li and Christian Szegedy and Kilian Q. Weinberger and Yuhuai Wu},
  year   = {2024},
  eprint = {2403.18120},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2403.18120v1},
  journal = {ICLR 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2403.18120.svg)](https://codeofpaper.com/paper/2403.18120)

Discussion