Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ build/
.DS_Store
*.partial
/results/runs/*/run.lock
/results/calibration/*/run.lock
1 change: 1 addition & 0 deletions PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,4 @@ Changes made after the `plan-frozen` tag, each with its date and reason. This is
- **2026-11-26, sizing after the pilot: 48 and 48 cases.** The estimator was recalibrated from the pilot's traces (`results/runs/main-claude-haiku-5-5`): output tokens per request in each arm, how many questions took each number of tool rounds in the search arms, and how much each round adds to the next request (`backread_exp.cost.PILOT`). Given the pilot's real prompts, it reproduces every arm's spend within 1%, except `ceiling`, whose pilot started with a warm cache ([docs/pilot.md](docs/pilot.md#sizing-the-full-run)). The plan says the second-model projection uses the pilot's Haiku tokens per question priced at Sonnet's rates. Instead it uses Sonnet's own, measured in a paid sample ($2.40: the second-model set on the pilot's 3 cases, 96 questions at each of `medium` and `high`, traces in `results/calibration/reader-sonnet-*`), because Sonnet writes far less than Haiku and searches more often in `search`. By the plan's rule the second-model run would project $22.44 rather than $21.30; the sizing comes out the same either way. The pilot's traces count toward the main run, so its projection leaves them out. Projected core grid: main run $12.54 (the 10,146 questions the pilot didn't ask), second `summary` run $0.56, second-model run $21.30, memories still to make $2.68, **$37.09 in all**, under $60. So both runs keep all 48 cases.
- **2026-11-26, second model at effort `high`, not `medium`.** The Reader table has `claude-sonnet-5-5` at `medium`. It moves to `high`, the main run's effort. Cost allows the move and the Sonnet sample measured what it costs, but the reason for it is the two points below. At 48 cases the second-model run projects $21.30 at `high` against $18.02 at `medium`, and the core grid $37.09 against $33.81, both well under $60. At `medium` Sonnet barely thinks: 14 output tokens per request on `summary` questions and 41 on `summary-big`, thinking included, against 37 and 140 at `high`. At `high`, both runs use the same effort, so a difference between them comes from the model, not the effort setting. The decision rests on cost and output only. The sample's scores (24 questions per arm) are not a basis for it, and the sample's traces are not part of any run.
- **2026-11-26, the pilot's estimate kept apart.** The cost gate's estimate is the `total_usd` in the run's `pilot-estimate.json`, not `estimate.json`: the full run resumes the pilot's run directory and rewrites `estimate.json` with its own estimate. The runner writes `pilot-estimate.json` whenever it starts a run of at most 3 cases. The gates now count only traces of the first 3 cases in case order, so the full run's later traces in the same directory change nothing. The pilot check therefore can't see a trace of a later case as an extra question, but such a trace can only exist once the gates have passed for the same harness, since the runner refuses more than 3 cases without that. The gates' thresholds are unchanged.
- **2026-11-27, a third model, `claude-opus-5-5`, added after the plan.** The second-model run was repeated on `claude-opus-5-5`: the same four arms (`summary`, `summary-big`, `search`, `search-nudged`), all 48 cases, the second-model question set and effort `high`. It is an extra. It decides no hypothesis, and the hypotheses, verdicts, main run and Sonnet run are unchanged. Opus is priced at $4 and $20 per million input and output tokens, with cache reads at $0.20 and cache writes at $5 (the same 1.25 multiple of input as the other models). The estimator was calibrated from a paid sample of the second-model set on the pilot's 3 cases at `high` (96 questions, $2.96 against an estimate of $2.83 made with Haiku's output; traces in `results/calibration/reader-opus-high`), which projected $48.26 for the run, under the $50 stop line. It ran in two steps under one run id, `third-model-claude-opus-5-5`: 2 cases first ($1.95 against $1.99), then the rest. It ran on the same harness the pilot passed on (`1398cda76bb2…`); no harness file changed. Details: [docs/third-model-run.md](docs/third-model-run.md).
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,19 @@ uv run python -m backread_exp run --model claude-haiku-5-5 --arms summary search

