{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/don-t-trust-verify-grounding-llm-quantitative","title":"Don't Trust: Verify -- Grounding LLM Quantitative Reasoning with Autoformalization","arxiv_id":"2403.18120","date":"2024-03-26","proceeding":null,"authors":["Jin Peng Zhou","Charles Staats","Wenda Li","Christian Szegedy","Kilian Q. Weinberger","Yuhuai Wu"],"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.","url_abs":"https://arxiv.org/abs/2403.18120v1","url_pdf":"https://arxiv.org/pdf/2403.18120v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"don-t-trust-verify-grounding-llm-quantitative","repo_url":"https://github.com/jinpz/dtv","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":null}],"tasks":[{"task_slug":"automated-theorem-proving","task_name":"Automated Theorem Proving"},{"task_slug":"gsm8k","task_name":"GSM8K"},{"task_slug":"math","task_name":"Math"}],"methods":[{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"cosine-annealing","method_name":"Cosine Annealing"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"discriminative-fine-tuning","method_name":"Discriminative Fine-Tuning"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"gpt","method_name":"GPT"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"linear-warmup-with-cosine-annealing","method_name":"Linear Warmup With Cosine Annealing"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"weight-decay","method_name":"Weight Decay"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2403.18120","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2403.18120"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"deterministic:regex_extraction","url":"https://github.com/jinpz/dtv","reach":null}],"summary":{"ran_draft_wrong":8,"ran":2,"unverified":2},"by_repo_kind":{"official":{"samples":12,"ran":10,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"205c76e81be50536","entry":"extract_boxed_content_and_indices","repo":"jinpz/dtv","repo_kind":"official","path":"formalize_proof.py","file_url":"https://github.com/jinpz/dtv/blob/HEAD/formalize_proof.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"205c76e81be50536"}},{"code_sha256_prefix":"bcde4757a2e7053d","entry":"get_all_combination","repo":"jinpz/dtv","repo_kind":"official","path":"formalize_proof.py","file_url":"https://github.com/jinpz/dtv/blob/HEAD/formalize_proof.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"bcde4757a2e7053d"}},{"code_sha256_prefix":"4beea7c5a27ee0bb","entry":"get_all_combination_custom","repo":"jinpz/dtv","repo_kind":"official","path":"formalize_statement.py","file_url":"https://github.com/jinpz/dtv/blob/HEAD/formalize_statement.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4beea7c5a27ee0bb"}},{"code_sha256_prefix":"dd67efd7d5b14425","entry":"get_category","repo":"jinpz/dtv","repo_kind":"official","path":"formalize_statement.py","file_url":"https://github.com/jinpz/dtv/blob/HEAD/formalize_statement.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"dd67efd7d5b14425"}},{"code_sha256_prefix":"d4fc3bd77d6ef327","entry":"get_formalize_proof_prompts","repo":"jinpz/dtv","repo_kind":"official","path":"formalize_proof.py","file_url":"https://github.com/jinpz/dtv/blob/HEAD/formalize_proof.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d4fc3bd77d6ef327"}},{"code_sha256_prefix":"5066c882ff4a78e3","entry":"get_prompt_template","repo":"jinpz/dtv","repo_kind":"official","path":"formalize_proof.py","file_url":"https://github.com/jinpz/dtv/blob/HEAD/formalize_proof.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5066c882ff4a78e3"}},{"code_sha256_prefix":"817a2de49240df8f","entry":"get_single_sample_formatted","repo":"jinpz/dtv","repo_kind":"official","path":"formalize_proof.py","file_url":"https://github.com/jinpz/dtv/blob/HEAD/formalize_proof.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"817a2de49240df8f"}},{"code_sha256_prefix":"9930a8f109c8e5a3","entry":"get_the_type","repo":"jinpz/dtv","repo_kind":"official","path":"formalize_proof.py","file_url":"https://github.com/jinpz/dtv/blob/HEAD/formalize_proof.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9930a8f109c8e5a3"}},{"code_sha256_prefix":"0fd61471e4ab26ac","entry":"load_formalize_data","repo":"jinpz/dtv","repo_kind":"official","path":"formalize_proof.py","file_url":"https://github.com/jinpz/dtv/blob/HEAD/formalize_proof.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0fd61471e4ab26ac"}},{"code_sha256_prefix":"1eee05718afec3bf","entry":"read_jsonl","repo":"jinpz/dtv","repo_kind":"official","path":"formalize_proof.py","file_url":"https://github.com/jinpz/dtv/blob/HEAD/formalize_proof.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1eee05718afec3bf"}},{"code_sha256_prefix":"cba887d03c3bfe57","entry":"get_all_samples_formatted","repo":"jinpz/dtv","repo_kind":"official","path":"formalize_proof.py","file_url":"https://github.com/jinpz/dtv/blob/HEAD/formalize_proof.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cba887d03c3bfe57"}},{"code_sha256_prefix":"687cc8760b503e9e","entry":"prepare_formalize_data","repo":"jinpz/dtv","repo_kind":"official","path":"formalize_proof.py","file_url":"https://github.com/jinpz/dtv/blob/HEAD/formalize_proof.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"687cc8760b503e9e"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}