Skip to main content
QUICK REVIEW

[论文解读] Leave No Context Behind: Efficient Infinite Context Transformers with Infini-attention

Tsendsuren Munkhdalai, Manaal Faruqui|arXiv (Cornell University)|Apr 10, 2024
Advanced Image and Video Retrieval TechniquesComputer Science被引用 15
一句话总结

Introduces Infini-attention, a memory-augmented attention mechanism that enables Transformer LLMs to process infinitely long inputs with bounded memory and compute, demonstrated on long-context benchmarks and ultra-long tasks.

ABSTRACT

This work introduces an efficient method to scale Transformer-based Large Language Models (LLMs) to infinitely long inputs with bounded memory and computation. A key component in our proposed approach is a new attention technique dubbed Infini-attention. The Infini-attention incorporates a compressive memory into the vanilla attention mechanism and builds in both masked local attention and long-term linear attention mechanisms in a single Transformer block. We demonstrate the effectiveness of our approach on long-context language modeling benchmarks, 1M sequence length passkey context block retrieval and 500K length book summarization tasks with 1B and 8B LLMs. Our approach introduces minimal bounded memory parameters and enables fast streaming inference for LLMs.

研究动机与目标

  • 为 Transformer 大语言模型在受限资源下的可扩展长上下文处理提供动机。
  • 提出 Infini-attention,在注意力中注入压缩记忆以保留长期上下文。
  • 展示以最小架构改动实现即插即用的持续预训练与长上下文自适应。
  • 在超长语言建模和长上下文任务(长度高达 1M)以及书籍摘要上证明效力。

提出的方法

  • 引入 Infini-attention,将局部因果注意力与长期压缩记忆相结合。
  • 重用点积注意力中的 Q、K、V 状态来构建联合记忆 M 与归一化项 z。
  • 使用联合绑定规则更新记忆,并提供可选的 delta 精化以稳定训练。
  • 通过逐头学习的门控标量汇聚局部与记忆源的上下文以形成输出。
  • 为每个头和每层提供恒定的内存占用,支持无限上下文的流式推理。
  • 在内存效率和上下文长度方面将 Infini-transformers 与 Transformer-XL 与 Memorizing Transformers 进行比较。

实验结果

研究问题

  • RQ1Infini-attention 能否在有界内存和计算下支持无限长度的上下文窗口?
  • RQ2与现有基于分段的记忆模型相比,Infini-attention 在长上下文语言建模中的表现如何?
  • RQ3在扩展到极长输入时,内存效率的权衡和训练动态是什么?
  • RQ4通过持续预训练进行长上下文自适应,Infini-transformers 是否能够维持或提升困惑度及下游任务表现。

主要发现

  • 在 PG19 和 Arxiv-math 上,Infini-attention 相对于 Transformer-XL 和 Memorizing Transformers 在困惑度方面表现更好,且具备 114x 的记忆压缩优势。
  • 一个 1B 模型在 Infini-attention 下,在对 5K 长输入进行微调后解决了 1M 长度的 passkey 检索。
  • 一个 8B 模型在持续预训练和任务微调后,在 500K 长度的 BookSum 上达到新的 SOTA。
  • 门控分析揭示了专门化头(局部与记忆检索)以及平衡长程与短程信息的混合头。
  • Infini-transformers 使 KV 绑定、z 和固定的每头记忆达到常量内存,从而实现无限上下文,超越基线。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。