Add paired answer-quality A/B evaluation - #4
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 507769928f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "--usage-file", | ||
| str(usage_path), |
There was a problem hiding this comment.
Make usage paths absolute before launching Hermes
With the documented relative --results .quality-ab/results.jsonl, this passes a relative usage path to a subprocess whose cwd is the disposable evidence workspace. Hermes therefore writes—or attempts to write—the receipt beneath that workspace rather than the repository-level .quality-ab/usage directory, and the workspace is deleted before usage_path is read. Every successful trial is consequently marked missing_usage, preventing the experiment from producing eligible pairs; resolve the receipt path before launching the subprocess.
Useful? React with 👍 / 👎.
| existing = _load_results(args.results) | ||
| completed = { | ||
| (str(row.get("pair_id")), str(row.get("arm"))) for row in existing | ||
| } |
There was a problem hiding this comment.
Retry contaminated arms instead of marking them complete
When any arm times out, fails, lacks usage, or reports route drift, its contaminated row is still added to completed. Subsequent run invocations permanently skip that arm, while analyze requires all 72 pairs to be uncontaminated, so one transient failure leaves the documented resumable experiment stuck in collecting unless the user manually edits the JSONL file. Only valid rows should satisfy completion, or contaminated rows must be replaceable on retry.
Useful? React with 👍 / 👎.
| pairs, duplicates = _paired_rows(rows) | ||
| eligible = [ | ||
| (control, treatment) | ||
| for control, treatment in pairs | ||
| if not control.get("contaminated") and not treatment.get("contaminated") | ||
| ] |
There was a problem hiding this comment.
Reject rows from a different experiment configuration
Eligibility checks only the row-controlled contaminated flag and never verifies expected pair IDs, experiment ID, prompt hash, arm mode, or consistent model/provider/reasoning. If a results file is reused after changing the suite or route, its previously valid rows remain uncontaminated and can be combined into a complete non-inferiority decision attributed to the current suite, despite violating the matched fixed-configuration design. Validate every pair against the current plan and reject mixed run configurations before computing statistics.
Useful? React with 👍 / 👎.
66b78e1 to
f583a8d
Compare
f583a8d to
33fc3fa
Compare
Objective
Measure whether Token Terminator preserves answer quality versus off mode when the exact same prompts and evidence are sent to the same Hermes model/provider/reasoning configuration. Answer quality is the primary metric; token savings are secondary and cannot compensate for a quality loss.
Stage 1 experiment
Methodological defects fixed
Verification
Run cost
No experiment provider calls were made by this PR. Stage 1 uses 72 OpenAI Codex OAuth answer calls with expected /usr/bin/bash marginal API cost while consuming account quota and wall-clock time.