arXiv:2503.01544cs.LGcs.AI2025-03NeurIPS被引 6

三种模型解复合推理题各有优劣,无绝对赢家。

Compositional Reasoning with Transformers, RNNs, and Chain of Thought

  • 用树状结构问题测试三种模型的表达能力
  • 每种模型需特定超参数随输入增长才能解题
  • 适合研究模型本质差异或架构设计的读者

众所周知,不同神经网络架构适用于不同任务,但是否存在某任务的最优架构?本文在一类称为组合推理问题(CRQ)的任务上比较了Transformer、RNN和带思维链(Chain of Thought)的Transformer的表达能力。这类问题具有树状组合结构,如布尔公式的求值。在标准复杂性假设下,我们证明:这三种架构均无法解决CRQ,除非对应超参数(深度、嵌入维度、思维链标记数)随输入规模增长。随后,我们为每种架构构造了解法:Transformer需对数深度;RNN在特定输入顺序下只需对数嵌入维度;带思维链的Transformer则需n个思维链标记应对大小为n的输入。结果表明,尽管CRQ本质困难,但不同架构可通过不同方式克服。单一问题类别下,各架构有各自优势,没有绝对优劣。

原文摘要 · Abstract (English)

It is well understood that different neural network architectures are suited to different tasks, but is there always a single best architecture for a given task? We compare the expressive power of transformers, RNNs, and transformers with chain of thought tokens on a simple and natural class of tasks we term Compositional Reasoning Questions (CRQ). This family captures multi-step problems with tree-like compositional structure, such as evaluating Boolean formulas. We prove that under standard hardness assumptions, \emph{none} of these three architectures is capable of solving CRQs unless some hyperparameter (depth, embedding dimension, and number of chain of thought tokens, respectively) grows with the size of the input. We then provide constructions for solving CRQs with each architecture. For transformers, our construction uses depth that is logarithmic in the problem size. For RNNs, logarithmic embedding dimension is necessary and sufficient, so long as the inputs are provided in a certain order. For transformers with chain of thought, our construction uses $n$ CoT tokens for input size $n$. These results show that, while CRQs are inherently hard, there are several different ways for language models to overcome this hardness. Even for a single class of problems, each architecture has strengths and weaknesses, and none is strictly better than the others.

组合推理TransformerRNN思维链

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。