让混合模型突破记忆限制,远距离内容也能精准调用。
Expansion Span: Combining Fading Memory and Retrieval in Hybrid State Space Models
- 按相关性分配状态内存,而非仅凭新旧顺序
- 扩展注意力跨度至预训练长度8倍,支持长序列建模
- 无需额外硬件,适合处理长依赖自然语言任务
状态空间模型(SSMs)的记忆随时间指数衰减,而基于注意力的模型仅在有限上下文内具备精确记忆。现有混合架构虽结合两者,仍无法召回遥远过去的内容,且仅能即时访问最近令牌。本文提出一种新机制:将注意力上下文的一部分预留用于检索任意遥远历史中的相关令牌,称为“扩展跨度”;通过“跨度扩展注意力”(SE-Attn)实现高效检索与聚合。为适配该机制,提出改进版LoRA方法(HyLoRA),可对长序列高效微调。实验表明,结合SE-Attn与HyLoRA的模型可在长达预训练长度8倍的序列上有效微调,在PG-19、RULER等需长程依赖的任务中表现优于LongLoRA等方法,且成本更低、性能更优。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。