Skip to main content
QUICK REVIEW

[论文解读] Learning to Reason and Memorize with Self-Notes

Jack Lanchantin, Shubham Toshniwal|arXiv (Cornell University)|May 1, 2023
Topic ModelingComputer Science被引用 3
一句话总结

本文提出 Self-Notes 方法,使大型语言模型在自回归推理过程中能够生成交错的内部推理标记,从而增强多步推理与工作记忆能力。通过允许模型在阅读输入的任意时刻写出显式的中间事实或状态更新,Self-Notes 在七个多样化的推理与状态追踪任务中均优于思维链(chain-of-thought)和草稿板(scratchpad)基线方法,展现出在准确率与推理效率方面的持续提升。

ABSTRACT

Large language models have been shown to struggle with multi-step reasoning, and do not retain previous reasoning steps for future use. We propose a simple method for solving both of these problems by allowing the model to take Self-Notes. Unlike recent chain-of-thought or scratchpad approaches, the model can deviate from the input context at any time to explicitly think and write down its thoughts. This allows the model to perform reasoning on the fly as it reads the context and even integrate previous reasoning steps, thus enhancing its memory with useful information and enabling multi-step reasoning. Experiments across a wide variety of tasks demonstrate that our method can outperform chain-of-thought and scratchpad methods by taking Self-Notes that interleave the input text.

研究动机与目标

  • 为解决大型语言模型在推理过程中执行多步推理及保留中间状态的局限性。
  • 克服标准 Transformer 模型中计算预算固定且缺乏显式工作记忆的问题。
  • 使模型不仅在上下文处理之后,更在处理过程中生成中间推理步骤与状态更新。
  • 探究交错生成的自我笔记如何提升复杂任务中的推理准确率与记忆保持能力。
  • 在多种学习范式下评估 Self-Notes:监督学习、半监督学习、无监督学习以及 few-shot 提示。

提出的方法

  • 在自回归生成过程中,允许模型在输入上下文内部交错生成 'Self-Note' 标记——这些标记使用与输入标记相同的词表。
  • 当模型预测来自预定义起始标记集合 $N_{\text{sta}}$ 的标记时,触发 Self-Note 的生成。
  • 这些笔记可编码推断出的事实(例如:'箱子在公园')或更新的状态变量(例如:'x = 6')。
  • 模型将这些笔记整合到其推理流程中,用于未来的推理或状态追踪。
  • 该方法在四种学习范式下进行训练与评估:监督学习、半监督学习、无监督学习以及 few-shot 提示。
  • 在推理阶段,模型根据其内部概率分布动态决定何时生成笔记。
Figure 1 : [top] Vanilla language models directly generate the answer (A) given the context and the question (Q). [middle] Scratchpad and Chain-of-Thought methods encourage the model to generate reasoning tokens before answering the question, but only after it has read the entire context. [bottom] S
Figure 1 : [top] Vanilla language models directly generate the answer (A) given the context and the question (Q). [middle] Scratchpad and Chain-of-Thought methods encourage the model to generate reasoning tokens before answering the question, but only after it has read the entire context. [bottom] S

实验结果

研究问题

  • RQ1与在提示末尾使用思维链或草稿板的方法相比,交错生成的自我笔记是否能提升多步任务中的推理性能?
  • RQ2Self-Notes 是否可作为有效的工作记忆形式,用于追踪动态环境中状态的变化?
  • RQ3Self-Notes 在不同学习范式下的表现如何,包括 few-shot 和无监督设置?
  • RQ4Self-Notes 是否能减少在序列推理任务中对完整上下文重新阅读或重新推理的需求?
  • RQ5Self-Notes 在需要事实整合与状态更新的任务中,能在多大程度上提升记忆保持与推理效率?

主要发现

  • Self-Notes 在全部七个评估任务中均优于普通语言模型以及思维链/草稿板基线方法,涵盖数学应用题、程序评估与国际象棋推理等任务。
  • 在 GSM8K 与 MultiArith 数学基准测试中,Self-Notes 的准确率高于思维链提示,展现出更优的多步推理能力。
  • 在合成程序评估任务中,Self-Notes 显著提升了状态追踪准确率,使模型能够在处理过程中存储并更新变量状态。
  • 该方法在所有四种学习范式——监督学习、半监督学习、无监督学习与 few-shot——中均取得一致性能提升,表明其具有广泛适用性。
  • 能够在阅读上下文的同时交错生成推理过程,减少了对重复处理的需求,从而实现更高效、更准确的推理。
  • 在玩具故事与国际象棋任务中,Self-Notes 使模型能够整合事实并跨时间步追踪实体状态,得出基线方法无法达到的正确结论。
(a) Toy-Story
(a) Toy-Story

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。