`make estimate` prices only what isn't in `results/runs/` yet, which in a clone is almost nothing, so the estimate above points at an empty folder. `data/cache/` is ignored by git.

`run` prints its estimate before the first call, refuses any request that could take it past `--max-usd`, and resumes if run again. Every paid call is logged to `results/ledger.jsonl`, and a project-wide cap of $100 counts that ledger, including the $42 already in it. `make report REPORT_RUNS=data/cache/fresh-runs REPORT_OUT=data/cache/fresh-results` reports a fresh run without touching `REPORT.md`. [CONTRIBUTING.md](CONTRIBUTING.md) lists every command.
`run` prints its estimate before the first call, refuses any request that could take it past `--max-usd`, and resumes if run again. Every paid call is logged to `results/ledger.jsonl`, and a project-wide cap of $100 counts that ledger, including the $94 already in it. `make report REPORT_RUNS=data/cache/fresh-runs REPORT_OUT=data/cache/fresh-results` reports a fresh run without touching `REPORT.md`. [CONTRIBUTING.md](CONTRIBUTING.md) lists every command.

### What it cost

$42.13 for the whole project, from the spend ledger:
$94.16 for the whole project, from the spend ledger:

| Part | Dollars |
| --- | --- |
| Summaries (480 compactor calls) | $2.94 |
| `claude-haiku-5-5` grid: main run with pilot, plus a second `summary` run | $14.69 |
| `claude-sonnet-5-5` second-model run | $21.41 |
| Calibration and checks | $3.09 |
| `claude-opus-5-5` third-model run | $49.06 |
| Calibration and checks | $6.05 |

Per 1,000 correct answers on the main run, at Anthropic's published prices:

Expand All @@ -165,7 +166,7 @@ Per 1,000 correct answers on the main run, at Anthropic's published prices:
### Limits of the test

- **Synthetic conversations and direct questions.** A real agent in the middle of a task has to notice on its own that it needs something the summary lost, which is harder than being asked.
- **One compactor, one reader model for the verdicts.** Every summary comes from CompactBench's `sectioned-summary` on `claude-haiku-5-5`, and nearly all were cut to fit their budget. A second model, `claude-sonnet-5-5`, ran a smaller grid with the same shape of result but decides nothing.
- **One compactor, one reader model for the verdicts.** Every summary comes from CompactBench's `sectioned-summary` on `claude-haiku-5-5`, and nearly all were cut to fit their budget. A second model, `claude-sonnet-5-5`, ran a smaller grid with the same shape of result but decides nothing, and `claude-opus-5-5` repeated it as an extra after the plan: search scored higher there too.
- **One kind of search.** Keyword search with tight caps; other search or longer excerpts could change the stale-answer results either way.
- **Not on CompactBench's leaderboard scale.** The reader asks one question per request with its own prompt, so scores aren't comparable to the leaderboard's.

Expand Down
34 changes: 32 additions & 2 deletions REPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ The runs this report reads:
- **Main run:** `claude-haiku-5-5` at effort `high`, 48 cases; arms `floor`, `summary`, `summary-big`, `search`, `search-nudged`, `ceiling`; 1,802 questions per arm, 10,812 in all.
- **Second `summary` run:** the `summary` arm asked again; 1,694 questions have a summary state in both runs.
- **Second model:** `claude-sonnet-5-5` at effort `high`, 48 cases; arms `summary`, `summary-big`, `search`, `search-nudged`; 384 questions per arm.
- **Third model (an extra, added after the plan):** `claude-opus-5-5` at effort `high`, 48 cases; arms `summary`, `summary-big`, `search`, `search-nudged`; 384 questions per arm.

<!-- /generated:runs -->

