arXiv:2512.15115cs.LGcs.AI2025-12被引 1

统一解释注意力与状态空间模型,揭示头数与表达能力的关系

How Many Heads Make an SSM? A Unified Framework for Attention and State Space Models

  • 提出统一框架,用可变交互算子描述序列建模结构
  • 证明多头注意力需至少k个头才能表示k维状态空间模型
  • 揭示注意力梯度传播稳定,而状态空间模型梯度会随距离衰减

序列建模发展出多种架构——从经典循环网络到现代Transformer和状态空间模型(SSMs)——但对其表达能力与训练性权衡的统一理论理解仍有限。本文提出一个统一框架,通过输入依赖的有效交互算子 $W_{ij}(X)$ 表征广泛的序列映射,明确两类核心构造模式:(i) 统一因子化框架(显式),类似注意力混合,$W_{ij}(X)$ 通过共享值映射的标量系数变化;(ii) 结构化动态(隐式),$W_{ij}$ 由潜在动力系统诱导。基于此框架,我们得出三项理论结果:第一,建立交互秩差距,统一因子化模型如单头注意力受限于低维算子空间,无法表示某些结构化动态映射;第二,证明等价性(头数定理),在多头因子化类中,表示长度为 $n$ 的序列上拉格朗日算子张成 $k$-维子空间的线性SSM,需且仅需 $H=k$ 个头;第三,证明梯度高速通道结果,注意力层存在与距离无关的梯度路径,而稳定线性动态呈现距离相关的梯度衰减。这些结果形式化了代数表达能力(交互/算子跨度)与长程梯度传播之间的根本权衡,为现代序列架构设计提供理论依据。

原文摘要 · Abstract (English)

Sequence modeling has produced diverse architectures -- from classical recurrent neural networks to modern Transformers and state space models (SSMs) -- yet a unified theoretical understanding of expressivity and trainability trade-offs remains limited. We introduce a unified framework that represents a broad class of sequence maps via an input-dependent effective interaction operator $W_{ij}(X)$, making explicit two recurring construction patterns: (i) the Unified Factorized Framework (Explicit) (attention-style mixing), in which $W_{ij}(X)$ varies through scalar coefficients applied to shared value maps, and (ii) Structured Dynamics (Implicit) (state-space recurrences), in which $W_{ij}$ is induced by a latent dynamical system. Using this framework, we derive three theoretical results. First, we establish the Interaction Rank Gap: models in the Unified Factorized Framework, such as single-head attention, are constrained to a low-dimensional operator span and cannot represent certain structured dynamical maps. Second, we prove an Equivalence (Head-Count) Theorem showing that, within our multi-head factorized class, representing a linear SSM whose lag operators span a $k$-dimensional subspace on length-$n$ sequences requires and is achievable with $H=k$ heads. Third, we prove a Gradient Highway Result, showing that attention layers admit inputs with distance-independent gradient paths, whereas stable linear dynamics exhibit distance-dependent gradient attenuation. Together, these results formalize a fundamental trade-off between algebraic expressivity (interaction/operator span) and long-range gradient propagation, providing theoretical grounding for modern sequence architecture design.

序列建模注意力机制状态空间模型理论分析

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