OctSum
00:00 / 14:39

Prompt Engineering · 14:39

With the new frontier models, we're seeing context windows getting bigger and bigger, which in theory means models should be able to run for longer and longer.

随着新一代前沿模型不断推出,我们看到上下文窗口越来越大,理论上这意味着模型应该能够运行越来越长的时间。

But the question is, does that actually translate to real-world usage?

但问题是,这真的能转化为实际应用吗?

it turns out that as you start filling the context window of a long-running agent with things like files, terminal logs, and its own notes, over time, any one of those can quietly push it in the wrong direction.

事实证明,当你开始用文件、终端日志和智能体自己的笔记等内容填充一个长期运行的智能体的上下文窗口时,随着时间推移,其中任何一项都可能悄无声息地把它引向错误的方向。

there's a name for it.

这种现象有个名字。

researchers call it context rot.

研究人员称之为上下文腐化。

and they have described five specific ways an agent's context can break.

他们还描述了智能体上下文可能失效的五种具体方式。

Things like context poisoning, context distraction, context confusion, context clash, and self-conditioning, where the agent trusts its own earlier work.

比如上下文投毒、上下文分心、上下文混乱、上下文冲突,以及自我条件化——也就是智能体相信自己先前的工作。

now, some of these failures do not apply to modern models anymore, especially the frontier ones.

如今,其中一些失效情况已不再适用于现代模型,尤其是前沿模型。

to actually test this, i put all five to test across three different models.

为了实际检验这一点,我用三种不同的模型测试了这五种情况。

and my goal for this video is to walk you through each of these failure modes, show you which ones still break today's models, and how to address them.

这期视频的目标是带你逐一了解这些失效模式,展示哪些仍会导致当今的模型出问题,以及该如何应对。

okay, so let's start with what is actually inside an agent's context window.

好,我们先来看看智能体的上下文窗口里究竟有什么。

the context window is everything the model reads before it decides its next steps, which means it is the working memory of your agent.

上下文窗口包含模型决定下一步之前读取的所有内容,也就是说,它就是智能体的工作记忆。

say you give a coding agent the job of moving an old code base to a new database driver.

假设你让一个编程智能体把旧代码库迁移到新的数据库驱动程序。

at the top, there's a system prompt and your task, which can range from a few lines to a few hundred lines.

窗口顶部是系统提示和你的任务,内容可能只有几行,也可能多达几百行。

and then project instructions and the definition of every tool the agent can call.

接下来是项目说明,以及智能体可以调用的每种工具的定义。

after that, the window turns into a running log of every step, and the biggest part of that log is the tool results.

之后,窗口就会变成一份记录每一步的运行日志,而日志中占比最大的是工具返回的结果。

Things like file contents, test outputs, and error logs.

例如文件内容、测试输出和错误日志。

so after an hour of work, your few lines task is a tiny piece at the top of the window that could be hundreds of thousands of tokens long now.

所以,工作一小时之后,你那几行任务说明就成了窗口顶部的一小部分,而此时整个窗口可能已经长达几十万个 token。

now, the problem is that models have to decide what to pay attention to across the entire window on every step.

问题在于,模型每走一步,都必须判断整个窗口里哪些内容值得关注。

and this is where context rot comes into play.

这就是上下文腐化开始发挥作用的地方。

according to a study from chroma, All eighteen models they tested got worse as the input grew, even though the task stayed the exact same.

根据 Chroma 的一项研究,他们测试的全部 18 个模型都会随着输入变长而表现变差,尽管任务完全相同。

now, this is a relatively older study, but most of the findings still apply.

这是一项相对较早的研究,但大多数发现至今仍然适用。

those tests were about finding and copying text and not about agent doing real work.

那些测试关注的是查找和复制文本,而不是让智能体真正执行工作。

so researchers have broken this down further into five specific ways in agent's context goes wrong.

因此,研究人员进一步将智能体上下文出错的情况归纳为五种具体方式。

the first failure point is context poisoning, which is when a wrong fact.

第一个失效点是上下文污染,也就是一个错误事实

