arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2311.11091cs.LGcs.AIcs.CVquant-ph
收藏

Deep Tensor Network(深度张量网络)

Deep Tensor Network

Yifan Zhang

AI总结:

针对Transformer注意力二次复杂度瓶颈,提出Deep Tensor Network框架,通过张量代数重构注意力,推出张量注意力与张量交互算子,实现O(d²)复杂度的流式因果计算,兼具效率与表达力,为下一代序列模型提供新构建模块。

摘要:

Transformer中逐点积注意力的二次复杂度仍是阻碍基础模型向无限上下文长度发展的核心瓶颈。针对这一挑战,我们提出Deep Tensor Network(深度张量网络),这一全新架构框架将张量代数的表达能力与神经网络设计相融合,从根本上重构了注意力机制。我们的方法超越了传统逐点积注意力及后续的线性时间近似方法,能够捕捉高阶统计依赖关系。基于该框架,我们提出两个核心算子:Tensor Attention(张量注意力),通过数据依赖的多项式核建模复杂的令牌混合;以及Tensor Interaction(张量交互),一种实现自适应通道混合的全新机制。我们证明这些算子由二阶摘要量驱动,完全无需构造n×n矩阵,可实现保留因果性的流式执行,每令牌更新复杂度为O(d²),状态复杂度为O(d²)。该效率可与现代State Space Models(状态空间模型)相媲美,同时保留了类注意力的公式形式。Deep Tensor Network为下一代序列模型提供了一类兼具理论性与强大性能的全新构建模块,填补了可扩展计算与丰富高表达交互建模之间的空白。

英文摘要:

The Deep Tensor Network is a family of sequence operators built from contractions of queries, keys, and values. Tensor Attention mixes tokens through the Gram operators $Q(K^\top K)Q^\top$ and $K(Q^\top Q)K^\top$; Tensor Interaction mixes channels through operators derived from $C=Q^\top K$. Associativity lets us evaluate these products exactly without forming $n\times n$ token matrices. For query/key width $d$ and value width $d_v$, the Gram constructions use $O(d^2+dd_v)$ work and summary state per causal token, or $O(d^2)$ when $d_v=O(d)$. We derive prefix recurrences and distinguish trace, diagonal, and row normalization, including the conditions under which the weights are nonnegative and row-stochastic. The unmasked token operators are positive semidefinite with rank at most $d$, but their entries can be negative. We also give exact evaluations and costs for Hadamard and matrix-exponential variants.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