Expand Down Expand Up @@ -304,8 +305,9 @@ Everything the project paid for, from the spend ledger:
| Main run (pilot included) | 15,992 | $14.14 |
| Second `summary` run | 1,802 | $0.55 |
| Second model | 2,600 | $21.41 |
| Calibration and checks | 521 | $3.09 |
| **Total** | 21,395 | **$42.13** |
| Third model | 3,083 | $49.06 |
| Calibration and checks | 710 | $6.05 |
| **Total** | 24,667 | **$94.16** |

The ledger counts every paid call; the cost table counts only the requests saved in each run's traces.
The main run's ledger total is $0.91 above its traced reader cost ($13.23).
Expand Down Expand Up @@ -349,6 +351,34 @@ On the questions both models answered:

`claude-sonnet-5-5` ran four arms at cycle 4 only, one question per family per case. It decides no hypothesis, but it shows the same shape: search far above the summary alone and above the bigger summary. On the questions both models answered, Sonnet searched more often under the neutral prompt and scored higher with search, while the two scored about the same on the summary alone. Unlike on Haiku, the nudge didn't raise Sonnet's score. Sonnet cost far more per question than Haiku. At 384 questions per arm it supports comparisons between arms, not per-family conclusions.

### Third model

An extra, added after the plan and recorded in [PLAN.md's Deviations](PLAN.md#deviations): the second-model run again on `claude-opus-5-5`, a stronger reader, to see whether searching still pays off when the reader itself is stronger. It uses the same four arms, questions and effort as the Sonnet run, and decides no hypothesis.

<!-- generated:third-model -->

`claude-opus-5-5` at effort `high`, 48 cases.

| Arm | Questions | Score | 95% interval | Usable | Stale-answer rate | Trap rate | Tokens / question | $ / question | $ / correct |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| `summary` | 384 | 0.428 | [0.391, 0.473] | 100.0% | 9.1% of 209 | 0.0% of 170 | 2,265 | $0.0100 | $0.0235 |
| `summary-big` | 384 | 0.616 | [0.565, 0.666] | 100.0% | 17.2% of 209 | 0.0% of 170 | 7,177 | $0.0305 | $0.0496 |
| `search` | 384 | 0.849 | [0.815, 0.884] | 100.0% | 13.4% of 209 | 0.0% of 170 | 9,115 | $0.0407 | $0.0491 |
| `search-nudged` | 384 | 0.859 | [0.820, 0.897] | 100.0% | 12.9% of 209 | 0.0% of 170 | 10,518 | $0.0466 | $0.0556 |

On the questions all three models answered:

| Arm | Questions | Score, `claude-haiku-5-5` | Score, `claude-sonnet-5-5` | Score, `claude-opus-5-5` | Search rate, `claude-haiku-5-5` | Search rate, `claude-sonnet-5-5` | Search rate, `claude-opus-5-5` |
| --- | --- | --- | --- | --- | --- | --- | --- |
| `summary` | 384 | 0.416 | 0.425 | 0.428 | | | |
| `summary-big` | 384 | 0.561 | 0.617 | 0.616 | | | |
| `search` | 384 | 0.721 | 0.812 | 0.849 | 60.4% | 71.4% | 85.2% |
| `search-nudged` | 384 | 0.767 | 0.797 | 0.859 | 100.0% | 94.5% | 100.0% |

<!-- /generated:third-model -->

Search ahead of both summaries held on the strongest reader, and further than on the others. On the questions all three models answered, `search` scored 0.849 on Opus against 0.812 on Sonnet and 0.721 on Haiku, and Opus searched on 85% of questions under the neutral prompt, against 71% and 60%. `summary` scored about the same on all three models (0.416, 0.425, 0.428), so much of the gain on `search` comes from how often and how well the reader searches. The nudge added 0.010 over `search` on Opus, inside their overlapping intervals. Opus did not make search cheaper than the bigger summary, as it did on the other two: `search` used more tokens per question than `summary-big` (9,115 against 7,177) and cost about the same per correct answer ($0.0491 against $0.0496), while scoring 0.233 higher. Opus cost about twice Sonnet per question. Like the Sonnet run, it supports comparisons between arms, not per-family conclusions.

## Gallery

Five traces, one per pattern, chosen by mechanical rules ([how](docs/gallery.md)). GitHub can't open a line inside a gzipped file, so each link names its line; `gzip -dc <file> | sed -n <line>p` prints it.
Expand Down
1 change: 1 addition & 0 deletions STATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The harness is built and runs end to end offline (`make offline`) against fake m

## Recently Done

- Third-model run on `claude-opus-5-5` at effort `high`, an extra added after the plan: the Sonnet run's four arms on all 48 cases, 1,536 questions, every answer usable, $49.06 against a $48.26 estimate; the report shows it beside the other two models and it decides no hypothesis ([third-model run](docs/third-model-run.md)) (#117)
- [README](README.md) leads with the plugin: what it does and why, install, the headline result and chart as the test behind it, a real session, then the experiment's detail; the repository and package descriptions lead with the plugin too (#115)
- Pre-publication check: a [NOTICE](NOTICE) and the Apache 2.0 text in `LICENSES/` for the CompactBench text in the summaries and traces, a contact line in the README, and the `plan-frozen` tag ruleset kept in `.github/rulesets/` (GitHub refuses rulesets on a private free repository) (#35)
- The source distribution holds only the tool's source, the tests and the readme and licence files, about 160 KB instead of 33 MB with `results/` and `data/`; a test builds it and checks its files and size (#113)
Expand Down
4 changes: 3 additions & 1 deletion docs/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The definitions are [PLAN.md](../PLAN.md)'s; this page says how they are read fr
`make report` runs the analysis and then the charts over the runs in `results/runs/`, found by run id (see `backread_exp.report`), and rewrites `REPORT.md`'s generated blocks from the result. The flip rate sits next to every result that depends on summary state: hypothesis 2's verdict and recovery by state. Either module also runs on its own:

```sh
uv run python -m backread_exp.analyze --main RUN_DIR... [--summary-rerun RUN_DIR...] [--second-model RUN_DIR...] [--out results]
uv run python -m backread_exp.analyze --main RUN_DIR... [--summary-rerun RUN_DIR...] [--second-model RUN_DIR...] [--third-model RUN_DIR...] [--out results]
uv run python -m backread_exp.gates --pilot RUN_DIR... [--estimate-usd X] [--out results/pilot-gates.json]
```

Expand Down Expand Up @@ -43,6 +43,8 @@ A run can span several run directories (for example the pilot's, when its traces
| `flip` | With `--summary-rerun`: `questions` with a state in both runs, how many `flipped`, the `rate`, and the same `by_family`. Otherwise null |
| `hypotheses` | One entry per hypothesis: `verdict` (`pass` or `fail`), each `conditions` entry with its `test` and whether it was `met`, and the numbers behind it |
| `second_model` | With `--second-model`: that run, with summary states taken from the main run. Otherwise null |
| `third_model` | With `--third-model`: that run, an extra added after the plan, with summary states taken from the main run. Otherwise null |
| `shared_all` | With both: per arm, the score and search rate of all three models on the questions all three answered. Otherwise null |
| `shared_questions` | With `--second-model`: per arm, the main run's and the second model's score and search rate on the questions both answered |

A run holds `model`, `effort`, `run_ids`, `cases` (in case order), `questions`, `arms` and `differences`. Each arm holds:
Expand Down
34 changes: 34 additions & 0 deletions docs/third-model-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Third-model run

An extra added after the plan ([PLAN.md, Deviations](../PLAN.md#deviations)): the [second-model run](second-model-run.md) again on `claude-opus-5-5` at effort `high`. Every second-model-set question for all 48 cases, in `summary`, `summary-big`, `search` and `search-nudged`: cycle 4 only, one seeded question per family, 8 per case, 384 per arm and 1,536 in all. It decides no hypothesis. The harness is the one the pilot passed on (`1398cda76bb2…`); no harness file changed. Analysis is left to the [report](../REPORT.md#third-model).

Opus is priced at $4 and $20 per million input and output tokens, cache reads at $0.20 and cache writes at $5, in `backread_exp.cost.PRICES`.

## Calibration

The estimator's Opus numbers come from a paid sample: the second-model set on the pilot's 3 cases at `high`, 24 questions per arm, $2.96 against the $2.83 the estimator gave with Haiku's output ([traces](../results/calibration/reader-opus-high)). Opus wrote 71, 104, 94 and 92 output tokens per request in `summary`, `summary-big`, `search` and `search-nudged`, and each search round added 304 tokens to the next request. With those the estimate for the whole run came to **$48.26**, under the $50 stop line.

## The run

It ran in two steps under one run id, `third-model-claude-opus-5-5`, as the Sonnet run did: 2 cases first, then the rest by resuming the same directory.

| | 2-case check | Rest (the 1,472 after the check) |
| --- | --- | --- |
| Estimate printed before the run | $1.99 | $46.27 still to run ($48.26 for the whole run) |
| Run cap | `--max-usd 3.50` | `--max-usd 52`, which counts the check's spend too |
| Measured | $1.949 | $47.111 |
| Measured / estimate | 0.98 | 1.02 |

The whole run cost **$49.06** against the $48.26 printed before it (1.02x). The ledger holds 3,083 entries under `third-model-claude-opus-5-5`, one per request, summing to the same $49.06. With the calibration sample the project ledger stands at $94.16, under its $100 cap. Both steps ran at the default concurrency; the full step took about 15 minutes.

## By arm

| arm | questions | usable | measured | requests / q | output / request |
| --- | ---: | ---: | ---: | ---: | ---: |
| summary | 384 | 384 | $3.855 | 1.00 | 61 |
| summary-big | 384 | 384 | $11.697 | 1.00 | 110 |
| search | 384 | 384 | $15.611 | 2.83 | 93 |
| search-nudged | 384 | 384 | $17.896 | 3.20 | 88 |
| **total** | 1,536 | 1,536 | $49.059 | | |

Every answer is usable: every question's last reply ended with `end_turn`. The estimate by arm was $4.02, $11.75, $14.81 and $17.68. Opus searched more than the sample showed (2.83 requests per `search` question against 2.71 in the sample), which is where the extra cost over the estimate comes from.
Binary file not shown.
55 changes: 55 additions & 0 deletions results/calibration/reader-opus-high/estimate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"model": "claude-opus-5-5",
"counter": "token-counting endpoint",
"assumptions": "the pilot (claude-haiku-5-5, high, 111 questions per arm), borrowed: none measured for claude-opus-5-5 at high",
"questions": 96,
"total_usd": 2.8256014414414414,
"total": {
"requests": 149.6216216216216,
"input": 549535.4954954955,
"cache_write": 0.0,
"cache_read": 0.0,
"output": 31372.972972972973,
"usd": 2.8256014414414414
},
"by_arm": {
"summary": {
"questions": 24,
"requests": 24.0,
"input": 53384.0,
"cache_write": 0.0,
"cache_read": 0.0,
"output": 4176.0,
"usd": 0.297056
},
"summary-big": {
"questions": 24,
"requests": 24.0,
"input": 172416.0,
"cache_write": 0.0,
"cache_read": 0.0,
"output": 5160.0,
"usd": 0.792864
},
"search": {
"questions": 24,
"requests": 38.7027027027027,
"input": 115713.87387387388,
"cache_write": 0.0,
"cache_read": 0.0,
"output": 9327.351351351352,
"usd": 0.6494025225225225
},
"search-nudged": {
"questions": 24,
"requests": 62.91891891891891,
"input": 208021.6216216216,
"cache_write": 0.0,
"cache_read": 0.0,
"output": 12709.621621621622,
"usd": 1.0862789189189188
}
},
"long_prompts": [],
"assumed_memories": 0
}
Loading
Loading