> ## Documentation Index
> Fetch the complete documentation index at: https://agent-compass.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# HLE

HLE（[arXiv](https://arxiv.org/abs/2501.14249)，Humanity's Last Exam）是一组横跨众多学科、极其困难的专家级封闭式题目：给定一道答案明确但极难求解的题目，agent 自行研究并给出最终答案，再由 **LLM 评委** 依据标准答案判定对错。

与 BrowseComp 相同，HLE 采用单侧判题。评委仅比对被测 agent 的答案与标准答案，不与任何基线对照。推理与判题均在本地进程（`host_process`）内完成——先由 Harness 驱动被测 model 完成检索循环并给出最终答案，再由评委 model 判分。

## 工作原理

HLE 一次运行分为推理与判题两个阶段。

### 推理与判题

* **推理**：被测 model 作为检索 agent，在 Harness（默认 [`naive_search_agent`](/zh/user_guide/modules/harnesses/naive_search_agent)）驱动下逐题完成搜索 / 网页访问等多轮工具循环，并给出一段简短的自然语言最终答案。
* **判题**：评委 model（`judge_model`）接收「问题 + 标准答案 + 被测答案」，套用内置的 A/B/C 判定协议进行打分。评委仅比对最终答案，忽略推理过程与格式差异，等价表达视为一致。评委与被测 model 是两个独立端点，须显式指定 `judge_model`。

### A/B/C 判定

评委只给出一个判定结果，其中仅 **A** 记为正确：

* **A —— 正确**：答案在语义上命中标准答案（允许等价表达与格式差异）。
* **B —— 错误**：与标准答案存在任何偏差。
* **C —— 无效（未完成 / 重复 / 拒绝）**：答案不完整（中途截断）、循环重复，或明确拒答。

## 参数

通过 `--benchmark-params '{...}'` 传入一段 JSON；也可写进 `--config` 指定 YAML 的 `benchmark.params` 块，同名项以命令行为准。合并与优先级见 [Benchmark 概览](/zh/user_guide/modules/benchmarks/overview)。

### 参数总览

<div style={{overflowX:'auto'}}>
  <table style={{minWidth:'1040px', width:'100%'}}>
    <colgroup>
      <col width="18%" />

      <col width="16%" />

      <col width="15%" />

      <col width="20%" />

      <col width="31%" />
    </colgroup>

    <thead>
      <tr><th style={{whiteSpace:'nowrap'}}>参数</th><th style={{whiteSpace:'nowrap'}}>类型</th><th style={{whiteSpace:'nowrap'}}>默认值</th><th>可选值 / 取值</th><th>说明</th></tr>
    </thead>

    <tbody>
      <tr><td style={{whiteSpace:'nowrap'}}><code>judge\_model</code></td><td style={{whiteSpace:'nowrap'}}>字典</td><td style={{whiteSpace:'nowrap'}}><code>null</code></td><td><code>\{id, base\_url, api\_key, api\_protocol, params}</code></td><td>评委 model 配置，<strong>必填</strong>（见 <a href="#评委 model-spec">评委 model 配置</a>）。判分由它裁定，非命令行的 <code>--model-\*</code>。</td></tr>
      <tr><td style={{whiteSpace:'nowrap'}}><code>category</code></td><td style={{whiteSpace:'nowrap'}}>字符串 / 列表</td><td style={{whiteSpace:'nowrap'}}><code>"all"</code></td><td><code>"all"</code>、<code>Math</code>、<code>Physics</code>、<code>Chemistry</code>、<code>Biology/Medicine</code>、<code>Computer Science/AI</code>、<code>Engineering</code>、<code>Humanities/Social Science</code>、<code>Other</code></td><td>按类别筛选任务；<code>"all"</code> = 不过滤，传入列表时取并集。各类别任务数——数学（215）、计算机科学/AI（63）、物理（50）、人文/社会科学（50）、其他（45）、生物学/医学（43）、工程（19）、化学（15），合计 500 条。</td></tr>
    </tbody>
  </table>
</div>

通用参数 `k`、`avgk`、`sample_ids` 等遵循 [Benchmark 参数](/zh/user_guide/modules/benchmarks/overview) 的约定。

<a id="评委 model-spec" />

### 评委 model 配置

`judge_model` 以字典形式传入：`{"id","base_url","api_key","api_protocol","params"}`，指向评委 model 的独立端点，model 推理参数放在 `params` 下。

建议 **固定使用同一个评委** 评测所有被测 model。判分结果直接决定成绩，更换评委后成绩即失去横向可比性；同时不应让被测 model 充当自身的评委，否则既不公正也失去对照意义。评委无需特别强——A/B/C 判据（语义命中）相对客观，中等规模 model 即可胜任。AgentCompass 推荐 `Qwen3.6-35B-A3B`。

## 运行示例

HLE 的运行命令形如 `agentcompass run hle <harness> <model>`，三个位置参数依次是：

* `hle` —— Benchmark ID；
* `<harness>` —— 驱动被测 model 完成检索循环的 Harness，默认 [`naive_search_agent`](/zh/user_guide/modules/harnesses/naive_search_agent)；其自身配置通过 `--harness-params` 传入；
* `<model>` —— 被测 model，即完成检索与作答的 agent；其访问凭据通过 `--model-base-url` / `--model-api-key` 传入。

运行配置分两段 JSON：`--benchmark-params` 传 Benchmark 层配置（评委 model、数据过滤，见上文[参数总览](#参数总览)），`--harness-params` 传 [`naive_search_agent`](/zh/user_guide/modules/harnesses/naive_search_agent) Harness 自身配置（启用的工具、Serper / Jina 密钥、迭代数与超时等，完整清单见 [NaiveSearchAgent Harness](/zh/user_guide/modules/harnesses/naive_search_agent)）。两段都可改写进 `--config` 的 `benchmark.params` / `harness.params` 块，同名项以命令行为准。

以下示例的 `--harness-params` 均通过 `serper_api_key` / `jina_api_key` 直接传入检索所需的 Serper 与 Jina 密钥（`naive_search_agent` 的 `search` / `visit` 工具依赖二者），各示例只在 `--benchmark-params` 上有区别。

<Tabs>
  <Tab title="冒烟测试（单条跑通）">
    通过 `sample_ids` 仅评测一条任务，用于验证推理与判题的端到端流程是否正常，其余参数使用默认值。

    ```bash theme={"system"}
    agentcompass run \
      hle \
      naive_search_agent \
      "$MODEL_NAME" \
      --env host_process \
      --benchmark-params '{
        "judge_model": {"id": "Qwen3.6-35B-A3B", "base_url": "https://your-judge-endpoint/v1", "api_key": "sk-…"},
        "sample_ids": ["1"]
      }' \
      --harness-params '{
        "serper_api_key": "your-serper-key",
        "jina_api_key": "your-jina-key"
      }' \
      --model-base-url "$MODEL_BASE_URL" \
      --model-api-key "$MODEL_API_KEY" \
      --model-api-protocol openai-chat
    ```
  </Tab>

  <Tab title="自定义参数">
    仅评测部分类别的子集，便于聚焦分析特定领域；同时演示如何在 `--harness-params` 中收窄工具集与迭代数。

    ```bash theme={"system"}
    agentcompass run \
      hle \
      naive_search_agent \
      "$MODEL_NAME" \
      --env host_process \
      --benchmark-params '{
        "judge_model": {"id": "Qwen3.6-35B-A3B", "base_url": "https://your-judge-endpoint/v1", "api_key": "sk-…"},
        "category": ["Math", "Physics"]
      }' \
      --harness-params '{
        "tools": ["search", "visit"],
        "max_iterations": 40,
        "serper_api_key": "your-serper-key",
        "jina_api_key": "your-jina-key"
      }' \
      --model-base-url "$MODEL_BASE_URL" \
      --model-api-key "$MODEL_API_KEY" \
      --model-api-protocol openai-chat \
      --task-concurrency 16
    ```
  </Tab>

  <Tab title="AgentCompass 推荐配置">
    评测全部任务。`--benchmark-params` 仅需提供评委 model `judge_model`；通过 `--task-concurrency` 提升跨任务并发。

    ```bash theme={"system"}
    agentcompass run \
      hle \
      naive_search_agent \
      "$MODEL_NAME" \
      --env host_process \
      --benchmark-params '{
        "judge_model": {"id": "Qwen3.6-35B-A3B", "base_url": "https://your-judge-endpoint/v1", "api_key": "sk-…"}
      }' \
      --harness-params '{
        "serper_api_key": "your-serper-key",
        "jina_api_key": "your-jina-key"
      }' \
      --model-base-url "$MODEL_BASE_URL" \
      --model-api-key "$MODEL_API_KEY" \
      --model-api-protocol openai-chat \
      --task-concurrency 16
    ```
  </Tab>
</Tabs>

## 输出

一次运行产出两类结果，均位于 `results/hle/<model>/<run>/` 下：**聚合指标**（`summary.md`，整体表现）与 **单任务详情**（`details/`，逐任务判分）。

### 聚合指标（summary.md）

`summary.md` 汇总本次运行的整体表现，分为运行概况与指标两部分。

**运行概况**

| 字段          | 含义                                              |
| ----------- | ----------------------------------------------- |
| `Model`     | 被测 model ID                                     |
| `Total`     | 加载的任务总数                                         |
| `Evaluated` | 完成评测的任务数（正常应等于 `Total`）                         |
| `Error`     | 运行或判题报错的任务数（`RUN_ERROR`）；大于 0 说明这些任务未产出有效判分，需排查 |

**指标**

只有一个主指标 **`accuracy`**：判为正确的任务占比。一条任务 **当且仅当** 评委给出 **A** 判定时记为正确（记 1，否则记 0），`accuracy` 即所有任务的平均值。

### 单任务详情（details/）

每个任务对应一个 JSON 文件，其中评委对该任务的判分记录在 `extra.scoring` 字段下：

| 字段                | 含义                   |
| ----------------- | -------------------- |
| `evaluation_type` | 固定为 `llm_judge`      |
| `correct`         | 该任务最终是否判为正确（评委判定为 A） |
| `model_answer`    | 被测 model 给出的最终答案     |
| `ground_truth`    | 标准答案                 |

此处仅保留解析后的判定结果；被测答案与标准答案一并留存以便追溯，完整轨迹写在同一任务文件的其余字段中。
