[논문 리뷰] PAL: Program-aided Language Models
PaL는 대형 언어 모델을 사용하여 중간 추론 단계로 자연어와 Python 코드를 서로 교차 생성한 다음 해결을 Python 인터프리터에 위임하여 최종 답을 도출합니다. 이는 13개의 수학, 기호, 알고리즘 문제에 대해 몇-shot에서 최첨단 정확도를 달성하며, 종종 체인-오브-생각 prompting보다 더 큰 모델을 능가합니다.
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/ .
연구 동기 및 목표
- 문제 분해와 해법 실행을 분리하여 LLM을 통한 견고한 추론을 촉진한다.
- 추론으로 실행 가능한 코드를 생성하는 것이 다양한 벤치마크에서 체인 오브 생각(CoT)보다 정확도를 향상시킨다는 것을 입증한다.
- PaL이 gsm8k에서 최첨단의 few-shot 성능을 제공하고 기호/알고리즘 작업에서 경쟁력 있는 이득을 보여준다.
제안 방법
- LLM은 중간 추론으로 자연어와 프로그래밍 언어 단계가 교차되게 생성한다( t = NL ∪ PL ).
- 최종 해답은 생성된 코드를 Python 인터프리터에서 실행하여 산출된다; LLM은 프롬프트 내에서 최종 해답을 직접 출력하지 않는다.
- 프롬프트는 의미 있는 변수 이름과 선택적 NL 주석으로 구성된다; 필요 시 실행 결과를 피드백할 수 있으며(실험에서는 사후 실행이 사용됨).
- 실험은 Direct prompt, chain-of-thought prompting, PaL을 수학, 기호, 알고리즘 과제 전반에 걸쳐 비교하며 기본 LLM으로 Codex를 사용한다.
- 평가에는 고정 프롬프트 few-shot 설정이 포함되며 gsm8k의 경우 정확도 향상을 위한 다수결 샘플링(k>1)도 포함된다.
실험 결과
연구 질문
- RQ1프로그램이 생성한 추론 단계가 외부 인터프리터와 결합되어 수학, 기호, 알고리즘 과제 전반에서 체인-오브-생각(CoT) 프롬프트를 능가할 수 있는가?
- RQ2PaL이 대수의 숫자 산술 및 다양한 벤치마크에서 프롬프트 변형(변수 이름, NL 주석)에 대한 강건성에 대해 어떻게 수행하는가?
- RQ3PaL의 이점이 코드 생성 프롬프트, 인터프리터 또는 이 둘의 결합 때문인가?
- RQ4gsm8k와 같은 표준 벤치마크에서 체인-오-생각으로 학습된 더 큰 LLM과 PaL은 어떻게 비교되는가?
주요 결과
| 과제 | Direct (Codex) | CoT (UL2-20B) | CoT (LaMDA-137B) | CoT (Codex) | CoT (PaLM-540b) | CoT (Minerva 540B) | PaL (Codex) |
|---|---|---|---|---|---|---|---|
| gsm8k | 19.7 | 4.1 | 17.1 | 65.6 | 56.9 | 58.8 | 72.0 |
| gsm-hard | 5.0 | - | - | 23.1 | - | - | 61.2 |
| svamp | 69.9 | 12.6 | 39.9 | 74.8 | 79.0 | - | 79.4 |
| asdiv | 74.0 | 16.9 | 49.0 | 76.9 | 73.9 | - | 79.6 |
| singleeq | 86.8 | - | - | 89.1 | 92.3 | - | 96.1 |
| singleop | 93.1 | - | - | 91.9 | 94.1 | - | 94.6 |
| addsub | 90.9 | - | - | 86.0 | 91.9 | - | 92.5 |
| multiarith | 44.0 | 10.7 | 51.8 | 95.9 | 94.7 | - | 99.2 |
- PaL with Codex achieves state-of-the-art few-shot accuracy on gsm8k, outperforming larger models that use chain-of-thought by a notable margin.
- On gsm-hard (large numbers), PaL remains robust while direct and CoT prompts degrade significantly.
- Across symbolic reasoning and algorithmic tasks from BIG-Bench Hard, PaL substantially outperforms CoT and closes gaps to solving tasks with high accuracy (e.g., colored objects, penguins, dates, object counting, repeated copy).
- PaL improvements persist across weaker base LMs and with LMs primarily trained for natural language if they have adequate code modeling ability.
- Ablations show meaningful variable names and NL comments contribute to PaL’s effectiveness; removing them reduces performance.
더 나은 연구,지금 바로 시작하세요
연구 설계부터 논문 작성까지, 연구 시간을 획기적으로 줄여보세요.
카드 등록 없음 · 무료 플랜 제공
이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.