用思维链实现树结构的深度优先与最短路径搜索,首次在有限步内完成复杂度计算。
Chain-of-Thought Shows the Path to a Tree: Realizing Branching Complexity
- 通过两层硬注意力解码器实现深度优先与Dijkstra算法
- 2n-1步计算n个节点树的斯特拉勒数,n-1步求宽度
- 适用于任意多叉树,无需位置编码或层归一化,适合理论研究者
思维链(CoT)突破了有界深度Transformer的表达能力上限,其步骤数与电路复杂度类存在关联。然而,具体可执行的构造及遍历过程仍不明确。本文填补了分支复杂性领域的空白:给出深度优先搜索(DFS)和迪杰斯特拉算法的CoT实现,均采用最多两层的硬注意力解码器,并作为通用计算基底。复用DFS解码器可在2n-1步内计算出含n个顶点的树的斯特拉勒数,使用四层;复用迪杰斯特拉解码器可在n-1步内求得其宽度,仅需三层。由于将二叉树的斯特拉勒数计算问题归为NC¹-完全,且该方法适用于任意n元树,无需层归一化或位置编码,这构成了对思维链线性步长层级的非平凡验证。借助有序树与迪克路径之间的经典双射关系,我们利用DFS构造实现了路径的逐点生成,并在路径表示上独立构造了两种度量的计算方法。
原文摘要 · Abstract (English)
Chain of Thought (CoT) lifts the expressive ceiling of bounded-depth Transformers, with characterizations tying the number of CoT steps to circuit complexity classes. What remains largely missing are concrete instantiations with explicit, depth-bounded constructions, and the traversal procedures such characterizations presuppose. We close this gap for branching complexity. We give CoT realizations of depth-first search (DFS) and of Dijkstra algorithm, the latter subsuming breadth-first search, by unique hard-attention decoders of at most two layers, and use them as a shared computational substrate: reusing the DFS decoder yields the Strahler number of an $n$-vertex tree in $2n-1$ steps with four layers, and reusing the Dijkstra decoder yields its width in $n-1$ steps with three. Since computing the Strahler number of a binary tree given as a term is \textsf{NC\textsuperscript{1}}-complete, and our constructions handle arbitrary $n$-ary trees without layer normalization or positional encodings, this is a non-trivial witness for the linear-step regime of the CoT hierarchy. Exploiting the classical bijection between ordered trees and Dyck paths, itself realized by our DFS construction, which emits the path as it traverses, we give independent constructions for both measures on the path representation.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。