reasoning-machines/pal
A prompting technique where LLMs solve complex arithmetic and reasoning tasks by generating code that executes in a Python runtime.

PaL (Program-Aided Language Models) enables Large Language Models to handle reasoning problems involving arithmetic and procedural tasks by generating mixed text-and-code reasoning chains. The generated code is offloaded to a Python interpreter for execution, allowing the LLM to focus on reasoning while delegating computation. The repository provides an interactive implementation supporting both Codex and ChatGPT APIs, along with the GSM-Hard dataset for evaluation.