Skip to main content
QUICK REVIEW

[论文解读] Show Your Work: Scratchpads for Intermediate Computation with Language Models

Maxwell Nye, Anders Andreassen|arXiv (Cornell University)|Nov 30, 2021
Topic Modeling被引用 130
一句话总结

本文表明,加入中间计算步骤的草稿板(scratchpad)使变换器能够比直接预测更有效地执行复杂的多步计算(如长加法、多项式求值和 Python 程序执行),并且对更大输入具有更好的泛化能力。

ABSTRACT

Large pre-trained language models perform remarkably well on tasks that can be done "in one pass", such as generating realistic text or synthesizing computer programs. However, they struggle with tasks that require unbounded multi-step computation, such as adding integers or executing programs. Surprisingly, we find that these same models are able to perform complex multi-step computations -- even in the few-shot regime -- when asked to perform the operation "step by step", showing the results of intermediate computations. In particular, we train transformers to perform multi-step computations by asking them to emit intermediate computation steps into a "scratchpad". On a series of increasingly complex tasks ranging from long addition to the execution of arbitrary programs, we show that scratchpads dramatically improve the ability of language models to perform multi-step computations.

研究动机与目标

  • 通过输出中间步骤(scratchpads)来激发并使大型语言模型能够执行无限制的多步计算。
  • 证明草稿板在长整数相加、多项式求值和 Python 程序执行任务上的表现有所提升。
  • 表明草稿板在不改变模型体系结构的前提下,提供自适应计算时间和可追踪的中间状态。
  • 探索数据增强和多源追踪数据以扩大草稿板效益。

提出的方法

  • 将 scratchpad 引入为一个中间文本缓冲区,模型在其中输出逐步的计算结果。
  • 使用有监督学习训练仅解码器的 Transformer 模型,使其能够预测输入/输出以及 scratchpad 内容。
  • 将 scratchpad 应用于:(i) 按位逐步的长整数相加,(ii) 多项式求值,(iii) 通过跟踪执行轨迹来执行 Python 程序。
  • 在少样本和微调阶段,将基于 scratchpad 的执行与直接执行预测进行比较。
  • 使用从 2M 到 137B 参数的各种模型规模以及标准的训练设定。

实验结果

研究问题

  • RQ1草稿板是否能够使 Transformer 在多步算法任务上比直接单步预测更准确?
  • RQ2输出中间计算追踪是否提高在如长加法和多项式求值等任务中的分布外泛化?
  • RQ3草稿板追踪是否能提高在给定输入上预测 Python 程序执行的准确性?
  • RQ4草稿板在模型规模和数据阶段(少样本与微调)下的性能如何随之扩展?

主要发现

  • 草稿板在 Transformer 的多步计算方面显著提升,包括加法、多项式求值和程序执行任务。
  • 使用草稿板训练的模型比不使用草稿板训练的模型在更大输入规模上的泛化能力更强。
  • 基于草稿板的执行在多项式求值方面同时提升少样本和微调的性能。
  • 基于追踪的执行(预测程序轨迹)在给定充足的训练数据时,相较于直接执行,显著提升 Python 程序执行的预测。
  • 数据增强和多源追踪数据(Single-line、CodeNet)进一步提升草稿板的性能,使轨迹准确率更高、解决的任务更多。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。