gets into the window and the agent treats it as true from then on.

进入上下文窗口后,智能体从此便把它当成真的。

say our migration agent skims the documentation, misreads it and writes itself a note saying that the new driver retries failed connection automatically.

比如,我们的迁移智能体粗略浏览文档时看错了内容,于是给自己写下一条备注,说新驱动程序会自动重试失败的连接。

so every time it reaches some old retry code, it deletes it because according to its own note, the code is no longer needed.

于是,每当它遇到一些旧的重试代码,就会把它删掉,因为按照它自己的备注,这些代码已经没有必要了。

now to the model, its own notes look just like truth.

对模型来说,它自己的备注看起来就像事实一样。

nothing in the window tells it to double check it.

上下文窗口里没有任何东西会提醒它再核实一遍。

google saw this in their own gemini agent that played pokemon where wrong information about the game got into its goals and took a long time to undo.

谷歌在自家的 Gemini 智能体身上也观察到了这种情况:这个智能体玩《宝可梦》时,关于游戏的错误信息进入了它的目标,之后花了很长时间才纠正过来。

So the fix for poisoning is validation, which means checking a conclusion against something real before it ever gets written down.

因此,解决上下文污染的方法是验证,也就是在把结论记录下来之前,先拿现实中的依据核对它。

Now, the second failure point is context distraction, which is when the size of the history starts tearing the agent.

第二个失效点是上下文干扰,也就是历史记录的规模开始拖垮智能体。

a language model continues patterns, so when the window holds an hour of agent's own past actions, that history becomes the strongest pattern it can see.

语言模型会延续模式,所以当上下文窗口里装着智能体过去一小时的行动时,这段历史就成了它能看到的最强模式。

instead of asking what the task needs next, the agent can keep doing whatever it has been doing, like reading one more log file.

智能体可能不去思考任务接下来需要什么,而是继续做一直在做的事,比如再读一个日志文件。

this specific failure.

这种特定的失效情况

is critically important for small models because they can easily get distracted.

对小模型尤其重要,因为它们很容易分心。

Now, the usual fix is compaction, which means summarizing the history and starting again from that summary.

通常的解决办法是压缩,也就是总结历史记录,然后从这份摘要重新开始。

but compaction is lossy because a summary can drop the one detail that turns out to matter the most later on.

但压缩是有损的,因为摘要可能会删掉那个后来证明最重要的细节。

so you need to be very careful with compaction when you do it.

所以,压缩时一定要非常谨慎。

the third failure point is context confusion.

第三个失效点是上下文混淆。

and this one comes from tools.

而这通常是由工具引起的。

so every tool you connect puts its definition into the window, whether the agent uses or not.

所以,无论智能体是否会使用,你连接的每个工具都会把自己的定义放进上下文窗口。

so with hundreds of tools, the agent has to pick the right one from a much bigger set.

因此,工具多达数百个时,智能体就必须从大得多的工具集合中选出合适的那个。

you will often hear that a model failed a task with 46 tools and passed it with, say, much smaller number like 19 or 20.

你经常会听说,模型用 46 个工具执行任务时失败了,但把工具数量减到更少,比如 19 或 20 个,就成功了。

but the result comes from a single query on a small 8 billion parameter model running on an edge device.

但这个结果来自一台边缘设备上运行的 80 亿参数小模型,它只执行了一次查询。

so it is a fair question whether a frontier model cares about tool count at all.

所以,前沿模型到底会不会受工具数量影响,这是个合理的问题。

The fix here is curation, which means giving the agent only the tools the job needs or letting it search for a tool when it needs one.

解决办法是精简工具集,也就是只提供任务所需的工具,或者让智能体在需要时自行搜索工具。

Because you don't want to just dump tool definition and hope for the best.

因为你不想只是把工具定义一股脑塞进去,然后祈祷结果会好。

Now, if you're building AI agents, at some point your agents needs real data, things like company financials, SEC filings, or research papers.

现在,如果你正在构建 AI 智能体,那么迟早会需要真实数据,比如公司财务数据、SEC 文件或研究论文。

