Recent works show that hybrid architectures combining sliding window softmax attention layers with linear recurrent neural network (RNN) layers outperform both of these architectures taken separately. However, the impact of the window length and the interplay between softmax attention and linear RNN layers remain under-studied. In this work, we introduce SWAX, a hybrid architecture consisting of sliding-window attention and xLSTM linear RNN layers. A counter-intuitive finding with SWAX is that larger sliding windows do not improve the long-context performance. In fact, short window attention encourages the model to better train the long-term memory of the xLSTM, by relying less on the softmax attention mechanism for long context-retrieval. The issue with small sliding windows is that they are detrimental for short-context tasks, which could be solved with information from moderately larger sliding windows otherwise. Therefore, we train SWAX by stochastically changing the sliding window size, forcing the model to leverage both a longer context window and the xLSTM memory. SWAX trained with stochastic window sizes significantly outperforms regular window attention both on short and long-context problems.


翻译:近期研究表明,将滑动窗口softmax注意力层与线性循环神经网络(RNN)层相结合的混合架构,其性能优于单独使用这两种架构。然而,窗口长度的影响以及softmax注意力与线性RNN层之间的相互作用仍未得到充分研究。本文提出SWAX——一种由滑动窗口注意力和xLSTM线性RNN层构成的混合架构。SWAX的一个反直觉发现是:增大滑动窗口并不能提升长上下文性能。实际上,短窗口注意力通过减少对softmax注意力机制的长上下文检索依赖,促使模型更好地训练xLSTM的长时记忆能力。小滑动窗口的缺陷在于会损害短上下文任务性能,而中等尺寸的滑动窗口本可提供解决该问题的信息。为此,我们采用随机变化滑动窗口尺寸的方式训练SWAX,迫使模型同时利用更长上下文窗口和xLSTM记忆。经随机窗口尺寸训练的SWAX在短上下文与长上下文问题上均显著优于常规窗口注意力模型。

0
下载
关闭预览

相关内容

滑动窗口概念不仅存在于数据链路层,也存在于传输层,两者有不同的协议,但基本原理是相近的。其中一个重要区别是,一个是针对于帧的传送,另一个是字节数据的传送。
【KDD2024】面向课程图稀疏化的轻量级图神经网络搜索
专知会员服务
18+阅读 · 2024年6月25日
【WSDM2021】拓扑去噪的鲁棒图神经网络
专知会员服务
27+阅读 · 2020年11月14日
专知会员服务
24+阅读 · 2020年9月15日
AAAI 2022 | ProtGNN:自解释图神经网络
专知
10+阅读 · 2022年2月28日
【CVPR 2020 Oral】小样本类增量学习
专知
20+阅读 · 2020年6月26日
误差反向传播——CNN
统计学习与视觉计算组
30+阅读 · 2018年7月12日
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
8+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
VIP会员
相关VIP内容
【KDD2024】面向课程图稀疏化的轻量级图神经网络搜索
专知会员服务
18+阅读 · 2024年6月25日
【WSDM2021】拓扑去噪的鲁棒图神经网络
专知会员服务
27+阅读 · 2020年11月14日
专知会员服务
24+阅读 · 2020年9月15日
相关资讯
AAAI 2022 | ProtGNN:自解释图神经网络
专知
10+阅读 · 2022年2月28日
【CVPR 2020 Oral】小样本类增量学习
专知
20+阅读 · 2020年6月26日
误差反向传播——CNN
统计学习与视觉计算组
30+阅读 · 2018年7月12日
相关基金
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
8+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
Top
微信扫码咨询专知VIP会员