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

SCCA:用于长上下文语义扩展的移位跨块注意力

SCCA: Shifted Cross Chunk Attention for long contextual semantic expansion

Beihang University(北京航空航天大学)

Yuxiang Guo

AI总结:

针对现有稀疏注意力依赖窗口自注意力阻碍全局信息流动的问题,提出SCCA移位跨块注意力及SDA移位扩张注意力,结合PI与LoRA可高效扩展大模型上下文,支持即插即用微调且兼容现有技术。

摘要:

稀疏注意力作为一种高效方法可显著降低计算成本,但当前的稀疏注意力往往依赖窗口自注意力,这会阻碍全局信息流动。针对该问题,我们提出移位跨块注意力(Shifted Cross Chunk Attention,SCCA),采用不同的键值(KV)移位策略来扩展每个注意力层的各自感受野。此外,我们结合扩张注意力(Dilated Attention,DA)和扩张邻域注意力(Dilated Neighborhood Attention,DNA),提出了移位扩张注意力(Shifted Dilated Attention,SDA)。SCCA和SDA均可在多头注意力中累积注意力结果,以获得近似全注意力的各自感受野。本文中,我们使用不同的SCCA模式以及SCCA与SDA的组合开展了语言建模实验。所提出的移位跨块注意力(SCCA)结合位置插值(Positional interpolation,PI)和LoRA,能比现有稀疏注意力更有效地将大语言模型(large language models,LLMs)扩展到更长上下文。值得注意的是,SCCA可在单张V100上将LLaMA2 7B的上下文从4k扩展到8k。该注意力模式可提供一种即插即用的微调方法,在保留模型原有架构的同时扩展模型上下文,且与大多数现有技术兼容。

英文摘要:

Sparse attention as a efficient method can significantly decrease the computation cost, but current sparse attention tend to rely on window self attention which block the global information flow. For this problem, we present Shifted Cross Chunk Attention (SCCA), using different KV shifting strategy to extend respective field in each attention layer. Except, we combine Dilated Attention(DA) and Dilated Neighborhood Attention(DNA) to present Shifted Dilated Attention(SDA). Both SCCA and SDA can accumulate attention results in multi head attention to obtain approximate respective field in full attention. In this paper, we conduct language modeling experiments using different pattern of SCCA and combination of SCCA and SDA. The proposed shifted cross chunk attention (SCCA) can effectively extend large language models (LLMs) to longer context combined with Positional interpolation(PI) and LoRA than current sparse attention. Notably, SCCA adopts LLaMA2 7B from 4k context to 8k in single V100. This attention pattern can provide a Plug-and-play fine-tuning method to extend model context while retaining their original architectures, and is compatible with most existing techniques.

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

↑