File size: 4,440 Bytes
4720021
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# Evaluating your own model on AutoOntologyBench v3

`scripts/eval_20k_all.sh` generates predictions, then scores them with the
private oracle. It does not call any model API itself; the runner only accepts
an OpenAI-compatible endpoint or the Anthropic Messages API.

## Requirements

- Python environment with the repository dependencies (`.venv/bin/python`)
- Private oracle roots; the default is `bank/staging_20k:bank/staging`
- A model endpoint and credentials

Keys are read from the environment and are never written to the run directory
or printed in the log.

## OpenAI-compatible servers

This works for OpenAI, DashScope, OpenRouter, vLLM, and compatible gateways.

```bash
export OPENAI_API_KEY="..."
export OPENAI_BASE_URL="https://api.openai.com/v1"
bash scripts/eval_20k_all.sh \
  --provider openai \
  --model gpt-4.1 \
  --sample-per-lane 5
```

For DashScope:

```bash
export OPENAI_API_KEY="..."
export OPENAI_BASE_URL="https://dashscope.aliyuncs.com/compatible-mode/v1"
bash scripts/eval_20k_all.sh \
  --provider openai \
  --model qwen3.8-max \
  --sample-per-lane 5
```

Some OpenAI-compatible servers reject `response_format=json_object`; pass
`--no-json-mode` for those servers.

## vLLM

A local vLLM server exposes an OpenAI-compatible API. No real key is required;
the runner substitutes `EMPTY` when `VLLM_API_KEY`/`OPENAI_API_KEY` is absent.

```bash
export VLLM_BASE_URL="http://127.0.0.1:8000/v1"
export VLLM_API_KEY="EMPTY"
bash scripts/eval_20k_all.sh \
  --provider vllm \
  --model your-local-model \
  --base-url "$VLLM_BASE_URL" \
  --no-json-mode \
  --sample-per-lane 5
```

`--model` must match the model name served by vLLM.

## Anthropic / Claude

Claude uses the native Messages API, not the OpenAI chat-completions schema.

```bash
export ANTHROPIC_API_KEY="..."
export ANTHROPIC_BASE_URL="https://api.anthropic.com/v1"
bash scripts/eval_20k_all.sh \
  --provider anthropic \
  --model claude-sonnet-4-5 \
  --sample-per-lane 5
```

`--model` is required for Anthropic. `ANTHROPIC_VERSION` defaults to
`2023-06-01`.

## Sampling and full runs

The default is 50 tasks per lane with `L11=10`; this is a smoke test, not a
leaderboard result.

```bash
# Full official set
bash scripts/eval_20k_all.sh --sample-per-lane 0

# Specific lanes
bash scripts/eval_20k_all.sh --lanes L05,L06 --sample-per-lane 50

# Custom key environment variable
bash scripts/eval_20k_all.sh --provider openai --api-key-env MY_API_KEY
```

Artifacts are written to `runs/eval_20k_<UTC>/`:

- `predictions.jsonl` — model answers
- `tasks_sampled.jsonl` — exact row subset
- `report.json` / `rows.jsonl` — per-task and aggregate metrics
- `run.log` — command and coverage summary

## Metrics

The scorer reports `TSR`, `V-TSR`, unsafe-action counts, cost fields, and
per-lane/per-family breakdowns. A lane that cannot be scored is reported as
`NOT_SUPPORTED`/`ORACLE_MISSING` with an explicit reason; it is never silently
counted as a failure or a pass.

A full one-click run also writes extra offline metrics under
`runs/eval_20k_<UTC>/metrics/`:

- `cps.json` / `CPS.md` — CPS (tokens per verified success), API calls per
  success, wall seconds per success
- `batch_tsr.json` — TSR by evaluation batch/run
- `regime_breakdown.json` — TSR by `application` / `repair` / `organization` /
  `construction`
- `mapf1.json` / `MAPF1.md` — mapping micro/macro-F1 and coverage
- `mapf1_common7.json` — Common-7 MapF1 and coverage; if a run lacks one of
  the seven families, it is `NOT_APPLICABLE` with `missing_families`
- `frule.json` / `FRULE.md` — conditional rule-witness choice accuracy
  (`balanced F_rule`) with coverage; this is an auxiliary metric, not the
  paper's Frule

These extra metrics are offline: they read the run's `report.json`,
`predictions.jsonl`, `rows.jsonl`, task records, and mounted oracle. They do
not call a model. Use `--no-extra-metrics` to skip this stage.

Per-lane and per-family TSR are already in `report.json`; `batch_tsr.json`
adds the per-batch view.

## Notes

- The public task set contains no answers; scoring requires the private oracle.
- Keep `--sample-per-lane` small while validating a new model/provider.
- `--thinking` is opt-in. It is off by default for Qwen models so a smoke test
  does not stall on reasoning tokens.
- API errors and non-JSON model output are recorded per task as explicit error
  markers and scored as failures; they are not dropped.