arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2310.07923cs.LGcs.CCcs.CLcs.LO
收藏

带思维链的Transformer的表达能力

The Expressive Power of Transformers with Chain of Thought

New York University(纽约大学);Allen Institute for AI(艾伦人工智能研究所)

William Merrill, Ashish Sabharwal

AI总结:

该研究从计算复杂性角度证明,思维链长度能从根本上提升仅解码器Transformer的推理能力,并给出不同步数下其能力对应的精确复杂性类刻画。

摘要:

近期的理论研究发现了一些极其简单的推理问题,例如判断图中两个节点是否连通、模拟有限状态机等,已被证明无法由读取输入后立即作答的标准Transformer解决。但在实际应用中,允许Transformer使用“思维链(chain of thought)”或“草稿板(scratchpad)”——即在回答前生成一系列中间token并基于这些中间token进行推理——能够提升其推理能力。受此启发,我们提出问题:这种中间生成机制是否能从根本上拓展仅解码器(decoder-only)Transformer的计算能力?我们证明答案是肯定的,但能力提升的幅度关键取决于中间生成的量。例如,我们发现,解码步数为(相对于输入长度)对数级的Transformer解码器,仅能略微突破标准Transformer的能力上限;而在采用投影预归一化(projected pre-norm,标准预归一化的轻微推广)的假设下,线性步数的解码步数能带来明确的新能力(在标准复杂性猜想下):可识别所有正则语言。我们的结果还表明,线性步数下Transformer解码器的能力仍限定在上下文有关语言范围内;而采用广义预归一化的多项式步数Transformer解码器,恰好能识别所有多项式时间可解问题——这是首次用标准复杂性类对一类Transformer的能力给出精确刻画。综上,本研究提供了一个精细的框架,用于理解Transformer的思维链或草稿板长度如何影响其推理能力。

英文摘要:

Recent theoretical work has identified surprisingly simple reasoning problems, such as checking if two nodes in a graph are connected or simulating finite-state machines, that are provably unsolvable by standard transformers that answer immediately after reading their input. However, in practice, transformers' reasoning can be improved by allowing them to use a "chain of thought" or "scratchpad", i.e., generate and condition on a sequence of intermediate tokens before answering. Motivated by this, we ask: Does such intermediate generation fundamentally extend the computational power of a decoder-only transformer? We show that the answer is yes, but the amount of increase depends crucially on the amount of intermediate generation. For instance, we find that transformer decoders with a logarithmic number of decoding steps (w.r.t. the input length) push the limits of standard transformers only slightly, while a linear number of decoding steps, assuming projected pre-norm (a slight generalization of standard pre-norm), adds a clear new ability (under standard complexity conjectures): recognizing all regular languages. Our results also imply that linear steps keep transformer decoders within context-sensitive languages, and polynomial steps with generalized pre-norm make them recognize exactly the class of polynomial-time solvable problems -- the first exact characterization of a type of transformers in terms of standard complexity classes. Together, this provides a nuanced framework for understanding how the length of a transformer's chain of thought or scratchpad impacts its reasoning power.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