Arithmetic Reasoning with LLM: Prolog Generation & Permutation
Xiaocheng Yang, Bingsen Chen, Yik-Cheung Tam

TL;DR
This paper proposes using large language models to generate Prolog programs for arithmetic reasoning, reducing errors from chain-of-thought methods by leveraging symbolic formulas and predicate permutation for improved robustness.
Contribution
It introduces a novel approach of generating Prolog programs with LLMs for math problems and employs predicate permutation for data augmentation, enhancing accuracy over traditional chain-of-thought methods.
Findings
Prolog-based approach outperforms CoT in GSM8K benchmark.
Predicate permutation improves model robustness.
External code interpretation reduces calculation errors.
Abstract
Instructing large language models (LLMs) to solve elementary school math problems has shown great success using Chain of Thought (CoT). However, the CoT approach relies on an LLM to generate a sequence of arithmetic calculations which can be prone to cascaded calculation errors. We hypothesize that an LLM should focus on extracting predicates and generating symbolic formulas from the math problem description so that the underlying calculation can be done via an external code interpreter. We investigate using LLM to generate Prolog programs to solve mathematical questions. Experimental results show that our Prolog-based arithmetic problem-solving outperforms CoT generation in the GSM8K benchmark across three distinct LLMs. In addition, given the insensitive ordering of predicates and symbolic formulas in Prolog, we propose to permute the ground truth predicates for more robust LLM…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
Taxonomy
TopicsLogic, programming, and type systems · Natural Language Processing Techniques · Logic, Reasoning, and Knowledge
MethodsFocus