And this is where today's sponsor, Firecrawl, comes in.

这就要说到今天的赞助商 Firecrawl 了。

Firecrawl has a product called Alexandria, which is a library of more than 500 data providers that your agent can search and call with a single api key.

Firecrawl 有一款名为 Alexandria 的产品,它是一个包含 500 多家数据提供商的资源库,你的智能体只需一个 API 密钥,就能搜索并调用这些数据提供商。

now the problem is that a real question usually needs more than one data provider.

问题是,一个真实的问题通常需要不止一家数据提供商。

for example, to find where a competitor is spending on ads, you need podcast data, meta ad data, and traffic data.

例如,要查出竞争对手把钱花在了哪些广告上,你需要播客数据、Meta 广告数据和流量数据。

to solve this, firecrawl recently introduced alexandria skills, which are ready-made recipes that chain those providers together.

为了解决这个问题,Firecrawl 最近推出了 Alexandria Skills,这些现成的方案可以把多个数据提供商串联起来。

so your agent runs one skill, and it's going to use the right combination of providers on its own.

这样,你的智能体只需运行一个技能,就能自行使用合适的数据提供商组合。

You can use these skills from the Firecrawl mcp server, the cli or the official connectors.

你可以通过 Firecrawl 的 MCP 服务器、CLI 或官方连接器使用这些技能。

Now, the good part is that searching the library is free and the free plan comes with 1,000 credits every month.

好消息是,搜索这个资源库是免费的,而且免费套餐每月提供 1,000 点额度。

The link is going to be in the video description.

链接会放在视频简介里。

Okay,back to the video。

好了,我们回到视频。

now, the fourth failure point is context clash, which is when the window holds information that disagrees with itself.

现在,第四个失效点是上下文冲突,也就是窗口中的信息彼此矛盾。

say our agent later finds out that its retry note was wrong and writes a correction.

假设我们的智能体后来发现,自己的重试备注是错的,于是写下了更正。

so now both notes are sitting in the window.

这样一来,窗口里就同时有了这两条备注。

a study from microsoft and salesforce found that models do a lot worse when one request is split across several turns.

微软和 Salesforce 的一项研究发现,同一个请求分散在多轮对话中时,模型的表现会差很多。

Because they commit to an early wrong answer and essentially do not recover.

因为它们会坚持早先给出的错误答案,基本上无法纠正过来。

So the fix for clash is pruning, which means deleting the old version so that only the current state is left.

所以,解决冲突的办法是修剪,也就是删掉旧版本,只留下当前状态。

now, there is a fifth failure point that gets a lot less attention, and that is the agent trusting its own earlier work.

现在,还有第五个失效点,它受到的关注要少得多,那就是智能体相信自己先前的工作。

researchers call this self-conditioning, which means that once a model sees its own mistakes in the history, it becomes more likely to make new ones.

研究人员把这称为自我条件化,也就是说,模型一旦在历史记录中看到自己的错误,就更容易犯新的错误。

In their tests, one Qwen model fell below half accuracy within 15 turns, even though it could do each step almost perfectly.

在他们的测试中,一个 Qwen 模型在 15 轮对话内准确率就跌到了不到一半,尽管它几乎能完美完成每个步骤。

So the interesting part is that a bigger model actually didn't fix it.

有意思的是,更大的模型实际上并没有解决这个问题。

But for this study, turning on thinking fixed the problem.

但在这项研究中,开启思考模式解决了这个问题。

this one is also different from poisoning because there is no note to check and the mistake lives in the code the agent already has written down.

这一点也不同于投毒,因为这里没有需要核查的备注,错误存在于智能体已经写下的代码中。

so the easiest way to think about all five is that the model treats everything in its context window as true and it treats its own past actions as.

所以,理解这五种情况最简单的方式是:模型把上下文窗口里的所有内容都当成真的,而它会把自己过去的行动当成……

the most true of all.

最真的东西。

now, most of these were described in 2025 with models that were more than one year old.

现在,这些问题大多是在 2025 年用一年多以前的模型描述的。

