HackerPapers

arXiv:2211.10435cs.CL

PAL: Program-aided Language Models

Luyu Gao, Aman Madaan, Shuyan Zhou, Uri Alon, Pengfei Liu, Yiming Yang, Jamie Callan, Graham Neubig

Abstract

Large language models (LLMs) have recently demonstrated an impressive ability to perform arithmetic and symbolic reasoning tasks, when provided with a few examples at test time ("few-shot prompting"). Much of this success can be attributed to prompting methods such as "chain-of-thought'', which employ LLMs for both understanding the problem description by decomposing it into steps, as well as solving each step of the problem. While LLMs seem to be adept at this sort of step-by-step decomposition, LLMs often make logical and arithmetic mistakes in the solution part, even when the problem is decomposed correctly. In this paper, we present Program-Aided Language models (PAL): a novel approach that uses the LLM to read natural language problems and generate programs as the intermediate reasoning steps, but offloads the solution step to a runtime such as a Python interpreter. With PAL, decomposing the natural language problem into runnable steps remains the only learning task for the LLM, while solving is delegated to the interpreter. We demonstrate this synergy between a neural LLM and a symbolic interpreter across 13 mathematical, symbolic, and algorithmic reasoning tasks from BIG-Bench Hard and other benchmarks. In all these natural language reasoning tasks, generating code using an LLM and reasoning using a Python interpreter leads to more accurate results than much larger models. For example, PAL using Codex achieves state-of-the-art few-shot accuracy on the GSM8K benchmark of math word problems, surpassing PaLM-540B which uses chain-of-thought by absolute 15% top-1. Our code and data are publicly available at http://reasonwithpal.com/ .

arXiv comments
The first three authors contributed equally. Our code and data are publicly available at http://reasonwithpal.com/
Journal reference
DOI
Subjects
cs.CLComputation and Language cs.AIArtificial Intelligence

On Hacker News

Linked by 3 identifiable commenters in 3 comments across 3 threads, from Jan 2023 to Nov 2025. Found in 2 HN submissions from Jan 2023 to Apr 2023. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments3 threads

    • And even before this work, there was "PAL: Program-aided Language Models" (https://arxiv.org/abs/2211.10435, https://reasonwithpal.com/). Afaik PaLM (Google's OG big models) tried this trick, but it didn't work for them. I think it's because PaL used descriptive inline comments…

      axiom92View on HNParent context

    • Here you go, here's a bunch of papers that you have not read. If you had read them then you would know that the errors are predictable and therefore there are many measurable ways to make improvements. Toolformer: Language Models Can Teach Themselves to Use Tools…

      williamcottonView on HNParent context

    • I was surprised to see the omission of a prompt technique called program-aided prompting. Paper: https://arxiv.org/abs/2211.10435 GitHub: https://github.com/reasoning-machines/pal tl;dr -- LLMs are bad at basic arithmetic and logic (as their opening examples with math word…

      gandalfgeekView on HNParent context

Submitted to Hacker News

  • Show HN: Guesstimate – Generate a spreadsheet-like interface for any question

    Hey HN, I built something to estimate things: https://guesstimate.ai Unlike ChatGPT, Guesstimate can do calculations. I asked both to calculate the time it'd take an object to fall from the ISS to sea level (about 400km, assume no air resistance). ChatGPT, using a lot of words, did everything correctly right until the last step [1]. Guesstimate took a similar approach, but it got the right answer: https://guesstimate.ai/e/est114xrhnj1f6h9cm44 I think it's absurd that we're trying to teach LLMs…

  • Program Aided Language Models

Connected through shared HN threads, not inferred similarity or a recommendation.