82 / 90

Day 82: 科學化 Agent 評測 I —— 預註冊協議與基準

設計可重現的 Agent 評測:固定任務集、宣告基準與假設、在執行之前先定義可核驗的指標。

智能體工程與科學評測 480 分鐘有效研習(8 小時)
01 120 分鐘

評測預註冊:固定任務集、基準與已宣告假設

Agent 輔助工程檢查

前置要求

Day 81 的 Agent 輔助交付實作及 ticket-23 的證據契約檔案。

學習目標

按 live_eval_contract.json 的結構,設計一份預註冊評測協議:在任何測量執行之前,固定任務集、基準 Agent、可否證假設與停止條件。

操作指引

學習來源:在本活動現有的閱讀與練習時段內,參考 Demystifying evals for AI agents 的 The structure of an evaluation: task, trial, grader, transcript, outcome, harness and suite,用自己的話解釋一處與本地任務的聯繫。保留現有練習與驗收檢查;若外部資料無法存取,使用課程自寫的解釋。1. 閱讀 projects/agent_learning/evidence/live_eval_contract.json 與 report.en.md,注意其狀態為 blocked-awaiting-authorization。
2. 固定任務集:列舉契約中的六個任務(live-summarize-notes-success、live-invalid-arguments-recovery、live-unknown-tool-request、live-missing-note-failure、live-step-budget-exhaustion、live-termination-honesty),並標註各自的 deterministic_analog 治具任務。
3. 宣告基準:deterministic-v1 治具執行為基準;真實模型是未評測的候選。授權記錄出現之前不存在任何上線(live)結論。
4. 預註冊可否證假設(例如「候選以與治具期望相同的 report SHA-256 完成 live-summarize-notes-success」)與明確停止條件(授權閘失敗 → 不做上線執行)。
5. 在任何執行之前將協議落盤為 eval_protocol.md;此後所有修訂都標註日期。

自主實作與記錄

撰寫 eval_protocol.md,固定六任務集、deterministic-v1 基準、兩條可否證假設與授權停止條件。

獨立掌握標準

產出一份預註冊協議,其指標可獨立於 Agent 自身敘述被核驗。

權威來源資源與權利證明

linking Anthropic copyright; no open reuse license verified linking only; no reproduction

Demystifying evals for AI agents

作者 / 機構: Anthropic Engineering | 原始出處連結 ↗

對應章節 / 時間戳: The structure of an evaluation: task, trial, grader, transcript, outcome, harness and suite

驗證版本與日期: Public edition checked 2026-11-01; moving pages may change

入選理由:

Teaching-oriented task/trial/grader/outcome distinctions and a staged eval-building workflow complement the original benchmark definitions. No vendor product is required for the local exercises.

來源前置條件:

Bounded agent loops, task outcomes, traces and deterministic acceptance tests.

安全回退方案(離線彈性):

Use the original localized explanations, exercises and checks already present in this activity; no external account or purchase is required for that fallback.

對比候選資源與選型分析 (2)
SWE-bench ↗ compared_alternative [Open Access / CC BY 4.0]

Retained for issue-to-patch fail-to-pass definitions; not a general teaching workflow.

tau-bench ↗ compared_alternative [Open Access / CC BY 4.0]

Retained for the exact pass^k definition; practitioner guidance cannot replace the paper's metric semantics.

linking Open Access / CC BY 4.0

AgentBench: Evaluating LLMs as Agents

作者 / 機構: Xiao Liu, Hao Yu, Hanchen Zhang, Yifan Xu, Xuanyu Lei, Hanyu Lai, Yu Gu, Hangliang Ding, Kaiwen Men, Kejuan Yang, et al. | 原始出處連結 ↗

對應章節 / 時間戳: Section 4.1 Evaluation Setup and Section 4.3 Analysis

驗證版本與日期: ICLR 2024 / arXiv:2308.03688v2 (Verified: 2026-10-30)

入選理由:

First systematic multi-environment benchmark measuring LLM-as-agent ability across eight interactive settings, establishing fixed task suites, environment-specific scoring, and comparable evaluation conventions.

來源前置條件:

LLM prompting, tool-use environments, and multi-step task decomposition.

安全回退方案(離線彈性):

The curriculum fixes its own six-task evaluation suite with deterministic-v1 fixture analogs, so all protocol-design practice runs offline without reproducing AgentBench environments.

