arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2305.15408cs.LGcs.CCcs.CLstat.ML

揭示思维链背后的奥秘:一个理论视角

Towards Revealing the Mystery behind Chain of Thought: A Theoretical Perspective

Peking University(北京大学);Pazhou Lab(琶洲实验室)

Guhao Feng, Bohang Zhang, Yuntian Gu, Haotian Ye, Di He, Liwei Wang

AI总结:

本文从理论角度揭示思维链机制,证明有界深度Transformer无法直接解决算术问题,但恒定大小自回归Transformer可通过生成CoT推导解决,并扩展到动态规划,实验验证了其有效性。

摘要:

近期研究发现,思维链提示(Chain-of-Thought prompting, CoT)能够显著提升大型语言模型(LLMs)的性能,尤其是在涉及数学或推理的复杂任务中。尽管取得了巨大的实证成功,但CoT背后的潜在机制以及它如何释放LLMs的潜力仍然难以捉摸。在本文中,我们迈出了理论上回答这些问题的第一步。具体而言,我们考察了带有CoT的LLMs在解决基础数学和决策问题时的表达能力。通过使用电路复杂性理论,我们首先给出了不可能性结果,表明有界深度Transformer无法直接为基本算术/方程任务产生正确答案,除非模型大小相对于输入长度呈超多项式增长。相反,我们随后通过构造证明,恒定大小的自回归Transformer足以通过使用一种常用的数学语言格式生成CoT推导来解决这两个任务。此外,我们展示了带有CoT的LLMs能够处理一类广泛的决策问题,即动态规划,从而证明了其在解决复杂现实世界任务中的能力。最后,大量实验表明,虽然Transformer总是无法直接预测答案,但在给定足够的CoT示例的情况下,它们能够一致地学习逐步生成正确的解决方案。

英文摘要:

Recent studies have discovered that Chain-of-Thought prompting (CoT) can dramatically improve the performance of Large Language Models (LLMs), particularly when dealing with complex tasks involving mathematics or reasoning. Despite the enormous empirical success, the underlying mechanisms behind CoT and how it unlocks the potential of LLMs remain elusive. In this paper, we take a first step towards theoretically answering these questions. Specifically, we examine the expressivity of LLMs with CoT in solving fundamental mathematical and decision-making problems. By using circuit complexity theory, we first give impossibility results showing that bounded-depth Transformers are unable to directly produce correct answers for basic arithmetic/equation tasks unless the model size grows super-polynomially with respect to the input length. In contrast, we then prove by construction that autoregressive Transformers of constant size suffice to solve both tasks by generating CoT derivations using a commonly used math language format. Moreover, we show LLMs with CoT can handle a general class of decision-making problems known as Dynamic Programming, thus justifying its power in tackling complex real-world tasks. Finally, an extensive set of experiments show that, while Transformers always fail to directly predict the answers, they can consistently learn to generate correct solutions step-by-step given sufficient CoT demonstrations.

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

↑