即使 LLM 能 100% exact-match 检索到所有证据,其推理/QA/编码能力仍随输入长度增加而实质性退化(13.9%–85%),且该退化在最小化甚至完全消除干扰 token 后依然存在——说明纯"长度"本身是独立于检索失败的性能瓶颈。
LLM 的 context window 从 4K 扩展到 128K+,但长上下文性能并未同比提升。现有框架将长文任务分解为 retrieval + reasoning:如果检索成功,模型应等效于短上下文。由此,性能下降被归因于"检索失败"——这塑造了 needle-in-a-haystack 等评估方式和 position extension 等模型设计。
核心问题: 这一归因是否完整?即使检索完美,长输入本身是否仍会伤害模型?
三级逐步控制实验(distraction 递减):
| 条件 | Distraction 强度 | 控制变量 |
|---|---|---|
| Essay tokens | 高 — 语义相关文本 | 标准 long-context 设置 |
| Whitespace tokens | 极低 — 无语义信息 | 消除 token-level distraction |
| Masking (attention mask) | 零 — 模型完全不看干扰 | 消除所有 distraction,仅保留位置距离 |
每级均验证 retrieval = 100% exact-match,performance 仍下降。
Mitigation: Retrieve-then-solve — 让模型先 recite 检索到的证据,再以短 prompt 求解。
Open-source models (30K tokens):
Closed-source (whitespace, 30K):
Mitigation: Mistral on GSM8K 从 35.5% → 66.7% at 26K tokens (+31.2%); GPT-4o on RULER QA2 up to +4%
无形式化作者证明 — 仅实证
本文为纯实验研究,无数学定理或形式化模型。核心贡献是控制实验设计。
若要解释此现象,可能需要:
| 维度 | 配置 |
|---|---|
| Open-source models | Llama-3.1-8B-Instruct (128K), Mistral-v0.3-7B-Instruct (32K) |
| Closed-source models | GPT-4o, Claude-3.7-Sonnet, Gemini-2.0 |
| Tasks | VarSum (variable tracking), GSM8K (math), MMLU (QA), HumanEval (code) |
| Context lengths | 0, 3750, 7500, 15000, 30000 tokens |
| Distraction types | Paul Graham essays, whitespace, attention masking |
| Hardware | GH200 GPUs, ~20,000 GPU hours |
| Mitigation benchmark | RULER QA1/QA2 (4K–128K) |
| Model | Task | 0 | 7500 | 15000 | 30000 |
|---|---|---|---|---|---|
| Llama3 | VarSum | 97.0 | -35.0 | -24.0 | -50.0 |
| Llama3 | GSM8K | 86.1 | -3.3 | -4.3 | -19.6 |
| Llama3 | MMLU | 62.8 | -15.9 | -15.5 | -21.1 |
| Llama3 | HumanEval | 57.3 | -22.0 | -16.5 | -50.0 |
| Mistral | VarSum | 66.0 | -11.0 | -19.0 | -34.0 |
| Mistral | GSM8K | 64.5 | -4.8 | -8.2 | -15.1 |
即使完全 mask 干扰 token(模型只看到 evidence 和 question),性能仍大幅下降。
GSM8K (Mistral, essay distraction):
RULER QA2 (GPT-4o):
| Step | 论据 | 证据 | 结论 |
|---|---|---|---|
| 1 | 检索成功不保证性能 | Llama3 MMLU: 97% retrieval exact-match, 但 accuracy 下降 24.2% at 30K | Retrieval ≠ effective reasoning in long context |
| 2 | 非 distraction 导致 | Whitespace: 无语义信息,仍然下降(Llama VarSum -48% at 30K) | Token-level distraction 非必要条件 |
| 3 | 非 evidence 位置导致 | Adjacent placement (evidence right before question): 仍下降 20% | Lost-in-the-middle 非唯一原因 |
| 4 | 纯长度本身是独立因素 | Masking: zero distraction, 仍下降 50% (HumanEval) | 输入长度本身直接伤害推理能力 |
| 5 | 缩短输入可缓解 | Retrieve-then-solve: +31.2% on GSM8K, +4% on RULER | 确认长度是 actionable bottleneck |
本文为评估研究,无模型训练或系统实现。
Benchmark 构建:
Mitigation 实现: Two-step prompting — step 1 retrieves and recites, step 2 solves on concatenated short prompt.
Artifacts: GSM8K (MIT), MMLU (MIT), HumanEval (MIT), RULER (Apache 2.0)
[实现未公开 — 评估框架代码未释出]