arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.00754cs.CLcs.LG
收藏

随机注意力:受连接组启发的随机路由用于表达性线性时间注意力

Stochastic Attention: Connectome-Inspired Randomized Routing for Expressive Linear-Time Attention

Tsinghua University(清华大学)

Zehao Jin, Yanan Sui

AI总结:

本文提出Stochastic Attention,通过随机排列token序列提升注意力机制的表达性,实现更高效的全局通信,在预训练和推理任务中均优于传统方法。

摘要:

果蝇全脑连接组包含超过13万神经元,连接概率仅为0.02%,但平均最短路径仅为4.4跳。尽管在电路层面高度结构化,长距离连接在不同脑区广泛分布,作为随机捷径促进高效全局通信。受此启发,我们提出Stochastic Attention (SA),一种可直接替换滑动窗口注意力(SWA)的增强方法,通过在窗口注意力前对token序列进行随机排列并恢复原始顺序,将固定局部窗口转换为随机全局窗口。在相同O(nw)每层预算下,通过深度独立采样排列,获得指数增长的接受场,实现O(log_w n)层覆盖,优于SWA的O(n/w)。我们在两个设置中验证SA:从头预训练语言模型,其中门控SA+SWA组合达到最佳零样本准确率;以及在Qwen3-8B和Qwen3-30B-A3B上无训练推理,其中SA在计算预算内优于SWA并匹配或超越混合块注意力。这些结果表明,受连接组启发的随机路由是提升高效注意力表达性的实用原始方法,补充了现有线性和稀疏方法。

英文摘要:

The whole-brain connectome of a fruit fly comprises over 130K neurons connected with a probability of merely 0.02%, yet achieves an average shortest path of only 4.4 hops. Despite being highly structured at the circuit level, the network's long-range connections are broadly distributed across brain regions, functioning as stochastic shortcuts that enable efficient global communication. Inspired by this observation, we propose Stochastic Attention (SA), a drop-in enhancement for sliding-window attention (SWA) that applies a random permutation to the token sequence before windowed attention and restores the original order afterward. This transforms the fixed local window into a stochastic global one within the same $O(nw)$ per-layer budget. Through depth, independently sampled permutations yield exponentially growing receptive fields, achieving full sequence coverage in $O(\log_w n)$ layers versus $O(n/w)$ for SWA. We validate SA in two settings: pre-training language models from scratch, where a gated SA + SWA combination achieves the best average zero-shot accuracy, and training-free inference on Qwen3-8B and Qwen3-30B-A3B, where SA consistently outperforms SWA and matches or exceeds Mixture of Block Attention at comparable compute budgets. These results suggest that connectome-inspired stochastic routing is a practical primitive for improving the expressivity of efficient attention, complementary to existing linear and sparse approaches.

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

↑