跳到正文
arXiv cs.AI· Yanhong Li, Anej Svete, Ashish Sabharwal, William Merrill·· 3 天前AI 评分45

链式思维 Transformer 如何高效模拟 Word RAM 算法

Efficiently Representing Algorithms With Chain-of-Thought Transformers

AI 导读

一项 NeurIPS 2026 研究证明,链式思维(CoT)Transformer 能以仅 poly-logarithmic 开销高效模拟任意 Word RAM 算法,例如 $O(n \log n)$ 步排序或 Dijkstra 算法的 $O(E + V \log V)$ 步执行。

正文 · 原文

View PDF HTML (experimental)

Abstract:The increasing popularity of reasoning models -- language models that output a series of reasoning or thought tokens before producing an answer -- is justified, in part, by theoretical results showing that chain-of-thought (CoT) transformers can simulate Turing machines, and thus perform arbitrary computation. However, the Turing machine, while suitable for complexity-theoretic analysis, is not convenient, intuitive, or efficient for discussing algorithms. Algorithms are typically designed and analyzed at a higher level of abstraction, captured by the Word RAM model with random-access memory and unit-cost operations on $O(\log n)$-bit words. As a result, Word RAM algorithms can be substantially more efficient than their Turing machine counterparts, raising the question: Can CoT transformers efficiently simulate Word RAM algorithms? For instance, can they sort $n$ items in $O(n \log n)$ steps or run Dijkstra's algorithm in $O(E + V \log V)$ steps? We answer affirmatively for three types of transformers, up to poly-logarithmic overhead. We first establish this for fixed-precision transformers with poly-logarithmic width and rightmost unique hard attention, then strengthen the result to two more practical settings with fixed width and log-precision: continuous CoT, where reasoning takes the form of vectors rather than tokens, and a hybrid architecture in which transformer layers sit atop a recurrent (linear RNN) layer. In all three cases, we find that CoT can efficiently simulate any Word RAM algorithm with only a poly-logarithmic overhead in $n$. This overhead reduces to log-square when the Word RAM has a "flat" instruction set, and only logarithmic for multiplication-free flat instructions -- in stark contrast to known CoT simulations of Turing machines, which require quadratic overhead over Word RAM.
Comments: NeurIPS 2026 (camera-ready version)
Subjects: Machine Learning (cs.LG); Artificial Intelligence (cs.AI); Computation and Language (cs.CL)
Cite as: arXiv:2606.19697 [cs.LG]
  (or arXiv:2606.19697v2 [cs.LG] for this version)
  https://doi.org/10.48550/arXiv.2606.19697

arXiv-issued DOI via DataCite

Submission history

From: Yanhong Li [view email]
[v1] Thu, 18 Jun 2026 01:49:29 UTC (69 KB)
[v2] Wed, 2 Dec 2026 01:49:49 UTC (79 KB)

来源:arXiv cs.AI · arxiv.org