diff --git a/README.md b/README.md index 13d122e..8c8289e 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,8 @@ When a long session fills its context, Claude Code replaces the conversation wit Yes, in a controlled test run before the plugin was built, with direct questions rather than a live task. On 48 long conversations, each compacted five times, an agent answered questions about what had been said earlier. With a 1,024-token summary plus search, it scored 0.80, against 0.53 for the summary alone and 0.72 for a summary four times the size. On `claude-haiku-5-5`, the capped keyword search used fewer tokens per question than the bigger summary and cost less per correct answer. +A stronger reader doesn't remove the need. On the 384 questions after the fifth compaction that all three models answered, the summary alone scored 0.42 on `claude-haiku-5-5` and 0.43 on `claude-opus-5-5`; with search, 0.72 and 0.85. On Opus, though, search cost about as much per correct answer as the bigger summary. + Score against mean tokens per question for each arm on claude-haiku-5-5, with 95% intervals: summary 0.53, summary-big 0.72, search 0.80, search-nudged 0.83, ceiling 0.95, floor 0.00 diff --git a/STATE.md b/STATE.md index 013cdfd..66ec331 100644 --- a/STATE.md +++ b/STATE.md @@ -17,6 +17,7 @@ The harness is built and runs end to end offline (`make offline`) against fake m ## Recently Done +- README: the "Does it help?" section also gives the `claude-opus-5-5` scores, checked like the other numbers, since a stronger reader is the obvious objection (#119) - 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) diff --git a/src/backread_exp/readme.py b/src/backread_exp/readme.py index 5f187ab..c9eaef2 100644 --- a/src/backread_exp/readme.py +++ b/src/backread_exp/readme.py @@ -109,10 +109,21 @@ def score(arm: str, places: int = 2) -> str: f"A second model, `{second['model']}`, ran a smaller grid", ] third = summary.get("third_model") + shared: dict[str, Any] = summary.get("shared_all") or {} + + def shared_score(arm: str, run: str) -> str: + return fmt_num(shared[arm][run]["score"], 2) + if third is not None: fragments += [ f"| `{third['model']}` third-model run | {_usd(parts[labels['third-model-']])} |", f"`{third['model']}` repeated it", + f"On the {shared['summary']['questions']:,} questions after the fifth compaction" + " that all three models answered, the summary alone scored" + f" {shared_score('summary', 'main')} on `{model}` and" + f" {shared_score('summary', 'third_model')} on `{third['model']}`;" + f" with search, {shared_score('search', 'main')} and" + f" {shared_score('search', 'third_model')}.", ] return fragments @@ -142,6 +153,15 @@ def cheapest(among: Sequence[str]) -> str: return min(among, key=per_correct) better = [a for a in arms if arms[a]["score"]["point"] > arms["summary"]["score"]["point"]] + third = summary.get("third_model") + third_arms: dict[str, Any] = third["arms"] if third else {} + + def third_close_in_cost() -> bool: + if not third_arms: + return False + search, big = (third_arms[a]["usd_per_correct"] for a in ("search", "summary-big")) + return search is not None and big is not None and abs(search - big) <= 0.05 * big + return { "used fewer tokens per question than the bigger summary": tokens("search") < tokens("summary-big"), @@ -153,6 +173,9 @@ def cheapest(among: Sequence[str]) -> str: "`floor` scores zero": arms["floor"]["score"]["point"] == 0, "Among the arms that score higher, `search` is cheapest.": bool(better) and cheapest(better) == "search", + "A stronger reader doesn't remove the need.": bool(third_arms) + and third_arms["search"]["score"]["point"] > third_arms["summary-big"]["score"]["point"], + "search cost about as much per correct answer as the bigger summary": third_close_in_cost(), } diff --git a/tests/test_readme.py b/tests/test_readme.py index 9e6c73e..b3efe02 100644 --- a/tests/test_readme.py +++ b/tests/test_readme.py @@ -117,3 +117,12 @@ def test_a_lost_second_model_is_caught( ) -> None: found = readme.problems(text, {**summary, "second_model": None}, ledger, PICKS) assert found == ["mentions a second-model run, but the summary has no second model"] + + +def test_a_moved_third_model_score_is_caught( + text: str, summary: dict[str, Any], ledger: list[LedgerEntry] +) -> None: + moved = copy.deepcopy(summary) + moved["shared_all"]["search"]["third_model"]["score"] = 0.70 + found = readme.problems(text, moved, ledger, PICKS) + assert any("with search, 0.72 and 0.70." in p for p in found)