Files
myWiki/concepts/lost-in-the-middle.md

30 lines
1015 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Lost in the Middle
**长上下文信息丢失现象**LLM 在处理长上下文时对中间位置的信息利用效率最低。
## 核心发现
Liu 等 (2024) 发现 LLM 的注意力呈 **U 形分布**
- 开头 Token 获得最多关注primacy bias
- 结尾 Token 获得次多关注recency bias
- **中间 Token 被系统性忽略**
## 影响
- 将关键信息放在 Prompt 中间位置可能导致模型"看不到"
- 多文档 QA 任务中,中间文档的信息利用效率显著低于首尾
- 随上下文增长,中间区域的"注意力盲区"扩大
## 缓解方案
- [[attention-sinks|Attention Sinks]]: 利用注意力汇锚定上下文
- [[duo-attention|DuoAttention]]: 区分检索头和流式头
- Prompt 工程: 将关键信息放在开头或结尾
## 相关概念
- [[attention-entropy-collapse]] — 注意力退化加剧此现象
- [[attention-sinks]] — 缓解方案
- [[duo-attention]] — 架构层面的解决思路
- [[llm-attention-survey-2026]] — 综述参考