智能体能为智能体设计库吗?

·

研究论文 · 2026/10/01

智能体日益依赖其他智能体编写的代码,但倾向于重新实现而非复用,导致代码库膨胀。为衡量智能体为其他智能体设计库的能力,我们提出LibraryDesignBench,一个两阶段基准:智能体根据定义所需能力和潜在用例但不规定设计的规范,实现一个功能完整的库。我们通过三个来自不同模型家族的用户智能体编写的程序的正确性和简洁性来评估该库。该基准涵盖四种语言的15个库设计任务中的242个专家验证的编程问题。在15个任务中的11个上,智能体设计者复现了人类编写的生产库的抽象。下游智能体同样采用智能体和人类编写的库,但使用不足,重新实现了库已提供的功能。我们的失败分析发现,下游智能体编写额外代码主要是因为智能体编写的库僵化或难以使用,而非缺少功能。我们还尝试为设计者提供更具规定性、智能体优先的指导,并让它们用子智能体测试其库;这提高了下游得分并产生了更简单的程序。LibraryDesignBench既为评估面向智能体用户的库设计实践提供了测试平台,也提供了一个改进下游复用的初始设计基线。

该研究首次系统性地评估智能体为其他智能体设计库的能力,揭示了当前智能体在库复用上的不足及其原因,并提出了改进方向,对提升多智能体系统的代码复用和协作效率具有重要意义。

Agents increasingly build on code written by other agents, and they reimplement rather than reuse, growing the codebases later agents must work in. To measure how well agents design libraries for other agents, we introduce LibraryDesignBench, a two-phase benchmark in which an agent implements a full-featured library from a specification that defines required capabilities and potential use cases without prescribing the design. We evaluate the library through the correctness and simplicity of programs written by three user agents from different model families. The benchmark spans 242 expert-validated programming problems across 15 library-design tasks in four languages. On eleven of the fifteen tasks, agent designers reproduce the abstractions of the human-written production library. Downstream agents adopt agent- and human-written libraries alike but underuse them, reimplementing capabilities the library already provides. Our failure analysis finds that downstream agents write extra code mainly because agent-written libraries are rigid or hard to use, not because capabilities are missing. We also experiment with giving designers more prescriptive, agent-first guidance and having them test their library with subagents; this improves downstream scores and yields simpler programs. LibraryDesignBench provides both a testbed for evaluating library-design practices for agent users and an initial design baseline that improves downstream reuse.

阅读原文

参与讨论