Transformers have improved the state-of-the-art across numerous tasks in sequence modeling. Besides the quadratic computational and memory complexity w.r.t the sequence length, the self-attention mechanism only processes information at the same scale, i.e., all attention heads are in the same resolution, resulting in the limited power of the Transformer. To remedy this, we propose a novel and efficient structure named Adaptive Multi-Resolution Attention (AdaMRA for short), which scales linearly to sequence length in terms of time and space. Specifically, we leverage a multi-resolution multi-head attention mechanism, enabling attention heads to capture long-range contextual information in a coarse-to-fine fashion. Moreover, to capture the potential relations between query representation and clues of different attention granularities, we leave the decision of which resolution of attention to use to query, which further improves the model's capacity compared to vanilla Transformer. In an effort to reduce complexity, we adopt kernel attention without degrading the performance. Extensive experiments on several benchmarks demonstrate the effectiveness and efficiency of our model by achieving a state-of-the-art performance-efficiency-memory trade-off. To facilitate AdaMRA utilization by the scientific community, the code implementation will be made publicly available.
翻译:变异器改进了在序列建模方面众多任务中的最新技术。除了四重计算和记忆复杂程度的序列长度外,自留机制只以同一规模处理信息,即所有关注负责人都在同一分辨率中,导致变异器的能力有限。为了纠正这一点,我们建议建立一个创新和有效的结构,名为适应多分辨率关注(简称AdaMRA),以线性尺度衡量时间和空间的顺序长度。具体地说,我们利用一个多分辨率多头关注机制,使关注负责人能够以粗略到直线的方式获取远程背景信息。此外,为了捕捉查询代表与不同关注粒子线索之间的潜在关系,我们留意将注意力的分辨率留给查询,从而进一步提高模型与香草变异器相比的能力。为了降低复杂性,我们在不贬低业绩的情况下采取核心关注。关于若干基准的广泛实验展示了我们模型的实效和效率,通过实现状态化、可应用的科学效率标准,实现社区高效使用。