长上下文如何失效

Managing Your Context is the Key to Successful Agents

管理上下文是成功代理的关键

As frontier model context windows continue to grow1, with many supporting up to 1 million tokens, I see many excited discussions about how long context windows will unlock the agents of our dreams. After all, with a large enough window, you can simply throw everything into a prompt you might need – tools, documents, instructions, and more – and let the model take care of the rest.

随着前沿模型的上下文窗口不断扩展1,许多模型已支持高达 100 万 token,我看到许多兴奋的讨论,认为长上下文窗口将解锁我们梦寐以求的代理。毕竟,只要窗口足够大,你就可以把所有可能需要的内容——工具、文档、指令等等——统统塞进提示里,让模型自行处理其余部分。

Long contexts kneecapped RAG enthusiasm (no need to find the best doc when you can fit it all in the prompt!), enabled MCP hype (connect to every tool and models can do any job!), and fueled enthusiasm for agents2.

长上下文扼杀了 RAG 的热情(既然可以把所有文档都塞进提示,又何必费心去找最佳文档!),催生了 MCP 的热潮(连接所有工具,模型就能胜任任何工作!),并点燃了代理的热情2

But in reality, longer contexts do not generate better responses. Overloading your context can cause your agents and applications to fail in suprising ways. Contexts can become poisoned, distracting, confusing, or conflicting. This is especially problematic for agents, which rely on context to gather information, synthesize findings, and coordinate actions.

但在现实中,更长的上下文并不会带来更好的回答。过度填充上下文会让你的代理和应用以意想不到的方式失败。上下文可能被污染、分散注意力、令人困惑或相互冲突。这对代理尤其成问题,因为它们依赖上下文来收集信息、综合发现并协调行动。

Let’s run through the ways contexts can get out of hand, then review methods to mitigate or entirely avoid context fails.

让我们逐一梳理上下文失控的各种方式,然后回顾可减轻或完全避免上下文失败的方法。

Context Poisoning

上下文污染

Context Poisoning is when a hallucination or other error makes it into the context, where it is repeatedly referenced.

上下文投毒是指幻觉或其他错误进入上下文,并被反复引用。

The Deep Mind team called out context poisoning in the Gemini 2.5 technical report, which we broke down last week. When playing Pokémon, the Gemini agent would occasionally hallucinate while playing, poisoning its context:

DeepMind 团队在Gemini 2.5 技术报告中指出了上下文污染,我们上周对此进行了拆解。在游玩 Pokémon 时,Gemini 代理偶尔会出现幻觉,从而污染其上下文:

An especially egregious form of this issue can...

开通本站会员,查看完整译文。

Accueil - Wiki
Copyright © 2011-2025 iteam. Current version is 2.146.0. UTC+08:00, 2025-10-08 05:17
浙ICP备14020137号-1 $Carte des visiteurs$