Fovea Transformer:基于结构化由细到粗注意力的高效长上下文建模
Fovea Transformer: Efficient Long-Context Modeling with Structured Fine-to-Coarse Attention
AI总结:
本文提出Fovea Transformer,通过从输入序列构建多尺度树并以由细到粗的粒度表示上下文token,实现平滑的注意力粒度过渡,在保持计算效率的同时有效捕捉长上下文依赖,在多个长上下文摘要任务上取得领先性能。
摘要:
Transformer中自注意力的二次复杂度阻碍了长文本的处理。为缓解这一问题,先前工作提出对注意力矩阵进行稀疏化,利用一个关键观察:关于某个token的重要信息可以从其邻居中推导出来。这些方法通常结合某种形式的局部注意力和全局注意力。这种组合在从局部过渡到全局时会在上下文粒度上引入突变,这可能是不理想的。我们认为更平滑的过渡可能增强模型捕捉长上下文依赖的能力。在本研究中,我们提出Fovea Transformer,这是一种面向长上下文的Transformer,旨在解决在保持计算效率的同时捕捉全局依赖的挑战。为实现这一目标,我们从输入序列构建多尺度树,并使用树中上下文token的表示,随着其与查询token距离的增加,采用逐步变粗的粒度。我们在三个长上下文摘要任务上评估了我们的模型(代码公开于:https://github.com/ZiweiHe/Fovea-Transformer)。在其中两个任务上取得了最先进的性能,在第三个任务上取得了具有竞争力的结果,评估指标有混合的改进和回退。
英文摘要:
The quadratic complexity of self-attention in Transformers has hindered the processing of long text. To alleviate this problem, previous works have proposed to sparsify the attention matrix, taking advantage of the observation that crucial information about a token can be derived from its neighbors. These methods typically combine one or another form of local attention and global attention. Such combinations introduce abrupt changes in contextual granularity when going from local to global, which may be undesirable. We believe that a smoother transition could potentially enhance model's ability to capture long-context dependencies. In this study, we introduce Fovea Transformer, a long-context focused transformer that addresses the challenges of capturing global dependencies while maintaining computational efficiency. To achieve this, we construct a multi-scale tree from the input sequence, and use representations of context tokens with a progressively coarser granularity in the tree, as their distance to the query token increases. We evaluate our model on three long-context summarization tasks\footnote{Our code is publicly available at: \textit{https://github.com/ZiweiHe/Fovea-Transformer}}. It achieves state-of-the-art performance on two of them, and competitive results on the third with mixed improvement and setback of the evaluation metrics.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。