LLM 不擅长设计 AI 系统
原题LLMs are terrible at designing AI systems
推荐理由Sean Goedecke 用记忆系统和分类案例解释智能体如何选错架构,帮助开发者把审查重点从代码正确性推进到方案合理性。
读前速览
作者认为,LLM 难以设计 AI 系统,因为它们往往默认采用过时的符号方法,而不是利用其他 LLM,这暴露出它们在软件设计能力上的根本短板。
在 AI 系统设计任务中,LLM 往往默认采用复杂的符号方法,而不是使用其他 LLM。
当被要求提出最先进的解决方案时,LLM 常会建议采用答案集编程等过时的符号方法,而不是直接利用 LLM;即使符号方法从根本上存在缺陷,也依然如此。
LLM 出现前的训练数据和强化学习环境可能会抑制 LLM 之间的代码生成。
大多数训练代码都早于 LLM;强化学习环境也可能缺少必要的 API 访问权限,无法让 LLM 调用其他 LLM,因此训练过程可能会抑制这种能力。
当前 AI 智能体存在根本性的软件设计局限,而不只是对齐问题。
它们倾向于选择注定失败的方法,例如复杂的共识算法,而不是更简单的解决方案;这表明问题确实出在 AI 软件设计能力不足,而非仅仅是对齐不当。
要用好 LLM,就必须预测它们在哪些方面擅长或容易失败。
作者强调,能否从 LLM 身上获得价值,取决于是否了解它们难以预测的优势与弱点;如果走错方向,就会浪费大量时间和资源。
完整摘要
文章探讨了 LLM 为何不擅长设计由 LLM 驱动的 AI 系统。文中举例说明,LLM 会选择复杂的符号方案,而不是简单的基于 LLM 的方法;作者还分析了三种可能的原因:LLM 出现前的训练数据带来的偏向、强化学习环境不鼓励 LLM 调用其他 LLM,以及更深层的问题——当前 AI 智能体缺乏良好的软件设计能力。作者最后指出,要有效地与 AI 协作,关键在于了解 LLM 的优势与弱点。
目录 · 3 节
LLM 不知道如何设计使用 LLM 的软件。它们很擅长编写普通程序,但如果你把一个 AI 特性的问题交给它们,它们通常会搞砸。为什么会这样?LLMs don’t know how to design software that uses LLMs. They’re comfortable writing normal programs, but if you throw an AI-shaped problem at them, they will usually screw it up. Why is that?
深入符号学的兔子洞Going down the symbolic rabbit hole
例如,这篇帖子描述了一次尝试:通过氛围编程构建一个记忆工具,在某条记忆与另一条记忆相矛盾时发出标记¹。这是一个很好的例子,说明有些任务在五年前几乎不可能完成,而如今借助 LLM 却相对轻而易举。你只需让 LLM 扫描矛盾,既可以一次处理一大批内容,也可以逐对检查²。For example, this post describes an attempt to vibe-code a memory tool that would flag when one memory contradicted another1. This is a great instance of a task that was virtually impossible five years ago but is now relatively trivial due to LLMs. You can simply task a LLM with scanning for contradictions, either in a big batch or pairwise2.
然而,当被问及“最先进”的方法³时,这个案例中的 AI 智能体并没有推荐使用 LLM。它开始构建一个复杂得令人眼花缭乱的符号系统,将记忆条目转换为结构化的逻辑原子,然后用求解器对它们进行机械式比较。当然,这行不通,也不可能行得通,因为不存在一种分析方法,能够判定任意两句自然语言句子是否表达了同一个命题。However, when asked for the “state of the art” approach3, the AI agent in this case did not recommend LLMs. It started building a bewilderingly complex symbolic system to convert the memory items into structured logical atoms, then mechanically compare them with a solver. This, of course, did not and could not work, because there is no analytic way of determining whether any two natural-language sentences express the same proposition.
这个大语言模型明明知道这根本不可能!用户最终失去耐心,问道:“嘿,为什么这玩意儿就是不管用?”Claude 却立刻解释说,这是一个已知的、存在了 130 年且无解的问题。可即便如此,它还是乐此不疲地在这条死胡同里兜兜转转,反复尝试了好几个星期。The LLM knew this was impossible! When the user eventually lost patience and said “hey, why isn’t this working”, Claude immediately explained that this was a known 130-year-old problem with no solution. And yet it happily went around and around for weeks iterating on a dead end.
我自己也遇到过这种情况。在构建 Autodeck(AI 生成的间隔重复卡片)时,我的智能体经常会试图通过正则表达式或关键词搜索来给卡片分类,而不是直接再调用一次 LLM。I’ve run into this myself. When I was building Autodeck (AI-generated spaced repetition cards) my agents would routinely try to categorize cards by regex or keyword search instead of just making another LLM call.
为什么 LLM 无法正确使用 LLM?Why can’t LLMs use LLMs correctly?
这为什么会发生?我想到两个显而易见的解释,还有一个更深层的原因。Why would this be happening? I have two obvious explanations and one deeper one.
第一个显而易见的解释是,大多数训练代码都早于 LLM。假设实验室没有把当前这波垃圾代码仓库直接喂给模型⁴,那么模型学习到的绝大多数代码都是在 LLM 成为一种选择之前编写的。因此,它们会采用非 LLM 的方法也就说得通了,就像它们会选择 jQuery 而不是现代原生 JS,或者选择 Backbone.js 而不是 React,对吧?其实不对!LLM 并不会选择 jQuery 和 Backbone。训练过程中,无论是什么机制让它们在其他领域倾向于采用较新的知识,都没能成功让它们转向 LLM,因此这不可能是全部原因。The first obvious explanation is that most training code is pre-LLMs. Assuming the labs aren’t feeding the current avalance of slop repositories directly into the models4, the vast majority of the code that models learn from was written before LLMs were an option. So it would make sense that they’d reach for non-LLM approaches, in the same way that they’d reach for jQuery over modern vanilla JS, or Backbone.js over React, right? Wrong, actually! LLMs don’t choose jQuery and Backbone. Whatever part of the training process pushes them towards up-to-date knowledge in other areas isn’t successfully pushing them towards LLMs, so this can’t be the whole story.
第二个显而易见的解释是,RLVR 并不是编写调用 LLM 的代码的理想环境。LLM 在训练过程中,有很大一部分时间都花在强化学习环境中,由自动评分器来评估它们的表现(例如,运行它们编写的代码并检查输出)。我并不确定这一点,但如果这些环境中包含供 LLM 调用其他 LLM 的凭据和 API 访问权限,我会感到惊讶⁵。因此,即使预训练后的 LLM 乐于编写这类代码,强化学习过程也可能会抑制它这样做⁶。The second obvious explanation is that RLVR is not a good environment to write code that calls LLMs. Much of the time LLMs spend training is spent in reinforcement learning environments where an automatic grader determines their performance (for instance, by running some code they wrote and checking the outputs). I don’t know this for a fact, but I would be surprised if these environments contained the credentials and API access for a LLM to call other LLMs5. So even if the pretrained LLM was comfortable writing that kind of code, the reinforcement learning process might discourage6 it from doing so.
第三种解释,也是我最喜欢的一种,是当前的 AI 智能体只是不太擅长软件设计。按照这种解释,选择一种注定行不通的符号方法,而不是直接调用 LLM,并非什么怪异的反常行为,而是 AI 智能体选错工具的常见情况。我也在其他场景中见过 LLM 出现这种行为:试图构建复杂(且注定失败)的共识算法,而不是容忍数据过时;在事件驱动系统中引入同步检查,等等。过去我一直把这些归因于对齐问题,但我也愿意接受另一种可能:它们不过是普通的软件设计错误。The third explanation, which I like the most, is that current AI agents are just not very good at software design. On this explanation, picking a doomed symbolic approach instead of simply calling a LLM is not a weird aberration but a normal instance of AI agents picking the wrong tool for the job. I’ve seen this behavior from LLMs in other contexts too: trying to build complex (and doomed) consensus algorithms instead of tolerating stale data, introducing synchronous checks in event-driven systems, and so on. In the past I’ve chalked these up to alignment, but I’m open to the idea that they’re just ordinary errors of software design.
结论Conclusion
我一再学到的一课是,不能用评判人类的标准来评判 LLM。任何有能力实现复杂符号求解器的人类程序员,都知道这种方法行不通;所以,如果他们提出这种方案,我会认为⁷他们一定有充分的理由。只有 LLM 才可能既聪明到足以犯这种错,又愚蠢到会犯这种错。One lesson I learn over and over again is that I can’t judge a LLM by the standards of a human. Any human programmer who was capable of implementing a sophisticated symbolic solver would know that it wouldn’t work, and so if they suggested that approach I’d assume7 they had a good reason. Only a LLM could be both smart enough and dumb enough to make this mistake.
我经常撰写与大语言模型高效协作所需技能相关的内容。对于我在 2025 年 2 月写下的观点,我至今仍然坚持:I write a lot about the skills that are involved in working effectively with LLMs. I still stand by what I wrote in February 2025:
善用大型语言模型,意味着从其擅长之处获取价值,并避免在其不擅长之处浪费时间。Using LLMs well involves extracting value from what they’re good at and avoiding wasting time at what they’re bad at.
这出乎意料地难,原因就在上面那一点。LLM 的表现好坏似乎毫无规律:它们有时会勤勤恳恳地工作好几个小时,有时却会敷衍得令人震惊;它们能调用广博得非人类般的专业知识,却连最基本的常识都无法运用;它们可以成功重写极其复杂的程序,却常常在设计上犯下非常愚蠢的错误。This is surprisingly hard, because of the point above. LLMs are good and bad seemingly at random: they will work hard for hours but sometimes be shockingly low-effort, they will draw on inhumanly broad expertise but fail to apply the most basic common-sense, they can successfully rewrite enormously complex programs but will often make very silly errors in design.
如果你能提前预测它们在哪些方面会表现出色或不佳,就能从大语言模型中获得巨大价值;如果不能,你很可能会在行不通的方案上浪费大量时间和令牌。If you can predict where they will do well or badly ahead of time, you can get enormous value from LLMs; if you can’t, you will likely waste a lot of time and tokens going down hopeless approaches.
- 这是另一个例子:用户“暗示”Opus 5.5 应该使用裁判模型,但它却构造了一系列正则表达式检查。↩
- 这里我可能会采用一个决策模型。↩
Here I’d probably reach for a decision model.
↩ - 事后看来,这大概是关键错误,虽然我不知道该如何把它转化成给非技术型氛围编程者的建议。不询问智能体该领域的现状也是个错误。再给“LLM会奖励专业知识”这条腰带添上一格。↩
In hindsight, this was probably the key mistake, though I don’t know how you’d turn that into advice for non-technical vibe-coders. Never asking the agent about the state of the field is a mistake too. Put one more notch on the LLMs reward expertise belt.
↩ - 我认为这是一个合理的推断:尽管使用低质量合成数据训练显然不会对 LLM 造成灾难性影响,但肯定也不是什么好事。↩
A fair assumption, I think: even though training on low-quality synthetic data clearly isn’t catastrophic for LLMs, it can’t be great.
↩ - 这会很昂贵、耗时,而且有风险。 ↩
It would be expensive, slow, and risky.
↩ - 这一理论也解释了为什么 LLM 擅长为其他 LLM 编写提示词、将其用作子代理,或从头训练 LLM:它们很可能直接在这些方面接受了强化学习训练和评估,而编写调用 LLM 的代码则不然。↩
This theory also explains why LLMs are great at prompting other LLMs as subagents, or on training LLMs from scratch: they’re likely directly RL-ed and evaluated on that, unlike on writing code that calls LLMs.
↩ - 好吧,我不会——不过我自负到还是会问——但至少希望能有个充分的理由。↩
Well, okay, I wouldn’t — I’m arrogant enough to ask anyway — but I’d at least expect a good reason.
↩
如果你喜欢这篇文章,可以订阅邮件更新,了解我的新文章,也可以在 Hacker News 上分享。If you liked this post, consider subscribing to email updates about my new posts, or sharing it on Hacker News.
这是相关帖子的预览,它与这篇帖子共享标签。Here's a preview of a related post that shares tags with this one.
你没有哪些需求?在设计软件时,你没有的需求和你有的需求同样重要。明确哪些方面可以妥协——哪些可以慢一些、陈旧一些或不够灵活——通常是设计优雅方案的关键。比如,看看 Unicorn 这类预派生式 Web 服务器。由于它们不具备服务器实例之间共享可变状态的功能,因此可以让每个服务器运行在独立进程中,从而轻松实现隔离。由于 Unicorn 特意不处理客户端处理速度慢这一问题,它可以直接在 Unix 套接字上对请求进行排队,大幅简化实现。继续阅读……What requirements don't you have?
When designing software, the requirements you don’t have are as important as the requirements you do. Identifying what you can compromise on — what can be slow, or stale, or inflexible — is usually the key to an elegant design.
For instance, take preforking web servers like Unicorn. Because they lack the feature of shared mutable state between server instances, they can run each server in its own process, which provides isolation for free. Because Unicorn specifically ignores the problem of slow client handling, it can queue requests directly on Unix sockets, drastically simplifying the implementation.
Continue reading...