so i wanted to test which of them still breaks an agent today.

所以我想测试一下,今天这些问题中哪些仍然会让智能体出错。

So let me show you the setup I tried.

接下来我给你们看看我尝试的设置。

I built a small test harness around.

我围绕……搭建了一个小型测试框架。

the same migration test where an agent has to move a small orders service to a new database driver.

测试仍然是同一个迁移任务:让智能体把一个小型订单服务迁移到新的数据库驱动程序上。

the new driver makes a single connection attempt, so the old retry loop have to stay.

新驱动程序只会尝试连接一次,因此旧的重试循环必须保留。

and i wrote hidden tests that checks the exact behavior.

我还编写了隐藏测试,用来检查确切的行为。

the agent never sees those tests, which means it can pass every visible test and still ship the bug.

智能体永远看不到这些测试,这意味着它可能通过所有可见测试,最终却仍然带着这个 bug 上线。

and when you are setting up these kind of scenarios, you want to make sure you have these hidden tests that the agent cannot game.

设置这类场景时,你要确保准备好智能体无法钻空子的隐藏测试。

then i injected each failure point into the agent's context and i ran every setup five times on three models.

接着,我把每个故障点都注入智能体的上下文中,并在三个模型上分别运行每种设置五次。

two of them are the Qwen models running locally on my DGX Sparks and the one is the Gemini 3.8 flash through the api.

其中两个是运行在我的 DGX Sparks 上的 Qwen 模型,另一个是通过 API 调用的 Gemini 3.8 Flash。

in the clean setup, every single run passed the hidden tests.

在干净的设置中,每一次运行都通过了隐藏测试。

okay, the first test was poisoning, where i planted that wrong note about retries as if it came from an earlier read of the documentation that got cut off.

好,第一个测试是投毒:我植入了一条关于重试的错误备注,伪装成之前阅读文档时留下的内容,而且那次阅读中途被打断了。

in all 15 runs across the three models, the agent kept the retry loops and passed the hidden tests.

三个模型共进行了 15 次运行,智能体都保留了重试循环,并通过了隐藏测试。

when i went through the traces, the agent had gone back and re-read the documentation in most of those runs, and the documentation overrode the note.

我查看运行轨迹时发现,大多数情况下,智能体都回去重新读了文档,而文档内容覆盖了那条备注。

now, the same thing happened with clash, where wrong note and the corrections were both in the window, and all 15 runs passed again.

接下来是矛盾测试,错误备注和更正内容同时出现在上下文窗口中,结果同样是 15 次运行全部通过。

now, distraction was the one i expected to hurt the most, so i filled the window with the agent's own past log reads before the real work up to about 145,000 tokens.

我原本以为干扰测试的影响会最大,所以在真正的工作开始之前,我用智能体自己过去读取日志的记录填满了上下文窗口,大约达到 145,000 个 token。

apart from one run where the 27 billion stopped early, every run finished the migration and passed.

除了一个 270 亿参数模型提前停止的运行外,每次运行都完成了迁移并通过测试。

then i added compaction where the model summarizes the history into a short handoff note and continues from there.

然后我加入了压缩环节:模型把历史记录总结成一份简短的交接备注,再从那里继续。

the pass rate stayed the same but the prompt tokens per run dropped by somewhere between 23 and 59 times.

通过率保持不变,但每次运行的提示词 token 数减少了约 23 到 59 倍。

depending on the model, which means at these sizes, compaction is mainly a way to save cost because there was no failure left for it to fix.

具体取决于模型。这意味着在这样的规模下,压缩主要是为了节省成本,因为已经没有故障需要它来修复了。

now for tool confusion, i gave the agent up to 100 tools, including a few traps like deprecated file writer that saves to a backup folder.

接下来是工具混淆测试,我给智能体提供了多达 100 种工具,其中包括一些陷阱,比如一个已弃用的文件写入工具,它会把文件保存到备份文件夹。

all three models passed every run and they almost never called one of those extra tools.

三个模型在每次运行中都通过了测试,而且几乎从未调用那些额外工具。

