This commit is contained in:
2026-06-01 10:46:01 +08:00
parent 2faf4bb002
commit e96b955fda
221 changed files with 10219 additions and 332 deletions

41
concepts/context-drift.md Normal file
View File

@@ -0,0 +1,41 @@
---
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 层