跳到正文
Hacker News (official RSS)(github.com)·· 3 小時前精選AI 評分78

Google Research 推出 Harness²:Recursive Agent Harnessing 框架

Harness2 by Google Research – Recursive Agent Harnessing

AI 導讀

Harness² 是 Google Research 提出的開源框架,專為在開放世界中遞迴最佳化智慧體而設。

  • 核心機制:結合 Task‑level recursion 與 Harness‑level recursion,透過 Propose–Probe–Compose 步驟自動調整 harness,保持模型權重不變。
推薦理由

本研究提出 Recursive Agent Harnessing,可提升 Gemini 3.5 Flash 與 GLM-5 效能,為開放世界智慧體提供方法。

正文 · AI 翻譯

Harness²
遞迴代理機制在開放世界中的應用

Paper Website Benchmark guides License

Install, set up, and run JobBench: uv pip install -e '.[render]', harness2-setup jb, then harness2 --bench jb --k 1 --mode parallel. Click for prerequisites and commands.

一個harness是圍繞模型的系統,使其能夠作為代理人運作:提示、工具、記憶、技能、協調等。Harnessing是最佳化該系統的過程。

Harness²是一個即插即用的框架,用於在開放世界中進行遞迴代理機制,在此環境中代理人會遇到在設計 harness 時未見過的任務。它在保持模型權重不變的情況下連線兩層遞迴:

  • 任務級遞迴透過對比式的Propose–Probe–Compose步驟來最佳化當前任務的執行 harness:提出修改、探測其對同一任務的影響,並從執行間的行為對比中組合出更精緻的 harness,無需真實答案回饋。
  • Harnessing級遞迴使用已採用的 harness 及各任務的證據支援教訓,更新一個持久的improvement harness,以指導未來的最佳化。

Harness² pipeline. Task-level recursion: an agent executor runs the initial harness, a harness editor proposes invariant and domain edits, candidate probes execute them, and a harness composer combines them into the final harness. Harnessing-level recursion: an experience reflector reflects on the step and updates the improvement harness used for the next task.

在三個專業基準測試和四種模型–harness 配置中,一個 Harness² 步驟即可提升 GLM-5 和 Gemini 3.5 Flash 於其基礎 harness 之上的表現,分別在 WorkBuddy-Bench 提升多達 11.5 分、JobBench 提升 4.5 分,以及 LAB 部分通過率提升 11.8 百分點。增加任務級遞迴預算可帶來進一步提升。

此版本支援並行與順序遞迴、OpenCode 與 Codex 執行器,以及JobBench、LAB 與 WorkBuddy-Bench。

影片概覽

harness2-video.mp4

目錄

Harness 元件

Harness² 在模型周圍提供八個可編輯元件:system prompt、guardrails、memory、tool guidance、subagents、skills、scripts、以及 plugins。 它們控制上下文構建、工具介面、委派以及工具迴圈內的行為。

Eight harness components grouped by runtime role: system prompt, guardrails, memory, and skills construct context; tool guidance and scripts define the tool interface; subagents orchestrate delegated work; plugins control middleware.

安裝

使用 Linux、Python 3.12 以及 uv。 從倉庫根目錄:

uv venv --python 3.12 .venv
source .venv/bin/activate
uv pip install -e '.[render]'
harness2-demo --output runs/demo --k 2

本地示範同時執行並行與順序遞迴模式,使用確定性編輯器和真實 Python 執行。無需模型憑證。

對於模型支援的基準測試,請安裝 Node.js 20+、Google Cloud CLI,以及benchmark 依賴。LAB 需要 Pandoc 與 Poppler;WorkBuddy-Bench 需要 Docker。然後配置您的模型:

cp .env.example .env
# Edit .env with your Vertex AI project and model IDs.
gcloud auth application-default login

參見 設定指南,瞭解模型設定、認證選項,以及 Codex 執行器。

執行基準測試

以下範例安裝 LAB 並執行一項任務,然後評估並報告其結果。模型支援的執行會產生 API 費用;請先選擇少量任務。

harness2-setup lab
harness2-check --bench lab
harness2 --bench lab --k 1 --mode parallel \
  --only-domains antitrust-competition --max-tasks 1
harness2-judge --bench lab --k 1 --mode parallel
harness2-report --bench lab --k 1 --mode parallel

順序遞迴以 --mode sequential 執行相同指令。--k 為任務級遞迴預算;請參見 實驗。評分與報告必須使用與最佳化執行相同的基準測試、執行器、子集、--k、--mode 以及種子。加入 --dry-run 至 harness2 可預覽任務選擇而不觸發模型呼叫。

基準測試 任務 安裝 指南
JobBench 專業工作 harness2-setup jb JobBench
LAB 法律工作 harness2-setup lab LAB
WorkBuddy-Bench 辦公、網頁與程式碼 harness2-setup wb WorkBuddy

每個指令請選擇一個基準。WorkBuddy 在設定後的每個指令也會接受 --subset office、--subset web 或 --subset code。benchmark guides 覆蓋每個基準的資料、領域與評分。

實驗

以兩種方式擴充套件任務層級遞迴:parallel recursion 探索多個候選 harness,並根據其執行證據組合最佳化;sequential recursion 在連續的 Propose–Probe–Compose 步驟中攜帶已最佳化的 harness 與累積證據。

Two ways to scale task-level recursion. Parallel: probe k general and k domain-specific candidate harnesses, then produce k compositions from the shared evidence. Sequential: carry the refined harness and accumulated evidence through k Propose–Probe–Compose steps.

Parallel recursion 探索更廣;sequential recursion 深入最佳化。

選項 行為
--k 1 一次 Propose–Probe–Compose 步驟
--k K --mode parallel 探測 K 一般候選與 K 針對領域的候選,然後產生 K 組合
--k K --mode sequential 透過 K 個連續步驟進行 harness 的精緻化
--substrate cx 使用 Codex 取代預設的 OpenCode 執行器

在每個任務之後,harnessing-level 遞迴會保留已採用的 harness 與以證據為依據的教訓,以指導未來的精緻化。請參閱experiment guide瞭解任務選擇、併發、可重現性與基準比較。

網路存取

執行器的網路存取不受限制,Codex 以停用沙箱的方式執行。公開基準評分標準可能可線上存取。在評估前,請設定network restrictions以防止存取基準答案與評分標準。

結果與續接

結果儲存在 runs/,按基準與適用子集組織。內容包含任務摘要、交付成果、採用的 harness、反思筆記與評估結果。

重複相同指令以續接。更換模型或任務選擇時請使用新的 HARNESS2_RUNS_DIR。請參閱results and resume瞭解詳情;每個指令也支援 --help。

引用

@article{xu2026harness2,
  title   = {Harness$^2$: Recursive Agent Harnessing for an Open World},
  author  = {Xu, Ruiyao and Chen, Yanfei and CuiZhu, Zhongying and Dalvi Mishra, Bhavana and Ming, Yifei and Yu, Han and Han, Rujun and Lee, Chen-Yu and Pfister, Tomas},
  journal = {arXiv preprint arXiv:2610.14224},
  year    = {2026},
  url     = {https://arxiv.org/abs/2610.14224}
}

貢獻

請參閱CONTRIBUTING.md。

授權

Harness² 以 Apache 2.0 授權。第三方程式碼在 third_party/、基準與資料集下保留其上游授權;詳見 third-party notices。

免責宣告

這不是 Google 官方支援的產品。此專案不符合 Google Open Source Software Vulnerability Rewards Program 的資格。