對比候選資源與選型分析 (2)

Real computer-control benchmark for open-ended desktop tasks; AgentBench covers a wider environment spectrum for foundational evaluation design.

Mind2Web: Towards a Generalist Agent for the Web ↗ compared_alternative [Open Access]

Generalist web-agent benchmark with 2,350 tasks; AgentBench provides broader multi-domain coverage for studying evaluation protocol design.

linking MIT

OpenAI Evals: Framework for Evaluating LLMs and Contamination Checks

作者 / 機構: OpenAI Research | 原始出處連結 ↗

對應章節 / 時間戳: README sections 'Running evals' and 'Writing evals'

驗證版本與日期: OpenAI Evals Repository (Verified: 2026-10-30)

入選理由:

Standardized evaluation repository specifying rigorous separation of eval prompts, canary GUID strings, and contamination test protocols.

來源前置條件:

Python, evaluation harnesses (MMLU, GSM8K), JSONL datasets.

安全回退方案(離線彈性):

Canary GUID matching, token set intersection, and leak detection scripts are implemented in the curriculum.

對比候選資源與選型分析 (2)
EleutherAI LM Evaluation Harness ↗ compared_alternative [MIT]

Widely adopted evaluation harness; OpenAI Evals provides explicit canary guidance and contamination check specifications.

Hugging Face Lighteval ↗ compared_alternative [MIT]

Modern lightweight eval framework; OpenAI Evals illustrates standard test-set integrity guarantees.

02 120 分鐘

指標規格:任務結果、工具正確性、預算與終止誠實性

獨立掌握檢查(無 AI 輔助)

前置要求

Day 82 Activity 1 的協議草案。

學習目標

規格化四個契約指標族——outcome_passed、tool_behavior_passed、budget_passed、failure_handling_passed——使每個指標都能從已記錄的 action/observation 證據核驗,而非依賴自報或隱藏思維鏈。

操作指引

1. 為每個指標寫一行定義、它消費的可見證據、以及通過規則。
2. outcome_passed:report.txt 內容與治具期望一致(契約中記錄了 SHA-256)。
3. tool_behavior_passed:每個已記錄 action 名都在 allowed_tools 中,且每個 arguments 酬載都是 JSON 物件。
4. budget_passed:從未超過已宣告的步數與重試上限。
5. failure_handling_passed:每個失敗的 observation 都帶結構化錯誤值,且終止原因(termination reason)誠實。
6. 增加逐任務基準對比與實測成本欄位;在授權執行填入資料之前,所有 live_value 一律記為 null。

自主實作與記錄

編寫 metric_spec.json,包含全部四個指標族的定義、可見證據與通過規則,外加基準對比規則。

獨立掌握標準

定義第三方無需信任 Agent 即可從軌跡重算的指標。

權威來源資源與權利證明

linking Open Access / CC BY 4.0

SWE-bench: Can Language Models Resolve Real-World GitHub Issues?

作者 / 機構: Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, Karthik R. Narasimhan | 原始出處連結 ↗

對應章節 / 時間戳: Appendix A.4 Evaluation Procedure

驗證版本與日期: ICLR 2024 / arXiv:2310.06770v3 (Verified: 2026-10-30)

入選理由:

Defines the standard pattern this block teaches: a bounded issue statement paired with executable fail-to-pass tests as verifiable acceptance criteria for agent-produced changes.

來源前置條件:

Unit testing, issue descriptions, and repository evaluation vocabulary.

安全回退方案(離線彈性):

The acceptance-criteria pattern is exercised locally through the Ticket 22 fixture scorer and the Ticket 24 regression exercise without external datasets.

對比候選資源與選型分析 (2)
HumanEval: Evaluating Large Language Models Trained on Code ↗ compared_alternative [arXiv non-exclusive license / Open Access]

Function-level synthesis benchmark; SWE-bench models the repository-scoped issue-to-diff workflow that this delivery block rehearses.

Multi-SWE-bench: A Multilingual Benchmark for Issue Resolving ↗ compared_alternative [Open Access / CC BY 4.0]

Extends issue resolution to multiple programming languages; the original Python-centric SWE-bench provides a cleaner pedagogical anchor.

linking Open Access / CC BY 4.0

tau-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domains

作者 / 機構: Shunyu Yao, Noah Shinn, Pedram Razavi, Karthik Narasimhan | 原始出處連結 ↗

