arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2401.04881cs.CL
收藏

Attendre:在基于记忆的 Transformer 中通过检索被驱逐查询进行等待以处理长上下文

Attendre: Wait To Attend By Retrieval With Evicted Queries in Memory-Based Transformers for Long Context Processing

Google Research(谷歌研究院)

Zi Yang, Nan Hua

AI总结:

本文提出 Attendre 层,通过 LRA 和 LFA 驱逐策略减少记忆占用并适应多种架构,利用查询记忆中被驱逐查询检索键值记忆,实现等待注意力机制,在 TriviaQA 任务中验证了长上下文处理的有效性。

摘要:

随着 LLM 能够处理更复杂的输入类型,研究人员近期开始研究如何高效且低成本地处理可能任意长的序列。一种有效方法是使用 FIFO 记忆来存储过去块的注意力子层的键和值,从而允许后续查询进行注意力计算。然而,该方法需要大容量记忆,且依赖于特定的 LM 架构。此外,由于先前上下文中的键值与当前查询之间的因果性,该方法无法扩展到双向注意力机制,如 encoder-decoder 或 PrefixLM decoder-only 架构。本文提出使用 LRA 和 LFA 等驱逐策略来减少记忆大小并适应多种架构,同时提出 Attendre 层,这是一种等待注意力机制,通过在查询记忆(Q memory)中检索被驱逐查询来访问键值记忆(K/V memory)。作为初步验证,我们在上下文长度扩展设置下使用 TriviaQA 阅读理解任务评估该方法,并证明了其有效性。

英文摘要:

As LLMs have become capable of processing more complex types of inputs, researchers have recently studied how to efficiently and affordably process possibly arbitrarily long sequences. One effective approach is to use a FIFO memory to store keys and values of an attention sublayer from past chunks to allow subsequent queries to attend. However, this approach requires a large memory and/or takes into the consideration the specific LM architecture. Moreover, due to the causal nature between the key-values in prior context and the queries at present, this approach cannot be extended to bidirectional attention such as in an encoder-decoder or PrefixLM decoder-only architecture. In this paper, we propose to use eviction policies, such as LRA and LFA, to reduce the memory size and adapt to various architectures, and we also propose the Attendre layer, a wait-to-attend mechanism by retrieving the key-value memory (K/V memory) with evicted queries in the query memory (Q memory). As a first step, we evaluate this method in the context length extension setup using the TriviaQA reading comprehension task, and show the effectiveness of the approach.

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

↑