arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2207.01844cs.LGcs.CV
收藏

基于自适应上下文池的高效表示学习

Efficient Representation Learning via Adaptive Context Pooling

Apple Inc.(苹果公司)

Chen Huang, Walter Talbott, Navdeep Jaitly, Josh Susskind

摘要:

自注意机制通过在所有输入标记之间使用成对注意来对长距离上下文进行建模。在这样做时,它们假设由各个令牌定义的固定注意力粒度(例如,文本字符或图像像素),这对于在更高级别上建模复杂的依赖性可能不是最佳的。在本文中,我们提出了ContextPool来解决这个问题,通过调整每个令牌的注意力粒度。受ConvNets与池化相结合以捕获长期依赖关系的成功的启发,我们学习在计算给定注意力层中的注意力之前,为每个令牌池化相邻特征。池化权重和支持大小是自适应确定的,允许池化特征以不同的尺度编码有意义的上下文。我们表明,ContextPool使注意力模型更具表现力,实现强大的性能往往与更少的层,从而显着降低成本。实验验证了我们的ContextPool模块,当插入到Transformer模型中时,在几种语言和图像基准上使用较少的计算,匹配或超越最先进的性能,优于最近的作品,学习上下文大小或稀疏注意力模式,并且也适用于ConvNets进行有效的特征学习。

英文摘要:

Self-attention mechanisms model long-range context by using pairwise attention between all input tokens. In doing so, they assume a fixed attention granularity defined by the individual tokens (e.g., text characters or image pixels), which may not be optimal for modeling complex dependencies at higher levels. In this paper, we propose ContextPool to address this problem by adapting the attention granularity for each token. Inspired by the success of ConvNets that are combined with pooling to capture long-range dependencies, we learn to pool neighboring features for each token before computing attention in a given attention layer. The pooling weights and support size are adaptively determined, allowing the pooled features to encode meaningful context with varying scale. We show that ContextPool makes attention models more expressive, achieving strong performance often with fewer layers and thus significantly reduced cost. Experiments validate that our ContextPool module, when plugged into transformer models, matches or surpasses state-of-the-art performance using less compute on several language and image benchmarks, outperforms recent works with learned context sizes or sparse attention patterns, and is also applicable to ConvNets for efficient feature learning.

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

↑