Hacker News 中文摘要

RSS订阅

我们委托Opus 4.6利用代理团队构建C编译器 -- We tasked Opus 4.6 using agent teams to build a C Compiler

文章摘要

研究人员尝试用16个Claude AI并行协作,在无人干预下开发了一个能编译Linux内核的C编译器。该项目耗费近2000次会话和2万美元成本,最终产出10万行代码。实验探索了如何设计测试框架让AI团队自主工作、并行协作的机制,以及这种方法的局限性。

文章总结

标题:用并行Claude团队构建C编译器

作者:安全团队研究员Nicholas Carlini

核心内容:

  1. 实验方法
  • 采用"智能体团队"新方法,让多个Claude实例在共享代码库上并行工作
  • 测试案例:16个智能体协作开发基于Rust的C编译器,最终产出10万行代码
  • 项目耗时:近2000次Claude Code会话,花费2万美元API成本
  1. 技术实现
  • 开发自动化框架使Claude持续工作:
    • 无限循环脚本保持任务连续性
    • 容器化部署确保环境隔离
  • 并行处理机制:
    • 基于Git的简单同步算法
    • 文件锁机制避免任务冲突
    • 自动合并代码变更
  1. 关键发现
  • 测试体系设计:
    • 需要极高质量的测试用例
    • 采用GCC作为参考编译器进行对比验证
  • 模型特性适配:
    • 解决上下文窗口污染问题
    • 克服时间感知缺失缺陷
  • 团队分工优化:
    • 不同智能体专注代码优化/文档维护等专项任务
    • 针对Linux内核编译调整并行策略
  1. 成果评估
  • 产出编译器能力:
    • 支持x86/ARM/RISC-V架构
    • 可编译Linux 6.9内核
    • 通过GCC torture测试套件99%用例
  • 现存局限:
    • 16位x86支持不足
    • 生成代码效率较低
    • 部分工具链组件仍依赖GCC
  1. 行业启示
  • 展示了LLM自主完成复杂项目的潜力
  • 需要建立新的质量保障机制
  • 技术发展速度超出预期(原认为2026年才可能实现)

注:原文中具体代码片段、过细的技术实现细节及致谢部分等非核心内容已做精简处理。

评论总结

以下是评论内容的总结,平衡呈现不同观点并保留关键引用:

正面评价

  1. 技术成就值得肯定

    • 认为能编译Linux内核是重大突破,远超之前浏览器项目的失败案例
      "This is like a working version of the Cursor blog... much more impressive than a browser" (OsrsNeedsf2P)
      "building a such a complex project like a C compiler on a 20k $ budget in full autonomy is quite impressive" (epolanski)
  2. 实验设计严谨

    • 强调干净室实现、多架构支持和真实项目测试
      "clean-room implementation... can build Linux 6.9 on x86, ARM, and RISC-V" (NitpickLawyer)
      "passes the developer's ultimate litmus test: it can compile and run Doom" (btown)

负面批评

  1. 代码质量低下

    • 指出生成代码效率甚至低于GCC -O0,维护性差
      "Worse than '-O0' takes skill... an equivalent of which one man can produce in under two weeks" (dmitrygr)
      "why x9? who knows?!" (dmitrygr)
  2. 涉嫌抄袭训练数据

    • 质疑所谓"干净室实现"的真实性,认为依赖现有编译器知识
      "Calling it clean room... when Anthropic stole all open source is laughable" (hrgadyx)
      "obviously it can regurgitate things that are nearly identical to already existing code" (jcalvinowens)
  3. 实用价值有限

    • 认为20k美元成本过高,产出物无实际应用价值
      "You could hire a dev in India for $1k —- or pay $20k for a buggy mess" (fxtentacle)
      "Microsoft... all solving the wrong problems, your problems not the collective ones" (trilogic)

中立观点

  1. 技术潜力与局限并存

    • 承认突破性但也指出当前模型能力的边界
      "it's a cool little experiment... nearly reached the limits of Opus’s abilities" (NitpickLawyer)
      "while these agentic systems can do amazing things... you hit diminishing returns" (btown)
  2. 需验证完整功能

    • 多次质疑编译后的内核是否能启动
      "Nothing in the post about whether the compiled kernel boots" (sho_hn)
      "it can compile the linux kernel, but does it boot?" (owenpalmer)

其他建议

  • 提议开发更适合LLM的编程语言 "design a perfect programming language for LLM coding" (small_model)
  • 要求公开实验细节 "All prompts used... The structure of the agent team" (akrauss)

总结:该实验在技术验证层面获得认可,但在代码质量、创新性和社会价值方面存在显著争议,反映出当前AI生成复杂系统的能力边界和伦理争议。