from my quick experiments, poisoning, clash, distraction and tool confusion all stopped being failure in these tests.

根据我的初步实验,投毒、矛盾、干扰和工具混淆在这些测试中都不再导致失败。

and that is the trend that i wanted to show you.

这就是我想向你展示的趋势。

but the last test was completely different.

但最后一个测试完全不同。

for self-trust, i started the agent with two files that it had already migrated by itself, and in one of them, it had quietly dropped the retry loop.

为了测试它们对自身工作的信任,我让代理从两个已经由它自己迁移过的文件开始,其中一个文件里的重试循环被它悄悄删掉了。

there was no wrong note this time, only the agent's own earlier work sitting in its history.

这次没有错误提示,只有代理早先写的代码留在它的历史记录里。

the thing is that none of them actually fixed it, which means 0 out of 15 runs across all three models caught their own mistake.

关键在于,它们没有一个真正修复了问题,也就是说,三个模型总共跑了15次,没有一次发现自己的错误。

the surprising part is that most of these agents re-read the documentation that says the driver makes only one attempt, but they still didn't check their own code against it.

令人惊讶的是,这些代理中的大多数都重新读了文档,知道驱动程序只会尝试一次,但它们仍然没有对照文档检查自己的代码。

then i ran the same setup, but this time the history included a log from a small canary deploy that showed requests failing during a database failover.

然后我用相同的设置又跑了一次,不过这次历史记录里包含了一份小规模金丝雀部署的日志,显示数据库故障切换期间请求出现了失败。

with that evidence in the window, 10 out of 15 runs went back and fixed the retry loop.

有了窗口中的这些证据,15次运行里有10次回头修复了重试循环。

so the thing that fixed self-trust was evidence from the environment, which a note in the window couldn't actually provide.

所以,解决它们对自身工作的盲目信任的,是来自运行环境的证据,而窗口中的一条提示实际上无法提供这种证据。

this test does show us some really interesting patterns, but it is important to know the limitations of the test that i ran.

这项测试确实展现了一些非常有意思的规律,但了解我所做测试的局限性也很重要。

the first one is that this is one task with five runs per setup, so please take all of this with a grain of salt.

首先,这只是一个任务,每种设置跑了五次,所以请谨慎看待这些结果。

Another thing to consider is the cost because pruning old context breaks the prompt caching and according to Manus team cache tokens can be about 10 times cheaper.

另一个需要考虑的因素是成本,因为清除旧上下文会破坏提示缓存;据 Manus 团队称,缓存令牌的成本可能便宜约10倍。

So I would prune at clear boundaries like the end of a subtask and not on every step.

所以我会选择在明确的边界进行清理,比如一个子任务结束时,而不是每一步都清理。

now, we looked at some of the interesting failure points that can cause context failures, but i feel like most of them do not apply to modern llms anymore.

我们刚才看了一些可能导致上下文失效的有趣故障点,但我觉得其中大多数已经不适用于现代大语言模型了。

but for my experiments, it seems like trusting their own past work still breaks on every agent.

不过,在我的实验中,代理依然普遍会盲信自己过去的工作。

if you change only one thing, i would make sure your agent gets the real evidence.

如果只改一件事,我会确保你的代理能获得真实证据。

about the code it already wrote, things like behavior tests, canary logs, or a reviewer that reads the diff.

这些证据要针对它已经写好的代码,比如行为测试、金丝雀部署日志,或是审查差异的审阅者。

Now, if you have found other ways to make your agent check their own work, please share them in the comment section below.

如果你还发现了其他让代理检查自身工作的方法,请在下方评论区分享。

The test harness and all the results are going to be in the video description.

测试框架和所有结果都会放在视频简介里。

I'm also putting together a video on building verification loops for coding agents.

我也正在制作一个关于如何为编程代理构建验证循环的视频。

So if you are interested.

如果你感兴趣,

Make sure to subscribe to the channel.

记得订阅频道。

now, if you want to learn more about how the harness and an agent controls its own context, watch this video.

