AI Pulse
📄 论文解读

AI 智能体改代码,先得找到改哪里

AI 智能体的能力不仅靠大模型,还靠它的“缰绳”——提示词构造、状态管理、工具调用等代码。这些代码要不断改,但改之前得先找到改哪里。生产环境的缰绳代码庞大、耦合紧、行为分散,开发者或编码 AI 得手动把“要改什么行为”映射到“改哪段代码”。这篇论文自动从代码库中提取行为到代码的映射,生成“行为手册”,并用渐进式披露引导 AI 从高层行为定位到具体代码行。在真实修改请求上,用这个手册做规划,定位更准、计划质量更高、用的 token 更少,尤其对分散、少执行、跨模块的修改效果明显。它不是你明天能用上的,但揭示了 AI 自主改代码的关键瓶颈:不是生成修改,而是找到改哪里。

📄 原文摘要(英文)

The capability of a modern AI agent depends not only on its foundation model but also on its harness, which constructs prompts, manages state, invokes tools, and coordinates execution. As models, APIs, environments, and requirements evolve, the harness must be continually modified. Before such a change can be made, a developer or coding agent must identify all code locations that implement the target behavior. This is difficult because production harnesses are large, tightly coupled, and behaviorally distributed, while modification requests describe what the system should do and repositories are organized by files and modules. Code search, repository indexing, and long-context processing ease inspection, but still leave this behavior-to-code mapping to be recovered by hand. Behavior localization is therefore a central bottleneck in harness evolution. We introduce the Harness Handbook, a behavior-centric representation synthesized automatically from a harness codebase via static analysis and LLM-assisted structuring, linking each behavior to its corresponding source. We also introduce Behavior-Guided Progressive Disclosure (BGPD), which guides agents from high-level behaviors to relevant implementation details and verifies candidate locations against the current source. On diverse modification requests from two open-source harnesses, Handbook-Assisted planning improves behavior localization and edit-plan quality while using fewer planner tokens, with the largest gains on scattered sites, rarely executed paths, and cross-module interactions. Evolving complex agentic systems thus depends not only on generating edits, but also on determining where those edits should be made.

arXiv 原文

订阅 AI Pulse

每天 08:00 · 12:30 · 18:30 · 23:50 更新