Files
myWiki/concepts/context-drift.md
2026-06-01 10:46:01 +08:00

42 lines
1.6 KiB
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.

---
title: "Context Drift上下文漂移"
created: 2026-05-30
updated: 2026-05-30
type: concept
tags: [context, memory, agent, degradation]
sources: [[agent-harness-engineering-survey]]
confidence: high
---
# Context Drift
> Agent 在多步执行中,由于上下文不断累积、轮替和变异导致的性能退化现象。这不是边缘情况——是 Agent 的**正常操作条件**。
## 三种退化机制
### 1. U 形注意力曲线
- Liu et al. (2024):在多文档 QA 中,放在上下文中间的相关文档准确率比放在开头或结尾**低 30%**
- 跨模型、跨任务、跨上下文长度均成立
- 信息**位置**和**存在**同等重要
### 2. Context Rot上下文腐烂
- Hong et al. (2025):评测 18 个前沿模型GPT-4.1、Claude Opus 4、Gemini 2.5、Qwen3**每个模型都随输入增长而退化**
- 退化在上下文窗口远未满时就已开始200K 窗口可能在 50K 时就有显著退化)
- 语义模糊查询退化更陡:模型既定位不到相关信息,定位后也无法推理
### 3. 工具结果累积
- 每一步工具调用都会向上下文注入新 token
- 不加管理时,上下文迅速膨胀
- 早期决策错误会随着 trace 累积而放大
## 应对策略
- [[context-management|上下文管理]] (C 层):短/中/长期记忆分层
- **渐进式披露**Progressive Disclosure按需加载而非全量预加载
- **压缩**Compaction移除已完成使命的 token
- KV-cache 感知的上下文设计
## 相关概念
- [[context-management]] — C 层总体
- [[binding-constraint-thesis]] — 约束瓶颈论
- [[execution-environment]] — E 层