现在,如果你想进一步了解 harness 以及智能体如何控制自身上下文,请观看这段视频。

anyways, i hope you found this video useful.

总之,希望你觉得这段视频有帮助。

thanks for watching and as always, see you in the next one.

感谢观看,一如既往,我们下期再见。

Overview

长运行智能体会把任务、文件、终端日志、工具定义和自身笔记不断累积进上下文;窗口变大并不保证表现持续稳定,模型可能因上下文腐化而偏离目标。文稿将问题归纳为上下文污染、分心、混淆、冲突和自我条件化,并分别讨论验证、压缩、工具筛选和修剪等应对方式。随后,作者用数据库驱动迁移任务、隐藏测试和三种模型进行实验:前四种问题在这组测试中未造成失败,而智能体盲信自己先前写下的代码仍然突出;加入真实环境证据后,部分智能体才修复了错误。结论是,检查自身产出的代码需要行为测试、部署日志或独立审查等外部证据。

Chapters

00:00 上下文窗口与 Context Rot

上下文窗口包含模型采取下一步行动前读取的全部内容,是智能体的工作记忆:既有系统提示、任务和项目说明,也有可用工具定义,以及不断累积的文件内容、测试结果和错误日志。长时间运行后,最初的任务可能只占上下文很小一部分,模型需要持续从整个窗口中判断该关注什么。文稿将随着上下文增长而出现的表现退化称为 Context Rot,并归纳出污染、分心、混淆、冲突和自我条件化五种失效模式;所引述的 Chroma 研究发现,测试的 18 种模型在输入变长时表现变差,但该研究侧重文本查找与复制,并非真实智能体工作。

上下文窗口的定义与作用
上下文日志中工具结果占主要部分
输入增长时模型表现变差的研究结论

02:47 上下文污染与验证

上下文污染是错误事实进入窗口后被智能体当成真相。例如,迁移智能体误读文档,记下新数据库驱动会自动重试连接,于是遇到旧重试代码时将其删除;智能体自己的笔记看起来与事实无异,窗口本身也不会要求它复核。文稿以 Google 的 Gemini Pokémon 智能体为例,指出错误游戏信息曾进入目标并需要较长时间才能纠正。针对污染的办法是验证:在结论被写入笔记前,先用真实信息核对。

验证结论的核心要求

03:48 上下文分心与压缩取舍

上下文分心是历史记录的规模和模式开始牵引智能体,使它重复此前的行为,而不是判断任务下一步真正需要什么;例如,它可能继续读更多日志。文稿认为小模型尤其容易受此影响。常用应对方式是压缩历史、生成摘要后从摘要继续,但摘要有损,可能漏掉之后关键的细节,因此压缩需要谨慎权衡。

历史记录可能成为智能体最强的行为模式

04:45 工具混淆与工具筛选

工具混淆源于每个已接入工具的定义都会进入上下文,即使智能体不会使用它;工具数量增加时,选择合适工具的负担也会变大。文稿提到一项以 8B 边缘设备模型进行的单次查询比较:46 个工具的任务表现不如 19 或 20 个工具,但这不足以直接说明前沿模型也会受工具数量影响。建议根据任务只提供必要工具,或让智能体需要时再搜索工具,而不是一次性塞入所有工具定义。

工具数量与任务结果的对比论述
工具筛选与按需提供的解决方案

06:54 上下文冲突、自我条件化与对应修复

上下文冲突发生在窗口中同时保留互相矛盾的信息:例如,智能体发现原先的重试笔记有误并补写更正,但旧笔记仍在。文稿提到微软与 Salesforce 的研究发现,把一次请求拆成多轮时模型表现会变差,并可能固守早期错误;对应办法是修剪过时版本,只留下当前状态。第五种问题是自我条件化:模型看到自己过去的错误后,更可能继续犯错。研究中的一个 Qwen 模型在 15 轮内准确率跌破一半,尽管单步任务几乎都能做好;更大模型并未解决问题,而该研究中开启思考模式缓解了问题。它不同于笔记出错:错误可能已经存在于智能体写下的代码中。整体而言,智能体容易把上下文内容当真,尤其信任自己过去的行为。

