Chain of Thought Empowers Transformers to Solve Inherently Serial Problems

📄 arXiv: 2402.12875v4 📥 PDF

作者: Zhiyuan Li, Hong Liu, Denny Zhou, Tengyu Ma

分类: cs.LG, cs.CC, stat.ML

发布日期: 2024-02-20 (更新: 2024-09-21)

备注: 38 pages, 10 figures. Accepted by ICLR 2024


💡 一句话要点

提出链式思维以增强变换器解决串行问题的能力

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 链式思维 变换器 符号推理 串行计算 深度学习 模型表达能力 自然语言处理

📋 核心要点

  1. 现有方法在处理固有串行计算时表现不足,尤其是在低深度变换器中,缺乏有效的计算能力。
  2. 论文提出通过链式思维(CoT)来增强变换器的表达能力,使其能够执行串行计算,从而提升模型的性能。
  3. 实验结果表明,启用CoT后,变换器在处理复杂任务(如置换群的组合、迭代平方和电路值问题)时准确性显著提高。

📝 摘要(中文)

本研究提出了一种通过生成中间步骤序列(链式思维,CoT)来提升大型语言模型(LLMs)在算术和符号推理任务中的准确性的方法。然而,CoT的机制尚不明确。本文从表达能力的角度为解码器变换器提供了CoT的理论理解。CoT使模型具备执行固有串行计算的能力,而这一能力在低深度变换器中尤其缺乏。研究表明,使用CoT后,常量深度的变换器能够解决布尔电路大小为T的问题,显著提高了在并行计算困难的任务上的准确性。

🔬 方法详解

问题定义:本文旨在解决低深度变换器在处理固有串行计算问题时的表达能力不足,现有方法在此类任务上表现不佳。

核心思路:通过引入链式思维(CoT),模型能够生成中间步骤,从而增强其在串行计算任务中的能力,克服传统变换器的局限性。

技术框架:整体架构包括输入处理、链式思维生成和最终输出三个主要模块。输入经过变换器处理后,生成一系列中间步骤,最后输出结果。

关键创新:最重要的创新在于提出了CoT的理论框架,证明了在使用CoT后,常量深度变换器能够解决布尔电路大小为T的问题,这一结果超越了传统方法的表达能力。

关键设计:在参数设置上,使用常量位精度和O(log n)的嵌入大小,确保变换器在执行串行计算时的有效性。

📊 实验亮点

实验结果显示,启用链式思维后,变换器在处理置换群组合、迭代平方和电路值问题等任务时,准确性显著提高,尤其是在低深度变换器中,表现出明显的性能提升。

🎯 应用场景

该研究的潜在应用领域包括自然语言处理、符号推理和复杂计算任务等。通过提升变换器在串行计算中的表现,未来可在更广泛的AI应用中实现更高的准确性和效率,尤其是在需要逐步推理的场景中。

📄 摘要(原文)

Instructing the model to generate a sequence of intermediate steps, a.k.a., a chain of thought (CoT), is a highly effective method to improve the accuracy of large language models (LLMs) on arithmetics and symbolic reasoning tasks. However, the mechanism behind CoT remains unclear. This work provides a theoretical understanding of the power of CoT for decoder-only transformers through the lens of expressiveness. Conceptually, CoT empowers the model with the ability to perform inherently serial computation, which is otherwise lacking in transformers, especially when depth is low. Given input length $n$, previous works have shown that constant-depth transformers with finite precision $\mathsf{poly}(n)$ embedding size can only solve problems in $\mathsf{TC}^0$ without CoT. We first show an even tighter expressiveness upper bound for constant-depth transformers with constant-bit precision, which can only solve problems in $\mathsf{AC}^0$, a proper subset of $ \mathsf{TC}^0$. However, with $T$ steps of CoT, constant-depth transformers using constant-bit precision and $O(\log n)$ embedding size can solve any problem solvable by boolean circuits of size $T$. Empirically, enabling CoT dramatically improves the accuracy for tasks that are hard for parallel computation, including the composition of permutation groups, iterated squaring, and circuit value problems, especially for low-depth transformers.