對應章節 / 時間戳: Section 3 τ-bench: A benchmark for Tool-Agent-User Interaction (pass^k definition); Section 4.2 Key Characteristics; Section 5 Experiments (pass^k results)

驗證版本與日期: ICLR 2025 / arXiv:2406.12045v2 (Verified: 2026-10-30)

入選理由:

Introduces pass^k consistency metrics and database-state outcome checks for tool-agent-user interaction, separating reliable task completion from single lucky runs.

來源前置條件:

Tool-calling APIs, conversational agents, and policy-following evaluation.

安全回退方案(離線彈性):

Consistency metrics and state-based outcome checking are re-implemented on the curriculum deterministic fixture for offline practice.

對比候選資源與選型分析 (2)

Stateful tool-use evaluation with milestone events; tau-bench additionally models a simulated user and reports pass^k reliability.

Berkeley Function-Calling Leaderboard (BFCL) ↗ compared_alternative [Apache 2.0 (Gorilla project)]

Live leaderboard for function-call correctness across languages and parallel calls; tau-bench adds policy adherence and multi-trial consistency.

03 120 分鐘

從實際產物重算 Deterministic-v1 基準

Agent 輔助工程檢查

前置要求

Day 82 Activity 2 的指標規格。

學習目標

重跑確定性治具基準,將記錄指標與契約核對一致;由於評測處於 blocked-awaiting-authorization,所有 live_results 欄位按 null 處理。

操作指引

1. 執行 python -m projects.agent_learning.cli evaluate --fixture summarize-notes --output ,檢查生成的報告與軌跡。
2. 執行 python -m unittest discover -s tests/projects -p 'test_agent_learning.py',確認確定性套件全部通過。
3. 執行 python projects/agent_learning/evidence/validate_contract.py 確認通過;並確認 --require-authorized 按設計仍然失敗。
4. 把基準指標抄入台帳:確定性任務上 outcome_passed=1、tool_behavior_passed=1、budget_passed=1、failure_handling_passed=1。
5. 記錄 expected_report_sha256 的來源;所有指標的 live_value 都寫 null——null 表示不可得,絕不是零。

自主實作與記錄

產出 baseline_ledger.json:包含重算的四個確定性指標、你實際執行的重現命令、以及顯式為 null 的 live_value 欄位。

獨立掌握標準

重算並引用確定性基準證據,同時讓上線值保持顯式 null。

權威來源資源與權利證明

linking MIT

OpenAI Evals: Framework for Evaluating LLMs and Contamination Checks

作者 / 機構: OpenAI Research | 原始出處連結 ↗

對應章節 / 時間戳: README sections 'Running evals' and 'Writing evals'

驗證版本與日期: OpenAI Evals Repository (Verified: 2026-10-30)

入選理由:

Standardized evaluation repository specifying rigorous separation of eval prompts, canary GUID strings, and contamination test protocols.

來源前置條件:

Python, evaluation harnesses (MMLU, GSM8K), JSONL datasets.

安全回退方案(離線彈性):

Canary GUID matching, token set intersection, and leak detection scripts are implemented in the curriculum.

對比候選資源與選型分析 (2)
EleutherAI LM Evaluation Harness ↗ compared_alternative [MIT]

Widely adopted evaluation harness; OpenAI Evals provides explicit canary guidance and contamination check specifications.

Hugging Face Lighteval ↗ compared_alternative [MIT]

Modern lightweight eval framework; OpenAI Evals illustrates standard test-set integrity guarantees.

linking arXiv non-exclusive license / Open Access

WebArena: A Realistic Web Environment for Building Autonomous Agents

作者 / 機構: Shuyan Zhou, Frank F. Xu, Hao Zhu, Xuhui Zhou, Robert Lo, Abishek Sridhar, Xianyi Cheng, Tianyue Ou, Yonatan Bisk, Daniel Fried, Uri Alon, Graham Neubig | 原始出處連結 ↗

對應章節 / 時間戳: Section 3.2 Evaluation Annotation (functional correctness checks)

驗證版本與日期: ICLR 2024 / arXiv:2307.13854v4 (Verified: 2026-10-30)

入選理由:

Defines reproducible web tasks scored by functional outcome rather than reference-string matching, grounding observable action/observation evidence for agent evaluation.

來源前置條件:

Web navigation, browser action spaces, and functional correctness checking.

