按年被提到
20232023 · 6 次2026
大模型与语言模型›长上下文与测试时计算·arXiv:2309.17453 · cs.CL

Efficient Streaming Language Models with Attention Sinks

带注意力汇聚点的高效流式语言模型
Guangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han, Mike Lewis · 2023

保留初始 token 的 KV 作为注意力汇聚点,让 LLM 流式处理超长文本

开始阅读 ↗PDFalphaXiv 讨论
被提及 · 8 人首次 2023-10-02 · 最近 2025-10-24
8不同的人
4活跃月份
8讨论串
303被引(OpenAlex)

流式场景下缓存全部 KV 占用大量内存,而窗口注意力在文本超过缓存长度时会失效。论文发现“注意力汇聚点”现象:模型会对初始 token 给出很强的注意力分数,保留它们的 KV 就能大幅恢复窗口注意力的表现。据此提出 StreamingLLM,无需微调就让 Llama-2、MPT、Falcon、Pythia 稳定处理多达 400 万 token,相对滑动窗口重算最高提速 22.2 倍,预训练时加入专用占位 token 作为汇聚点还能进一步改善。

HN 为什么提它

评论者用它解释“初始 token 吸走 softmax 注意力、注意力需要默认值”这一机制,以及模型如何处理近乎无限的上下文。

方法难度 4 / 5约 40 分钟经得起时间
读之前最好知道
1Transformer 架构
2自注意力与 softmax
3KV 缓存(KV cache)
4窗口注意力(sliding window attention)

HN 书评

推荐在前,同类按时间 · 每篇最多保留 20 条,统计用全部提及
引用TheJCDenton · 2023-10

“We show that StreamingLLM can enable Llama-2, MPT, Falcon, and Pythia to perform stable and efficient language modeling with up to 4 million tokens and more.”

引用 StreamingLLM 的结果:能让多个模型稳定高效处理多达 400 万 token
StreamingLLM: Efficient streaming technique enable infinite sequence lengths原评论 ↗
引用PartiallyTyped · 2023-10

“This seems to be the same mechanism at play.”

认为这和 attention sinks 是同一机制,让模型能处理近乎无限的上下文
Think Before You Speak: Training Language Models with Pause Tokens原评论 ↗
引用spidersouris · 2023-10

“The paper published by Xiao et al. (2023)[0] states that”

引用 Xiao 等人的论文,指出初始 token 无论相关与否都会获得大量注意力
Attention Sinks in LLMs for endless fluency原评论 ↗
引用visarga · 2023-10

“A recent paper suggests attention mechanism needs a default value”

提到近期论文认为注意力机制需要一个默认值,用 attention sink 稳定长上下文
MemGPT – LLMs with self-editing memory for unbounded context原评论 ↗
引用hedgehog · 2024-12

“The "verbosity sink" name is inspired by the idea from the paper below although they're not actually at all the same thing.”

说自己的“verbosity sink”命名受这篇论文启发,但两者并不相同
Task-specific LLM evals that do and don't work原评论 ↗
引用kingstnap · 2025-10

“The softmax has issues regarding attention sinks [1].”

引用它指出 softmax 存在 attention sink 问题,早期 token 吸走注意力
'Attention is all you need' coauthor says he's 'sick' of transformers原评论 ↗
被提交为 story · 3 次