pal  by reasoning-machines

Program-aided language model for reasoning tasks

created 2 years ago
502 stars

Top 62.8% on sourcepulse

GitHubView on GitHub
Project Summary

PaL (Program-Aided Language Models) enables large language models to solve complex reasoning tasks involving arithmetic and procedural logic by generating text and code. This approach offloads code execution to a Python interpreter, enhancing accuracy for tasks that benefit from programmatic computation. The project is primarily aimed at researchers and developers working with LLMs for complex problem-solving.

How It Works

PaL integrates LLMs with a Python runtime. The LLM generates a reasoning chain, which includes executable Python code. This code is then executed by a Python interpreter, and the results are fed back to the LLM or used to derive the final answer. This program-aided approach allows LLMs to leverage the precision and computational power of code for tasks like complex arithmetic, overcoming inherent limitations in direct text-based reasoning.

Quick Start & Requirements

  • Install via pip: pip install -e ./pal after cloning the repository.
  • Requires an OpenAI API key set as an environment variable: export OPENAI_API_KEY='sk-...'.
  • Supports models like code-davinci-002 and ChatGPT APIs (gpt-3.5-turbo).
  • Official documentation and example scripts are available in the repository.

Highlighted Details

  • Supports interactive implementation via ProgramInterface.
  • Includes scripts for evaluating performance on datasets like GSM8k and Date Understanding.
  • Offers a beta script (gsm_chatgpt.py) for math reasoning using ChatGPT APIs.
  • Released a harder version of GSM8k called GSM-hard, available on Huggingface.

Maintenance & Community

The project is associated with the paper "PAL: Program-aided Language Models" (ICML 2023). Further community interaction details are not explicitly provided in the README.

Licensing & Compatibility

The repository does not explicitly state a license. Users should verify licensing for commercial use or integration into closed-source projects.

Limitations & Caveats

The project relies on the OpenAI API, and its functionality is tied to the availability and pricing of these services. The README mentions a transition from Codex API to ChatGPT APIs, indicating potential shifts in underlying model support.

Health Check
Last commit

2 years ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
0
Star History
12 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.