[论文解读] Teaching Algorithmic Reasoning via In-context Learning
本文提出 Algorithmic Prompting,通过就地学习教导大语言模型进行算法推理,在四则运算(加法、减法、乘法)和奇偶性任务上取得显著提升,并具有强大的分布外泛化能力。
Large language models (LLMs) have shown increasing in-context learning capabilities through scaling up model and data size. Despite this progress, LLMs are still unable to solve algorithmic reasoning problems. While providing a rationale with the final answer has led to further improvements in multi-step reasoning problems, Anil et al. 2022 showed that even simple algorithmic reasoning tasks such as parity are far from solved. In this work, we identify and study four key stages for successfully teaching algorithmic reasoning to LLMs: (1) formulating algorithms as skills, (2) teaching multiple skills simultaneously (skill accumulation), (3) teaching how to combine skills (skill composition) and (4) teaching how to use skills as tools. We show that it is possible to teach algorithmic reasoning to LLMs via in-context learning, which we refer to as algorithmic prompting. We evaluate our approach on a variety of arithmetic and quantitative reasoning tasks, and demonstrate significant boosts in performance over existing prompting techniques. In particular, for long parity, addition, multiplication and subtraction, we achieve an error reduction of approximately 10x, 9x, 5x and 2x respectively compared to the best available baselines.
研究动机与目标
- 通过就地学习为 LLMs 教授算法技能,识别四个阶段。
- 表明详细、明确的算法提示能在算术任务上实现鲁棒的分布外泛化。
- 通过同时教授多种算法来展示技能积累。
- 探索技能组合以及在更广泛的数学推理任务中将所学算法作为工具使用。
提出的方法
- 定义四个学习阶段:将算法作为技能来教授、技能积累、技能组合,以及将技能用作工具。
- 提出 Algorithmic Prompting,在提示中提供详细的算法执行步骤和显式解释。
- 在多项算术任务上将算法提示与 few-shot、chain-of-thought 和仅指令基线进行比较。
- 通过测试比提示中更长的答案长度来评估长度泛化和分布外(OOD)性能。
- 进行消融研究以评估明确计算、自然语言描述和提示歧义对性能的影响。
- 研究多算法学习(加法和减法)和组合(多数字相加、乘法即为加法)。
- 研究在 GSM8k 和 GSM8k-Hard 中将所学算法作为工具的用法,包括二次推理和对话式工具使用方法。
实验结果
研究问题
- RQ1LLMs 是否能通过上下文提示学习算法,使其泛化到提示中未见过的更长的问题实例?
- RQ2提供明确、无歧义的算法步骤是否在算术任务上优于传统提示策略(few-shot、chain-of-thought、scratchpad)?
- RQ3同时教授多种算法并将它们组合成更复杂任务的影响是什么?
- RQ4所学算法是否能在更广泛的数学推理任务中作为工具使用而不损害一般推理?
主要发现
| 任务 | 算法提示 (%) | 最佳可用基线 (%) |
|---|---|---|
| 加法 | 90.5 | 9.5 |
| 减法 | 65.6 | 16.7 |
| 乘法 | 79.7 | 5.5 |
| 奇偶性 | 95.0 | 50.0 |
- Algorithmic Prompting 在长加法问题上实现近乎完美的准确率和强的长度(OOD)泛化,显著优于基线。
- 对于加法、减法、乘法和奇偶性,算法提示分别比最佳基线的错误率降低约10倍、9倍、5倍和2倍。
- 消融研究显示明确且不含歧义的解释至关重要,当算法步骤中的错误提示系统性错误时,性能会显著下降。
- 模型可在单个提示中学习多种算法(技能积累),并能将它们组合解决复合任务,性能超过基线。
- 将学习的算法用作工具可提高数学应用题的表现,尽管可能影响一般推理;二次推理和对话式工具使用可缓解部分问题。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。