Skip to content

Commit e1b3f06

Browse files
authored
Merge pull request #10 from castorini/complete-side-by-side-pipeline
Complete side by side pipeline
2 parents 172d4ba + e2d5a96 commit e1b3f06

14 files changed

Lines changed: 3029 additions & 33 deletions

README.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,8 @@ answer file is one system/run, using either the normalized `answers` schema from
328328
`materialize trec-answers` or official TREC RAG rows. Sentence-level
329329
`answer[].text` fields are concatenated into plain answer text for the judge;
330330
citations and references are not rendered in the prompt.
331+
For the full side-by-side commands used in the TREC RAG and Search Arena runs,
332+
see [`docs/reproduction_side-by-side_arena.md`](docs/reproduction_side-by-side_arena.md).
331333

332334
```bash
333335
uv run ragdoll arena compare-all \
@@ -529,6 +531,122 @@ uv run ragdoll cost --raw-events-dir results/metrics/../raw-events \
529531
--input-price 0.25 --output-price 2.0
530532
```
531533

534+
## Arena System Comparison
535+
536+
Rank a set of RAG systems with Search Arena-style pairwise LLM judgments. Each
537+
answer file is one system/run, using either the normalized `answers` schema
538+
from `materialize trec-answers` or official TREC RAG rows. Sentence-level
539+
`answer[].text` fields are concatenated into plain answer text for the judge;
540+
citations and references are not rendered in the prompt.
541+
For the full side-by-side commands used in the TREC RAG and Search Arena runs,
542+
see [`docs/reproduction_side-by-side_arena.md`](docs/reproduction_side-by-side_arena.md).
543+
544+
```bash
545+
uv run ragdoll arena compare-all \
546+
--answers-dir answers/ \
547+
--output-dir results/arena \
548+
--model openai-codex/gpt-5.5 \
549+
--thinking medium \
550+
--prompt-variant rich-human-voter \
551+
--overwrite
552+
```
553+
554+
`--answers-dir` loads all `*.jsonl` files in sorted filename order. For a small
555+
ad hoc run, pass repeated `--answers <file>` flags instead. The native arena
556+
judge uses `--prompt-variant rich-human-voter`, which is the final prompt used
557+
for the reported no-rubric TREC RAG runs.
558+
559+
Add `--rubric-file <jsonl>` to use weighted, topic-specific rubric criteria
560+
with the rubric-guided arena judge:
561+
562+
```bash
563+
uv run ragdoll arena compare-all \
564+
--answers-dir answers/ \
565+
--rubric-file rubric.jsonl \
566+
--prompt-variant coverage-count \
567+
--output-dir results/arena-rubric \
568+
--model openai-codex/gpt-5.5 \
569+
--thinking medium \
570+
--overwrite
571+
```
572+
573+
The rubric file should contain one JSONL row per topic with `qid` and
574+
`criteria`; each criterion should include `text`, and may include `tier`,
575+
`weight`, `type`, and `source_nugget`. The `coverage-count` prompt is the final
576+
rubric-guided prompt used for the reported TREC RAG rubric runs.
577+
578+
The full TREC RAG and Search Arena side-by-side experiments use fixed prompt
579+
variants, model settings, seeds, and answer/rubric subsets. The exact
580+
reproduction commands are kept in
581+
[`docs/reproduction_side-by-side_arena.md`](docs/reproduction_side-by-side_arena.md)
582+
so this overview stays focused on the interface and output schema.
583+
584+
For every pair of systems, RAGDoll compares only shared `qid`s and never mixes
585+
answers from different questions. Assistant A/B display order is randomized per
586+
task from `--seed` and recorded in `judgments.jsonl`, so `[[A]]`/`[[B]]` verdicts
587+
can be mapped back to the original `run_id`. The output directory contains
588+
`tasks.jsonl`, `judgments.jsonl`, `pairwise.csv`, `coverage.csv`,
589+
`leaderboard.csv`, and `raw-events/`. The headline ranking is an Arena-style
590+
rating fit from the pairwise judgments; pairwise preference rates are
591+
diagnostics.
592+
593+
To reduce judge cost, sample a fixed number of shared topics per system pair
594+
before materialization or judging:
595+
596+
```bash
597+
uv run ragdoll arena compare-all \
598+
--answers-dir answers/ \
599+
--output-dir results/arena-k5 \
600+
--sample-topics-per-pair 5 \
601+
--sampling-seed 13 \
602+
--model openai-codex/gpt-5.5
603+
```
604+
605+
The same flags work with `materialize arena`; sampling is deterministic per
606+
system pair and never compares answers from different `qid`s.
607+
608+
For a more Chatbot Arena-like sparse comparison graph, sample battles within
609+
each topic instead. This targets a fixed number of battle appearances per
610+
available system per topic:
611+
612+
```bash
613+
uv run ragdoll arena compare-all \
614+
--answers-dir answers/ \
615+
--output-dir results/arena-d2 \
616+
--sample-battles-per-system-per-topic 2 \
617+
--sampling-seed 13 \
618+
--model openai-codex/gpt-5.5
619+
```
620+
621+
With 76 systems, `--sample-battles-per-system-per-topic 2` materializes about
622+
76 battles per topic; with 102 systems, it materializes about 102 battles per
623+
topic. RAGDoll also supports the absolute `--sample-battles-per-topic <n>` flag
624+
for fixed-size experiments. The topic and battle sampling flags are mutually
625+
exclusive.
626+
627+
The judging workflow and stored verdicts are independent of the ranking backend:
628+
`judgments.jsonl` records the same pairwise `[[A]]`, `[[B]]`, and `[[Tie]]`
629+
outcomes, while `leaderboard.csv` converts those outcomes into Arena ratings.
630+
Leaderboard rows contain `rank`, `run_id`, `arena_score`, `n_judgments`, `wins`,
631+
`losses`, and `ties`.
632+
633+
Arena scores are fit with the `arena-rank` package from LMArena
634+
(<https://github.com/lmarena/arena-rank>). RAGDoll converts each valid
635+
judgment into the package's standard `model_a`, `model_b`, `winner` schema, with
636+
wins as `model_a`/`model_b` and ties as `tie`. `arena-rank` then fits the
637+
Bradley-Terry/logistic paired-comparison model and reports ratings on an
638+
Elo-like Arena scale centered at `1000`, with `400` points corresponding to one
639+
base-10 log-odds unit.
640+
641+
Materialize exact judge prompts without running Pi:
642+
643+
```bash
644+
uv run ragdoll materialize arena \
645+
--answers-dir answers/ \
646+
--output-file results/arena.tasks.jsonl \
647+
--prompt-variant rich-human-voter
648+
```
649+
532650
## Data
533651

534652
Evaluation inputs and gold for the Assignment and E2E tasks live under `data/`,

0 commit comments

Comments
 (0)