00:32 费马大定理形式化的背景与目标
费马大定理断言:当正整数指数 n 大于 2 时,aⁿ+bⁿ=cⁿ 没有正整数解。安德鲁·怀尔斯在 20 世纪 90 年代给出了证明,耗时七年;之后数学界持续尝试将证明形式化,即用 Lean 等系统逐步计算验证逻辑。此前的形式化尝试使用约十几个智能体,并依靠 ProofToMe 这类数学证明编排平台和研究人员支持。新的尝试要检验:能否把规模扩大到约一千个智能体,在不使用领域专用工具、也不由人类引导解题的情况下完成形式化。
AI Engineer · 18:43
I'm Lance from Anthropic. I know we've had some issues with the one of the prior keynotes, so we're set to go. I'm going to tell two stories about getting the most out of Claude and exploring Claude's frontier capabilities. So the first is multi agent. This is a blog I wrote with the Fable five hundred and twenty two launch and I want to kind of tell the story of what happened here.
我是来自 Anthropic 的 Lance。 我知道之前的主题演讲出了些问题,不过我们已经准备就绪。 我想讲两个故事,谈谈如何充分发挥 Claude 的作用,以及探索 Claude 的前沿能力。 第一个故事是关于多智能体的。 这是我在 Fable 522 发布时写的一篇博客,我想大致讲讲这里发生了什么。
so, fermat's last theorem is one of the more kind of famous claims in mathematics. it's stood and proven for around 350 years. and it's actually a very simple statement. just a to the n plus b to the n equals c to the n has no solution for any positive whole numbers greater than 2. now, this deceptively simple kind of statement has proven to be quite difficult to actually prove. In the mid nineties, Sir Andrew Wiles did prove it. He put out a proof and it took him seven years of work. It was extremely painstaking. and since that time, a major effort and interest in mathematics has been formalizing that proof, or basically computationally checking every step. so proofs are kind of long chains of logic, and you actually can computationally check proofs using different systems, which we'll talk about, for example, using lean. So this is just kind of a visual kind of explaining. There's a very interesting video showing the effort that he went through, an extremely painstaking process to establish this proof. and in september, we published that we use claude to formalize it. this was like kind of first very important result that we kind of shared along these lines. and we used lean to do it. so lean allows you to computationally verify every step in a proof. now doing this, though, is extremely painstaking. We started with a team of a dozen agents, and this is kind of just showing a schematic of that team. Very early on, that team didn't work very effectively. We had to give it something called proof to me. Now this is a kind of a platform for orchestrating mathematics proofs and it helped the agent significantly manage the state of the project. lean, you can think about as a harness. so basically it provides the agents with a graph that they can query. so it's basically lots of scaffolding around this problem statement. you can think of it as like a very domain-specific harness, okay? now, this is all setting up what we actually did. we reported, this was back in september, the formalization. now, what i want to do for 5.2 is show, can we have a much larger team of agents, so going from around a dozen to a thousand, do this formalization with no domain-specific harness, so without, ProofToMe, and with no human steering with respect to the solution. so the report we talked about in september had both this domain-specific harness proved to me and a lot of support from a researcher. this is testing whether or not a large team of fable 2 agents can autonomously develop this formalization themselves.
费马大定理是数学中比较著名的命题之一。 它历经约 350 年,最终得到了证明。 它的表述其实非常简单。 对于任何大于 2 的正整数,a 的 n 次方加 b 的 n 次方都不等于 c 的 n 次方。 这个看似简单的命题,事实证明要真正证明它相当困难。 上世纪 90 年代中期,安德鲁·怀尔斯爵士证明了它。 他发表了一份证明,并为此花了七年时间。 整个过程极其艰苦细致。 从那以后,数学界投入了大量精力,也对此兴趣浓厚,致力于将这个证明形式化,也就是用计算机逐步检查每一个步骤。 证明其实是一连串很长的逻辑推理。我们可以借助不同的系统用计算机检查证明,稍后会谈到这些系统,例如 Lean。 这只是一个简单的示意说明。 有一段非常有意思的视频,展示了他为确立这个证明所经历的过程,那是极其艰苦细致的工作。 九月,我们公布了使用 Claude 将其形式化的成果。 这是我们沿着这个方向分享的第一个非常重要的成果。 我们用 Lean 完成了这项工作。 因此,Lean 可以让你对证明中的每一步进行计算机验证。 不过,这样做极其费时费力。 我们最初组建了一个由十几个智能体组成的团队,这张图只是示意这个团队的架构。 在很早期,这个团队的工作效率并不高。 我们必须给它配备一个叫作 ProofToMe 的工具。 这是一个用于编排数学证明的平台,它显著帮助智能体管理项目状态。 你可以把 Lean 看作一个运行框架。 它基本上为智能体提供了一张可供查询的图。 所以,它基本上是在这个问题陈述周围搭建了大量支架。 你可以把它看成一个非常专门的领域运行框架,对吧? 现在,这些都是在为我们实际做的事情做铺垫。 我们在九月份报告了这项形式化工作。 现在,我想在 5.2 中展示的是:我们能否组建一个大得多的智能体团队,从大约十几个扩大到一千个,在没有领域专用运行框架的情况下完成这项形式化工作,也就是不使用 ProofToMe,并且不让人类对解决方案进行引导。 我们在九月份谈到的那份报告,既使用了这个领域专用运行框架 ProofToMe,也得到了研究人员的大力支持。 这项测试要检验的是,一支由大量 Fable 2 智能体组成的团队能否自主完成这项形式化工作。
So this is just giving you a sense for the harness. It looks kind of complicated, but it's actually pretty simple. Each of the thousand agents has its own sandbox with restricted network access. Most of this is directed on safety and security. So we have a thousand agents, each have their own sandbox. They can connect to two different things, Git and a SQL database. That's it. Those are the core primitives that we give this team. And we have real-time monitoring looking at every tool call for things like escapes. We also have offline monitoring looking at runs of all the agents every 10 minutes. This is kind of the setup. 1,000 agent team, very simple primitives, just Git and a database. The prompting is pretty simple. it establishes one lead agent, 999 helper agents. it gives them awareness of git and the database and the problem statement. that's really it. we want to see if this team could then do this formalization.
这只是让你大致了解一下这个运行框架。 它看起来有点复杂,但实际上相当简单。 一千个智能体中的每一个都有自己的沙盒,网络访问受到限制。 其中大部分设计都是为了保障安全与防护。 所以我们有一千个智能体,每个都有自己的沙盒。 它们可以连接到两种不同的东西:Git 和 SQL 数据库。 就是这样。 这些就是我们提供给这个团队的核心原语。 我们还进行实时监控,检查每一次工具调用是否存在越界等情况。 我们也会进行离线监控,每 10 分钟检查所有智能体的运行情况。 这大致就是整个配置。 一个由 1,000 个智能体组成的团队,原语非常简单,只有 Git 和数据库。 提示词也相当简单。 它设定了一个主智能体和 999 个辅助智能体。 它让它们了解 Git、数据库和问题描述。 基本上就是这样。 我们想看看这个团队能否完成这样的形式化工作。
What's interesting is this kind of the story of what the team did. The lead very early on, five minutes into the run, basically created these database tables. So agents now are sufficiently advanced that they can actually build primitives that they need to solve hard problems. We didn't tell them to these tables. These are the tables that the agent actually just kind of built. A table where the lead can announce things, assign roles to workers, everyone can, you know, agents can post notes, a subtask table, a table that indicates whether or not things are landed. So the lead just creates these tables to orchestrate this. and this is a visualization showing how the agents wrote to and read from these tables over the course of this run. now, red on the top is showing writes to the tables. green is showing reads. what's really interesting is you can see occasionally the lead writing to the announce table. this kind of announces major global announcements about the problem. it also assigns workers, these helpers, to different statements in this theorem as they proceed. notes are where they communicate and share kind of progress. land is where they kind of actually write the lean code as part of the proof. and so the agents all autonomously, without specific prompting, use the database in this way to coordinate their work on this extremely hard, long horizon task. this ran for around 30 hours. and for particularly challenging parts of this proof, they actually develop their own abstractions. this is actually a task tree for this Lagrange theorem. this is one of the harder statements in the proof. and this is actually showing the different dependencies of the tasks within this tree. and this is actually showing over time how the progress from like in progress to done in red. so the point of all this is really just to kind of highlight agents can solve very long horizon problems without much scaffolding. this is showing kind of the overall kind of allocation of the agents across these different tasks over the course of this run. and this kind of shows how the lead and the agents themselves kind of reallocate themselves and kind of reassign themselves to different parts of the problem. as it progresses and as these statements, there are 60 statements in this proof, are all solved. so the agents using simple primitives get and the database can coordinate themselves across this very hard problem to solve it progressively over time. that's really the key point. and you can see time progressing here. this, from one of our runs, this is one of the notes that the agents left, basically saying total freeze of the origin, effective now, magnificent work, all 999 of you. so basically, what is really interesting about this is we were able to show this formalization, which was expected to take many, many years, back in september, we showed initially we could do it with a dozen agents with a lot of scaffolding. this proved to be harness and a lot of poking and support from a researcher. this new result is showing we provide a lot of structure in terms of safety and monitoring, but the agent team was able to accomplish this task with very simple primitives without a domain-specific harness in this particular case. and agents are getting increasingly good at orchestrating themselves. and knowing how to coordinate using these simple primitives for very challenging long horizon tasks. That's really the key kind of observation, which is very interesting from this work.
有意思的是,这大致就是这个团队的工作过程。 运行开始仅五分钟,主智能体就基本上创建了这些数据库表。 现在的智能体已经足够先进,能够实际构建解决难题所需的原语。 我们并没有告诉它们要创建这些表。 这些表是智能体自己创建的。 其中有一张表供主智能体发布公告、给工作人员分配角色;每个人都可以——你知道,智能体可以发布备注;还有一张子任务表,以及一张用来标示事项是否已合并的表。 所以主智能体就创建了这些表来协调工作。 这张可视化图展示了在这次运行过程中,智能体如何向这些表写入数据并从中读取数据。 现在,顶部的红色表示对表的写入。 绿色表示读取。 真正有意思的是,你偶尔能看到主控代理向公告表写入内容。 这类公告会发布关于问题的重要全局消息。 它还会随着进展,把工作者,也就是这些辅助代理,分配到定理中的不同命题上。 notes(备注)是它们沟通和分享进展的地方。 land 是它们实际编写 Lean 代码、完成证明的地方。 因此,所有代理都能自主地、无需特定提示地,以这种方式使用数据库来协调工作,共同完成这项极其困难、需要长期投入的任务。 这次运行持续了大约30个小时。 对于证明中尤其棘手的部分,它们实际上会自行构建抽象。 这实际上是拉格朗日定理的一棵任务树。 这是证明中比较难的一条命题。 这里展示了这棵树中各项任务之间的依赖关系。 这里展示了随着时间推移,进度如何从进行中变为已完成,已完成的部分用红色表示。 所以这一切的重点,只是想强调:代理无需太多脚手架,就能解决需要长期投入的问题。 这里展示了这次运行过程中,代理在这些不同任务之间的总体分配情况。 这里还展示了主控代理和各个代理如何重新分配自己,并把自己安排到问题的不同部分。 随着进展,这个证明中的60条命题也都逐一得到了解决。 因此,代理借助简单的基本操作,再加上数据库,就能彼此协调,逐步解决这个非常棘手的问题。 这才是关键所在。 你可以看到时间在这里不断推进。 这是我们一次运行中的情况,这是智能体留下的便条之一,大意是:即刻起,彻底冻结源站;干得漂亮,你们这999位。 基本上,这件事真正有趣的地方在于,我们展示了这种形式化方法。原本预计要花很多很多年;去年九月,我们最初展示了,只需十几个智能体,再加上大量脚手架,就能做到。 这项成果证明了,离不开测试框架,以及研究人员的大量探查和支持。 这项新成果表明,我们在安全和监控方面提供了大量结构化支持,但在这个特定案例中,智能体团队仅凭非常简单的基本工具、无需针对特定领域的测试框架,就完成了这项任务。 而且,智能体越来越擅长协调彼此。 也越来越懂得如何利用这些简单的基本工具,为极具挑战性的长期任务进行协作。 这确实是这项研究中最关键、也最有意思的观察之一。
now, i want to shift gears and talk about memory, which is entirely different when i talk about in terms of multi-agent, but it's highlighting again another area where we're seeing claude gain significant capability. so previously, we talked kind of about claude's ability to orchestrate large teams to solve very long horizon problems. memory is a different capability. it's showing that claude is increasingly capable to organize this context to help solve long horizon problems. so i published an ngs blog on this fairly recently, and this is actually the lead line of the blog. i think this actually encapsulates the idea of the blog. and like one of the central ideas around memory, i think, is very interesting. and this is from the philosopher kierkegaard. so life can only be understood backwards, but it must be lived forwards. this is a fundamental paradox of agent memory, because agents write to memory typically as they go about a task. they encounter something weird or interesting, they write to memory. but memory needs to be a coherent map of an agent's knowledge that agents can look back on and reflect on. so when they're writing to memory, they're writing kind of myopically. they're looking greedily within a session saying, ah, this seems important for this task at hand. but memory needs to be something that's globally coherent and not redundant. so this is like a very tricky paradox of memory. and frankly, we as humans have the same kind of challenge. we go about our day, we write to short-term memories, believe that the hippocampus kind of is the place that that's orchestrated. at night, it's believed that the hippocampus replays to the neocortex, which is where long-term knowledge is stored. so it's believed that actually this dreaming process for humans helps consolidate the fragments or like the most important aspects of our daily experience into long-term knowledge. so there's this decomposition between daily memory and kind of long-term knowledge. And we found agents can benefit from the same decomposition. That's really the key point of the post. Now here's some results kind of telling the story. So this is actually an open source continual learning benchmark called CL Bench. and this is showing that different models, as you go from like sonnet up to like opus 5.5, get increasingly good at using memory. now, this task is a very simple setup. it asks claude to solve 40 questions about a database. in between each question, it's a fresh session, and claude can write to notes, like a memory directory, between each session. so it's kind of like a set of sequential questions, and claude can write memories to help with future questions, right? So what happens is the dark bars are showing when you give Claude the memory store and then the hash is like without memory, okay? Now what's interesting is with Sonnet four six, giving Sonnet memory, you can see in the dark blue, has very little benefit. Can't really use. and we looked into the results and we found sonnet doesn't reliably know when to write to memory. it also doesn't really naturally read from memory, okay? it's also worth noting that these experiments are done with no specific memory prompting. it just tells the agent the directory is available. use memory if you want. that's really it. so sonnet 4.6 doesn't natively use memory effectively. sonnet 5 does indeed better. opus and so on. and so basically, the models get better and better with the same simple instruction at using memory. and really, the key idea here is that what happens is with stronger models, they know intrinsically when to write to memory. and they kind of know intrinsically when to read from memory to retrieve information. their memories are also better. they're highly verified statements or predictions about the state of the database or what may happen next, versus earlier models tend to write lower quality memories. and i'll show you a very fun example of this from a different game.
现在,我想换个话题谈谈记忆。就多智能体而言,这完全是另一回事,但它再次凸显了另一个领域:我们看到 Claude 在这里也获得了显著提升。 此前,我们谈到了 Claude 协调大型团队来解决长期问题的能力。 记忆是另一种能力。 这表明 Claude 越来越有能力整理上下文,从而帮助解决长期问题。 我不久前在 NGS 博客上发表了一篇关于这个主题的文章,这其实就是那篇博客的开篇句。 我觉得这句话其实概括了那篇博客的主旨。 我认为,记忆的一个核心理念很有意思。 这句话出自哲学家克尔凯郭尔。 生活只能通过回顾来理解,却必须向前去过。 这正是智能体记忆一个根本性的悖论,因为智能体通常会在执行任务的过程中写入记忆。 它们遇到奇怪或有意思的事情,就会把它写进记忆。 但记忆必须是一张连贯的地图,呈现智能体所掌握的知识,让智能体能够回顾并反思。 所以,当它们写入记忆时,往往只会着眼于眼前。 它们会在单次会话中贪心地搜寻,心想:啊,这对当前任务似乎很重要。 但记忆需要整体连贯,而且不能冗余。 所以,这就像是记忆中一个非常棘手的悖论。 坦白说,我们人类也面临着同样的挑战。 我们每天活动时,会写入短期记忆;人们相信,这个过程是由海马体协调的。 人们认为,到了夜间,海马体会向新皮层重放记忆,而长期知识就储存在新皮层中。 所以,人们认为,这种做梦的过程实际上能帮助人类把日常经历中的片段,或者说最重要的部分,整合成长期知识。 因此,日常记忆和长期知识之间存在这种分化。 我们发现,智能体也能从同样的分化中受益。 这确实是这篇文章的关键所在。 下面来看一些结果,它们讲述了这一过程。 这是一个名为 CL Bench 的开源持续学习基准测试。 图中显示,不同模型从 Sonnet 到 Opus 5.5,使用记忆的能力越来越强。 现在,这项任务的设置非常简单。 它要求 Claude 回答有关一个数据库的 40 个问题。 每个问题之间都会开启一个全新的会话,而 Claude 可以在会话之间把内容写入笔记,比如一个记忆目录。 所以,这有点像一系列按顺序提出的问题,而 Claude 可以写入记忆来帮助回答之后的问题,对吧? 结果是,深色柱表示给 Claude 提供记忆库,而网纹柱则表示不提供记忆,好吗? 有意思的是,对于 Sonnet 4.6,给它提供记忆后,你可以从深蓝色柱看到,几乎没有什么收益。 不太能用。 我们查看了结果,发现 Sonnet 并不能可靠地判断何时该写入记忆。 它也不太会自然而然地从记忆中读取信息,对吧? 还值得一提的是,这些实验没有使用任何特定的记忆提示。 只是告诉智能体有这个目录可用。 想用记忆的话就用。 就这么简单。 所以 Sonnet 4.6 本身并不能有效地使用记忆。 Sonnet 5 确实做得更好。 Opus 等模型也是如此。 基本上,在同样简单的指令下,模型使用记忆的能力越来越强。 说到底,关键在于:随着模型变强,它们会本能地知道何时该写入记忆。 它们也会本能地知道何时该读取记忆来检索信息。 它们记录的记忆也更好。 这些记忆是经过充分验证的陈述,或是对数据库状态、未来可能发生之事的预测;而早期模型往往会写下质量较低的记忆。 我还会给你们看一个来自另一款游戏的有趣例子。
this is from pokemon. so this is showing you claude 3.7's memory directory from pokemon versus fable 5. here is the key point. the size of each box indicates the number of memory files in each of these directories. okay. so when we have claude pay pokemon, we give claude a memory directory, just like i did in that prior benchmark, right? Claude can write whatever it wants that directory while plays the game. What's really interesting is sonnet 37. We see it writes a huge amount to memory and when you look at the memories, it's indiscriminate. It's basically writing down all sorts of experience. It creates this huge unwieldy, just disgusting memory directory of things that are not really relevant or strategic for gameplay. and it proceeds much worse in the game than fable 5. fable 5's memory directory is much tighter. it's really strategic insights, tactical knowledge, things you can't just get from game state very easily. so what we see is better models have much better instincts for salience and what to write to memory. and you can see this reflected in the size of the memory directories. it's much tighter. it's much more strategic and gameplay, indeed, with fable 5, gets much further than sonic 3-7. so it gives another intuition around the fact that claude is much better at writing to memory, knowing kind of what to write in salience and what's salient, and also kind of using and reading from memory. so models are getting more and more kind of effective at knowing salience, knowing what to write, and also reading. now, both of these represent what i would consider, in my initial framing, of like writing to memory during experience. so basically, in both of these tasks, we let claude write to memory while it plays this game. we let claude write to memory while it does the clbench benchmark.
这是《宝可梦》的例子。 这里展示的是 Claude 3.7 在《宝可梦》中的记忆目录,与 Fable 5 的记忆目录对比。 重点如下。 每个方框的大小表示相应目录中的记忆文件数量。 好的。 所以,当我们让 Claude 玩《宝可梦》时,会给 Claude 一个记忆目录,就像我在之前的基准测试中做的那样,对吧? Claude 可以在玩游戏时,随心所欲地往那个目录里写入内容。 真正有意思的是 Sonnet 3.7。 我们看到它往记忆里写了大量内容,而你查看这些记忆时,会发现它毫无选择。 它基本上把各种经历都记了下来。 它创建了一个庞大、难以管理,简直糟糕透顶的记忆目录,里面都是对游戏过程并不真正相关或有策略价值的内容。 而且它在游戏里的表现远不如 Fable 5。 Fable 5 的记忆目录精简得多。 里面确实是一些策略见解、战术知识,以及那些很难仅凭游戏状态轻易获取的信息。 所以我们看到,更好的模型对重要性有更好的直觉,也更清楚该把什么写入记忆。 这一点也能从记忆目录的大小上看出来。 它精简得多。 它在策略性和游戏玩法方面都更出色;事实上,Fable 5 在游戏中也比 Sonic 3.7 走得更远。 所以,这又从一个方面说明了,Claude 更擅长写入记忆,知道该写什么、什么内容重要,也更擅长利用和读取记忆。 因此,模型越来越擅长判断重要性、知道该写什么,也越来越擅长读取记忆。 现在,在我最初的框架中,这两种情况都属于我所说的“在经历过程中写入记忆”。 也就是说,在这两项任务中,我们都让 Claude 一边玩这个游戏,一边写入记忆。 我们让 Claude 一边进行 CLBench 基准测试,一边写入记忆。
But as I mentioned, there's also the dreaming side of memories. This is allowing Claude to reflect over memories to fix things. And I'll show some interesting examples of that. this is kind of a framing of dreaming. and so you can think about memory in terms of there are transcripts. transcripts you can think about as kind of the foundation of memory. so imagine a memory system could very simply be just transcript search. claude writes a transcript as it goes about a task. future session can read from the transcript. of course, transcripts are large. it's very unwieldy. we talk a lot about in the blog post the fact that transcripts often contain information that, you know, a very, very small amount of information in transcripts is actually salient and matters. so we also allow claude to do things like writing memory notes. also, i just talked about as it goes, it can write notes to memory. but dreaming lets you do more. dreaming lets you reflect over transcripts and these written notes and re-represent them. build memory representations like wikis as an example. actually promote certain memories to injected context and load it preemptively into every future session. so memory is this, dreaming is this mechanism where you can kind of process existing transcripts or existing memory notes and build new things from them, including representations, injected contexts, and more. so some fun examples of this.
不过,正如我提到的,记忆还有“梦境”这一面。 这让 Claude 能够回顾记忆并修正问题。 我会展示一些有趣的例子。 这可以看作是对“做梦”的一种界定。 你可以这样理解记忆:其中包含一些记录文本。 你可以把记录文本看作记忆的基础。 想象一下,一个记忆系统可以非常简单,就是搜索记录文本。 Claude 执行任务时会写下记录文本。 后续会话可以读取这些记录文本。 当然,记录文本很长。 处理起来很麻烦。 我们在博客文章中谈了很多这个事实:记录文本往往包含大量信息,而其中真正重要、值得关注的内容只占很小一部分。 因此,我们也允许 Claude 做一些事情,比如编写记忆笔记。 正如我刚才提到的,它可以在执行过程中把笔记写入记忆。 但“做梦”能让你做得更多。 “做梦”让你能够回顾记录文本和写下的笔记,并重新组织呈现它们。 例如,构建类似维基的记忆表示。 还可以将某些记忆提升为注入上下文,并预先加载到每个后续会话中。 所以,记忆就是这些内容;而“做梦”是一种机制,你可以借此处理现有的记录文本或记忆笔记,并从中构建新内容,包括各种表示、注入上下文等等。 下面是一些有趣的例子。
this is from pokemon gameplay. dreaming is an effective way to correct mistakes in memory. so as i talked about, when Claude's going about a task, it can write incorrect notes to memory. just, it makes a mistake. this happened in this particular game. claude wrote, incorrectly wrote the location of a particular landmark in the game. now what happened is with this incorrectly written memory, Claude got trapped in a loop where basically it would mislocated itself at this particular point in the game fall down this trap door and it would basically send it back to the prior level. That's like the high level intuition. The details aren't that interesting or important. The key idea is a poison memory was injected and it's stuck there. Dreaming can rescue that that's really the intuition on why dreaming is extremely powerful for reflecting over memories and correcting them. So this is showing some trajectories of the game where orange is memory and dreaming. Up is good. So basically up represents game progress and down represents kind of game regression. And what's interesting is raw memory, basically without dreaming, we can see crashes out. a incorrect memory is planted and claude continues to basically regress or fall in the game when it hits that particular point. we're dreaming it rescues that mistake. claude proceeds to the next level. that's really the key observation. and this is a very general principle that claude can use dreaming to correct mistakes in memory that are otherwise stuck there. it's a very important way you can kind of correct from errors.
这是来自《宝可梦》游戏过程的例子。 做梦是纠正记忆错误的有效方式。 正如我刚才提到的,Claude 执行任务时,可能会把错误的笔记写入记忆。 它就是会犯错。 这在这个特定的游戏中就发生过。 Claude 写下了——准确地说,是错误地写下了游戏中某个地标的位置。 结果是,带着这条错误记忆,Claude 陷入了循环:它会在游戏中的某个位置把自己定位错,然后掉进活板门,基本上就被送回了前一个关卡。 这就是大致的直观理解。 具体细节没那么有趣,也不那么重要。 关键在于,有一条有害记忆被植入了,而且一直留在那里。 做梦可以挽救这种情况。这就是为什么做梦对于反思记忆并纠正记忆极其强大的直观原因。 这里展示的是游戏中的一些轨迹,橙色代表记忆和做梦。 越往上越好。 基本上,向上代表游戏进度,向下则代表游戏进度倒退。 有意思的是,在没有做梦的情况下,只靠原始记忆,我们可以看到它会崩溃。 一条错误记忆被植入后,Claude 到了那个特定位置就会继续倒退,或者说在游戏中不断后退。 做梦能帮它纠正这个错误。 Claude 继续进入下一关。 这才是关键的观察结果。 这是一个非常普遍的原理:Claude 可以通过做梦来纠正记忆中的错误,否则这些错误会一直留在那里。 这是纠正错误的一种非常重要的方式。
Now, this is another fun example of building representations in memory. So there's been a lot of interest in wikis as kind of general, um, kind of ways that Claude can organize knowledge. This is a really fun example, uh, from we acquired a company Stainless back in May. and we had access to the company corpus, all its documents and slack messages and so forth. and we anonymized things and we built kind of a data set from it, which allowed us to test dreaming. so what we did was we created kind of an email set of 25 questions about the company that can only be answered from this corpus. we allow claude to build a wiki from this information to help it answer questions. what you see is we compare a raw search tool that's just like some kind of semantic search over this documentation. we compare that as a baseline, which does reasonably well. you can see it's like 53% just for search. we also test letting claude build a wiki over this knowledge. you can see as you push, you add more and more dreaming tokens, the wiki gets better and better and better, allowing claude to answer questions. so claude natively can kind of build up over time a representation of this kind of corpus of knowledge through a wiki. and as you add more dreaming, the wiki gets more and more useful. we think there's a really nice mental model to think about how agents can kind of build knowledge over time. they can be given access to kind of raw corpora of texts, of transcripts, and they can kind of build these representations that allow them to search those contexts much more easily to answer questions. to connect their knowledge in effective ways. we also find that adding the wiki and the search tool together actually bumps further beyond just raw search. so it's kind of another intuition that basically claude can also build representations like wikis in its kind of memory in order to help it kind of solve problems. And a final example, this is from a different benchmark, but this is showing two different wikis that Claude built.
这是另一个很有趣的例子,展示了如何在记忆中构建表征。 大家一直对维基很感兴趣,因为它可以作为一种通用方式,让 Claude 组织知识。 这是一个非常有趣的例子。我们在五月收购了一家名为 Stainless 的公司。 我们因此得以访问该公司的语料库,包括所有文档、Slack 消息等等。 我们对内容进行了匿名化,并据此构建了一个数据集,让我们能够测试“梦境”机制。 我们做的是创建一组类似邮件的内容,其中包含 25 个关于公司的问题,这些问题只能通过这个语料库来回答。 我们让 Claude 根据这些信息构建一个维基,帮助它回答问题。 你看到的是,我们将它与一种原始搜索工具进行比较,这种工具只是在这些文档上做某种语义搜索。 我们把它作为基线进行比较,它的表现相当不错。 你可以看到,单靠搜索的准确率大约是 53%。 我们还测试了让 Claude 基于这些知识构建维基。 你可以看到,随着不断增加“梦境”令牌,维基变得越来越好,帮助 Claude 更好地回答问题。 因此,Claude 可以自然而然地随着时间推移,通过维基逐步构建出对这类知识语料库的表征。 随着“梦境”机制不断发挥作用,维基也会变得越来越有用。 我们认为,这是一个非常好的心智模型,可以帮助我们理解智能体如何逐渐积累知识。 它们可以访问原始文本语料库、转录稿等,并逐步构建这些表征,从而更轻松地搜索这些上下文并回答问题。 以有效的方式关联它们掌握的知识。 我们还发现,同时加入维基和搜索工具,效果实际上比单纯的原始搜索更好。 所以,这也提供了另一种直觉:Claude 也可以在自己的记忆中构建类似维基的表征,以帮助它解决问题。 最后一个例子来自另一个基准测试,它展示了 Claude 构建的两个不同维基。
So this is prior to dreaming and after dreaming. what we saw is when claude was building wikis, in this particular case, there were some gaps. and for example, this initial wiki had a bunch of placeholders for pages that didn't exist. this can happen when claude's kind of building different memory representations. and without dreaming compute, there may not be opportunities to rescue or fix those errors. that we saw is when we ran dreaming. dreaming can look over claude's existing representation, like for example, a wiki, and can fill in mistakes. so in this case, it fills in all the missing gaps. it creates an index. and so, again, dreaming is a way that claude can reflect and kind of apply compute across its memory to improve it by correcting mistakes, like i talked about, by filling in gaps in its knowledge, like we see here, or, for example, by creating new representations like wikis. Um, so with that, i thank you all for listening and i will be at the anthropic booth. So please come see me and happy to talk about any of this.
所以,这是做梦之前和做梦之后。 我们看到的是,Claude 在构建维基时——在这个具体案例中——出现了一些缺漏。 例如,这个最初的维基里有很多指向不存在页面的占位符。 当 Claude 构建不同的记忆表示时,就可能出现这种情况。 如果没有用于做梦的计算资源,可能就没有机会挽救或修正这些错误。 我们看到的是运行做梦之后的情况。 做梦可以检查 Claude 现有的表示,比如维基,并修正其中的错误。 所以在这个例子中,它补上了所有缺失的部分。 它创建了一个索引。 所以,做梦是 Claude 反思并将计算应用于自身记忆的一种方式,从而改进记忆:它可以像我刚才说的那样纠正错误,填补知识中的空缺——就像我们在这里看到的那样——或者创建维基这类新的表示。 嗯,感谢大家聆听。我会在 Anthropic 展位。 欢迎来找我,我很乐意聊聊这些内容。
演讲围绕 Claude 的两类长程能力展开。第一部分讲述千名智能体如何在约 30 小时内,借助 Lean、Git 和 SQL 数据库协作完成费马大定理的形式化;团队没有使用数学领域专用编排工具或人工引导解题,主智能体自行建立协调表,成员随任务进展分工与重分配。第二部分讨论记忆:模型需要筛选值得记录的信息,也要在事后整理零散记忆。演讲以基准测试、宝可梦游戏和公司知识库为例,说明更强模型更会利用记忆,而“梦境”式回顾能纠正错误、补齐知识并构建 wiki 等结构化表示。
费马大定理断言:当正整数指数 n 大于 2 时,aⁿ+bⁿ=cⁿ 没有正整数解。安德鲁·怀尔斯在 20 世纪 90 年代给出了证明,耗时七年;之后数学界持续尝试将证明形式化,即用 Lean 等系统逐步计算验证逻辑。此前的形式化尝试使用约十几个智能体,并依靠 ProofToMe 这类数学证明编排平台和研究人员支持。新的尝试要检验:能否把规模扩大到约一千个智能体,在不使用领域专用工具、也不由人类引导解题的情况下完成形式化。
每个智能体都在具有限制网络访问的独立沙箱中运行,核心协作工具只有 Git 和 SQL 数据库;系统另设实时工具调用监控和每十分钟一次的离线运行监控。提示词只指定一名主智能体和 999 名辅助智能体,提供问题陈述及 Git、数据库的使用方式,没有附加复杂的解题编排。
运行开始约五分钟后,主智能体自行创建数据库表,用于发布公告、分配角色与子任务、共享进展笔记,以及标记 Lean 代码是否已合并。智能体自主用这些表协调工作,并为困难证明部分建立任务树及依赖关系;随着约 60 个证明陈述逐步解决,主智能体和辅助智能体会重新分配到不同任务。整个过程持续约 30 小时,展示了简单工具如何支撑长程协作,而无需数学领域专用编排脚手架。
智能体通常在任务进行中记录信息,容易依据眼前需求作出局部、重复的判断;但有用的记忆应当整体连贯、去除冗余,并便于未来检索。演讲以人类睡眠中海马体向新皮层重放经验的理论作类比,将日常记忆与长期知识整理区分开来。CL Bench 的设置是在 40 个数据库问题之间开启全新会话,模型可在会话间写入记忆目录。实验显示,较早的 Sonnet 4.6 不太会判断何时写入或读取记忆,而更强模型在同样简单的提示下使用得更有效,也更倾向于记录经过验证的数据库状态或预测。
宝可梦游戏中的记忆目录对比显示,Claude 3.7 Sonnet 会写入大量零散经历,形成庞大且不易使用的目录,其中不少内容与策略无关,游戏进展也不如 Fable 5。Fable 5 的记忆更精简,集中在游戏状态不易直接获得的战术知识和策略要点,并能推进到更远阶段。这个例子体现出较强模型更善于判断信息的显著性,也更会选择写入和读取哪些记忆。
即时记忆之外,模型还可以对已有记录进行回顾与整理。对话转录是记忆的基础,但内容庞大且真正重要的信息只占很小一部分;模型也可在任务过程中写下记忆笔记。“Dreaming”则进一步处理转录和笔记,重新组织信息,生成 wiki 等表示,或把重要记忆预先注入未来会话,使零散材料成为更易使用的知识结构。
在宝可梦游戏案例中,Claude 曾把某个地标的位置记错,之后依据这条错误记忆反复误判位置、掉入陷阱并退回前一关,形成持续回退的循环。单靠原有记忆无法脱困;对记忆进行 dreaming 后,错误得到纠正,模型得以继续推进到下一关。回顾机制因此不仅能整理信息,也能修复会持续影响后续行动的有害记忆。
公司知识库实验使用了 Stainless 的文档、Slack 消息等资料,并对内容进行匿名化,设置 25 个只能根据这些资料回答的问题。仅用语义搜索的基线准确率约为 53%;让 Claude 基于资料构建 wiki 后,随着投入更多 dreaming 计算,wiki 对答题的帮助逐步提升。将 wiki 与搜索工具结合,表现又超过单独使用原始搜索。实验说明,模型能够从原始文本语料构建关联知识表示,帮助后续检索和回答。
另一项基准测试中,初始 wiki 存在缺失页面和占位内容,反映知识表示可能留下未填补的空缺。经过 dreaming,Claude 能回看已有 wiki、修正错误、补齐缺漏并创建索引。对记忆投入额外计算,可以用于纠错、填补知识空白,也可以建立新的结构化表示。
03:58 在该费马大定理形式化任务中,千名智能体仅凭 Git 和数据库等简单工具,也能自主建立协作机制并随进展重新分配任务。
10:29 更强的模型更能判断何时写入、何时读取记忆,并倾向于保存更有用、更具验证性的内容。
17:50 Dreaming 能回顾并重新组织既有记忆,从而纠正错误、补齐知识缺口,并建立便于检索的结构化表示。