arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2412.13328cs.CLcs.LG
收藏

扩展跨度:在混合状态空间模型中结合衰减记忆与检索

Expansion Span: Combining Fading Memory and Retrieval in Hybrid State Space Models

AWS AI Labs(AWS人工智能实验室)

Elvis Nunez, Luca Zancato, Benjamin Bowman, Aditya Golatkar, Wei Xia, Stefano Soatto

AI总结:

提出扩展跨度机制,通过保留注意力上下文检索遥远标记,扩展混合状态空间模型的记忆跨度,并引入HyLoRA微调方法,实现高效长序列适应。

摘要:

状态空间模型(SSM)的“状态”代表其记忆,这种记忆在无限跨度上呈指数衰减。相比之下,基于注意力的模型在有限跨度(上下文大小)内具有“逼真”(即逐字或照相式)记忆。混合架构将状态空间层与注意力相结合,但仍然无法回忆遥远的过去,并且只能以逼真方式访问最近的标记。与当前结合SSM和注意力层的方法不同,我们允许基于相关性而非新颖性来分配状态。这样,对于每一组新的查询标记,我们的模型可以“逼真”地访问超出当前混合SSM注意力跨度的标记,而无需额外的硬件资源。我们提出了一种方法,通过“保留”一部分注意力上下文用于从任意遥远的过去检索的标记,来扩展混合状态的记忆跨度,从而扩展整体状态的逼真记忆跨度。我们将这部分保留的标记称为“扩展跨度”,并将检索和聚合它们的机制称为“跨度扩展注意力”(SE-Attn)。为了使混合模型适应使用SE-Attn,我们提出了一种新颖的微调方法,将LoRA扩展到混合模型(HyLoRA),并允许在长标记跨度上进行高效适应。我们表明,SE-Attn使我们能够高效地适应预训练的混合模型,处理比预训练时使用的序列长8倍的标记序列。我们表明,在具有长程依赖的自然语言基准(如PG-19、RULER和其他常见自然语言下游任务)上,将HyLoRA与SE-Attn应用于混合模型时,比LongLoRA等替代方案更便宜且性能更高。

英文摘要:

The "state" of State Space Models (SSMs) represents their memory, which fades exponentially over an unbounded span. By contrast, Attention-based models have "eidetic" (i.e., verbatim, or photographic) memory over a finite span (context size). Hybrid architectures combine State Space layers with Attention, but still cannot recall the distant past and can access only the most recent tokens eidetically. Unlike current methods of combining SSM and Attention layers, we allow the state to be allocated based on relevancy rather than recency. In this way, for every new set of query tokens, our models can "eidetically" access tokens from beyond the Attention span of current Hybrid SSMs without requiring extra hardware resources. We introduce a method to expand the memory span of the hybrid state by "reserving" a fraction of the Attention context for tokens retrieved from arbitrarily distant in the past, thus expanding the eidetic memory span of the overall state. We call this reserved fraction of tokens the "expansion span," and the mechanism to retrieve and aggregate it "Span-Expanded Attention" (SE-Attn). To adapt Hybrid models to using SE-Attn, we propose a novel fine-tuning method that extends LoRA to Hybrid models (HyLoRA) and allows efficient adaptation on long spans of tokens. We show that SE-Attn enables us to efficiently adapt pre-trained Hybrid models on sequences of tokens up to 8 times longer than the ones used for pre-training. We show that HyLoRA with SE-Attn is cheaper and more performant than alternatives like LongLoRA when applied to Hybrid models on natural language benchmarks with long-range dependencies, such as PG-19, RULER, and other common natural language downstream tasks.

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

↑