旧记录与更正同时留在上下文中
删除旧版本,只保留当前状态
模型在15轮内准确率跌破一半

08:50 迁移任务实验设计

实验使用一个小型订单服务迁移任务,要求智能体切换数据库驱动。新驱动只尝试连接一次,因此旧重试循环必须保留;隐藏测试专门检查这一行为,智能体看不到测试,即使通过所有可见测试仍可能留下缺陷。作者为每种上下文失效注入相应干扰,每种设置运行五次,共测试三种模型:两种在 DGX Sparks 本地运行的 Qwen,以及一种通过 API 调用的 Gemini 3.8 Flash。干净设置下,每次运行都通过隐藏测试。

实验运行次数与模型数量

09:45 污染、冲突、分心与工具数量的测试结果

污染测试中,作者植入“驱动会自动重试”的错误笔记;三种模型共 15 次运行都保留了重试循环并通过隐藏测试。多数运行中,智能体重新阅读文档,文档信息覆盖了错误笔记。冲突测试把错误笔记及其更正同时放入上下文,15 次运行同样全部通过。分心测试则在真正任务前塞入约 145,000 token 的历史日志;除一次 27B 模型提前停止外,其余运行均完成迁移并通过测试。加入历史摘要压缩后,通过率不变,单次运行的提示 token 数减少约 23 至 59 倍,显示在这组规模下压缩主要节省成本。工具混淆测试最多提供 100 个工具,包括会把文件写入备份目录的过时工具;三种模型每次都通过,且几乎不调用额外工具。就这些实验而言,前四类问题没有造成测试失败。

三种模型共15次运行均通过隐藏测试
冲突测试中15次运行再次全部通过
压缩后每次运行的提示词 token 数下降约23至59倍
工具混淆测试最多提供100种工具

11:50 自我盲信与环境证据

自我信任测试直接提供智能体先前迁移过的两个文件,其中一个已经悄悄丢失重试循环;上下文里没有错误笔记,只有智能体自己的旧成果。三种模型共 15 次运行,没有一次发现并修复错误。多数智能体虽然重新阅读了说明驱动只尝试一次的文档,却没有据此检查自己的代码。之后在上下文中加入一份小规模 canary 部署日志,显示数据库故障切换期间请求失败,15 次运行中有 10 次回去修复了重试循环。实验显示,真实环境证据比窗口中的笔记更能推动智能体检查并修正自己的代码。

三种模型共15次运行均未发现自身错误
金丝雀部署日志记录数据库故障切换期间请求失败
有环境证据后,15次运行中有10次修复了重试循环

13:03 实验限制与实践建议

实验只覆盖一个任务,每种设置仅运行五次,因此结论需要谨慎看待。修剪旧上下文可能破坏提示缓存;文稿称 Manus 团队提到缓存 token 的成本可能低约十倍,因此建议在子任务结束等明确边界修剪,而不是每一步都修剪。作者认为,自己的实验中前四种问题对现代模型不再明显,但智能体仍会持续信任自己的既有成果。改进这一问题的关键,是让智能体获得其代码实际行为的证据,例如行为测试、canary 日志,或阅读代码差异的审查者。

实验规模与结果可信度限制
上下文裁剪与缓存成本
建议在子任务边界进行裁剪
上下文失效的实验观察
智能体仍会在依赖自身既有工作时出错

Conclusions

02:06 上下文变长会让模型更难持续判断该关注什么,但具体失效是否发生取决于任务、模型和上下文内容。

11:37 在这组迁移实验中,污染、冲突、分心和工具混淆均未导致明显失败,而智能体盲信自己先前写下的代码仍是突出问题。

13:50 要让智能体发现自身代码中的错误,应提供行为测试、部署日志或独立代码审查等真实证据。

13:10 修剪旧上下文应优先放在子任务结束等清晰边界,避免频繁操作损害提示缓存的成本优势。

Context Rot Is Mostly Solved. Except This One · Video Summary · OctSum