安全回退方案(離線彈性):

The curriculum records action/observation traces on its own deterministic fixture, reproducing outcome-check discipline without hosting web environments.

對比候選資源與選型分析 (2)

Enterprise-workflow web benchmark; WebArena offers broader self-hosted site diversity for foundational protocol study.

Extends WebArena to visual grounding; WebArena remains the base reference for action-space and functional scoring design.

04 120 分鐘

評估:註冊評測協議文件

獨立掌握檢查(無 AI 輔助)

前置要求

Day 82 Activities 1-3。

學習目標

交付完整協議文件:固定任務集、基準、指標定義、混雜變數登記表,以及上線授權閘狀態。

操作指引

1. 組裝 protocol.md:含確定性對照的任務集、你重算的基準指標、指標定義、可否證假設、停止條件、blocked-awaiting-authorization 閘。
2. 添加混雜變數登記表初稿,把模型 ID、固定 revision、解碼配置、工具 schema 版本、重試策略列為後續要凍結的變數。
3. 核驗每條斷言都引用了產物路徑或你親自重算的指標;刪掉無證據的斷言。
4. 附上本日資源卡所用 AgentBench、SWE-bench、tau-bench、WebArena 與 OpenAI evals 倉庫的來源與版本記錄。

自主實作與記錄

提交 protocol.md,通過如下量規:任務固定、確定性基準已重現、假設可否證、上線值為 null、授權閘狀態已記錄。

獨立掌握標準

獨立交付一份可評測的協議——而不是別人執行結果的摘要。

權威來源資源與權利證明

linking Open Access / CC BY 4.0

AgentBench: Evaluating LLMs as Agents

作者 / 機構: Xiao Liu, Hao Yu, Hanchen Zhang, Yifan Xu, Xuanyu Lei, Hanyu Lai, Yu Gu, Hangliang Ding, Kaiwen Men, Kejuan Yang, et al. | 原始出處連結 ↗

對應章節 / 時間戳: Section 4.1 Evaluation Setup and Section 4.3 Analysis

驗證版本與日期: ICLR 2024 / arXiv:2308.03688v2 (Verified: 2026-10-30)

入選理由:

First systematic multi-environment benchmark measuring LLM-as-agent ability across eight interactive settings, establishing fixed task suites, environment-specific scoring, and comparable evaluation conventions.

來源前置條件:

LLM prompting, tool-use environments, and multi-step task decomposition.

安全回退方案(離線彈性):

The curriculum fixes its own six-task evaluation suite with deterministic-v1 fixture analogs, so all protocol-design practice runs offline without reproducing AgentBench environments.

對比候選資源與選型分析 (2)

Real computer-control benchmark for open-ended desktop tasks; AgentBench covers a wider environment spectrum for foundational evaluation design.

Mind2Web: Towards a Generalist Agent for the Web ↗ compared_alternative [Open Access]

Generalist web-agent benchmark with 2,350 tasks; AgentBench provides broader multi-domain coverage for studying evaluation protocol design.

linking Open Access / CC BY 4.0

SWE-bench: Can Language Models Resolve Real-World GitHub Issues?

作者 / 機構: Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, Karthik R. Narasimhan | 原始出處連結 ↗

對應章節 / 時間戳: Appendix A.4 Evaluation Procedure

驗證版本與日期: ICLR 2024 / arXiv:2310.06770v3 (Verified: 2026-10-30)

入選理由:

Defines the standard pattern this block teaches: a bounded issue statement paired with executable fail-to-pass tests as verifiable acceptance criteria for agent-produced changes.

來源前置條件:

Unit testing, issue descriptions, and repository evaluation vocabulary.

安全回退方案(離線彈性):

The acceptance-criteria pattern is exercised locally through the Ticket 22 fixture scorer and the Ticket 24 regression exercise without external datasets.

對比候選資源與選型分析 (2)
HumanEval: Evaluating Large Language Models Trained on Code ↗ compared_alternative [arXiv non-exclusive license / Open Access]

Function-level synthesis benchmark; SWE-bench models the repository-scoped issue-to-diff workflow that this delivery block rehearses.

Multi-SWE-bench: A Multilingual Benchmark for Issue Resolving ↗ compared_alternative [Open Access / CC BY 4.0]

Extends issue resolution to multiple programming languages; the original Python-centric SWE-bench provides a cleaner pedagogical anchor.