arXiv:2602.07599cs.LG2026-02

让Transformer学会处理复杂序列逻辑,突破传统模型的长度泛化瓶颈。

Rational Transductors

  • 双流架构融合WFA的矩阵递归,通过深度有理注入增强注意力机制。
  • 可精确建模正则语言与NC¹难问题,实现稳定长序列推理,无需链式思维。
  • 理论严谨且保持并行效率,适合算法类任务与需要强逻辑推理场景。

标准Transformer在语义建模上表现优异,但在刚性序列逻辑和状态追踪上表现不佳。理论研究表明,自注意力机制在硬注意力下仅能表达$\ ext{AC}^0$,在软注意力下最多为$\ ext{TC}^0$,这些复杂度类通常无法支持无中间链式思维的鲁棒长度泛化。本文提出 extit{Rational Transductors},一种双流架构,通过从加权有限自动机(WFA)导出的矩阵值递归,增强Transformer。通过 extit{Deep Rational Injection}方案将有理状态信息注入注意力机制,该框架严格扩展了Transformer的表达能力,可捕捉所有正则语言、$ ext{NC}^1$-完全问题(如布尔公式求值),以及奇偶性和模计数等基本分离问题,同时保持$O(L + \log T)$的并行时间复杂度。我们从学习理论角度证明: extit{Random Rational Features}构成序列依赖的通用基,解释初始化策略;而 extit{Differentiable Rational Feature}是弥补表示紧凑性差距的必要条件。理论分析与实证结果表明,Rational Transductors解决了“正则差距”问题,在标准Transformer失效的算法任务中实现稳健的长度泛化,且避免传统RNN的串行计算瓶颈。

原文摘要 · Abstract (English)

Standard Transformers excel at semantic modeling but struggle with rigid sequential logic and state tracking. Theoretical work establishes that self-attention is limited to $\AC^0$ (under hard attention) or $\TC^0$ (under soft attention), complexity classes that often fail to support robust length generalization on sequential problems without intermediate chain-of-thought. In this work, we introduce \emph{Rational Transductors}, a dual-stream architecture that augments the Transformer with a matrix-valued recurrence derived from Weighted Finite Automata (WFA). By injecting rational state information into the attention mechanism via a \emph{Deep Rational Injection} scheme, our framework strictly generalizes the expressive power of Transformers to capture all Regular Languages, $\NC^1$-complete problems (such as Boolean Formula Evaluation), and fundamental separations like Parity and Modular Counting, while preserving $O(L + \log T)$ parallel time complexity. We ground the architecture in a rigorous learning theory: we prove that \emph{Random Rational Features} act as a universal basis for sequential dependencies, justifying our initialization strategy, while establishing that the \emph{Differentiable Rational Feature} regime is necessary to close the representational compactness gap. Theoretical analysis and empirical results demonstrate that Rational Transductors solve the "Regular Gap," enabling robust length generalization on algorithmic tasks where standard Transformers fail, without the sequential computational bottlenecks of traditional RNNs.

Transformer序列建模有理注入逻辑推理

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