Skip to content

Resample whole pages in bootstrap confidence intervals - #62

Merged
davanstrien merged 6 commits into
mainfrom
fix/page-level-bootstrap
Nov 2, 2026
Merged

davanstrien merged 6 commits into
mainfrom
fix/page-level-bootstrap

Conversation

@davanstrien

@davanstrien davanstrien commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

_bootstrap_ci resampled single comparisons. All model pairs on one page share that page's image and difficulty, so those comparisons are not independent, and the resulting intervals can be too narrow.

The bootstrap now resamples whole pages, grouped by sample_idx, and refits Bradley-Terry on each replicate. The docs and generated dataset card now say page-level.

Page resampling adds two failure cases, which this PR also handles:

  • Few or identical pages: these give narrow or zero-width intervals. A pair now needs at least 10 distinct pages per model (MIN_PAGES_TO_RESOLVE) to count as resolved, in both rankings_resolved and classify_adjacent_pairs. The threshold is a judgement call, not a measured value.
  • Models missing from a replicate: with targeted judging, a resample can omit every page with a given model. That model now gets no rating in that replicate, instead of an arbitrary one near 1500.

Behaviour changes:

  • Intervals can widen, and no run can stop on resolved rankings until each ranked model has 10 pages. Both can increase judge calls on the same data.
  • The size-based prefer-smaller rule does not use the page minimum. It keeps its own direct-comparison minimum.

Not covered:

  • Optional stopping, or variation between books or collections.
  • A replicate that fits a subset of models has a different centre, so targeted runs may get wider intervals.

Tests: 623 passed, Ruff clean. The new tests cover page-level resampling, the page minimum, and models missing from a replicate.

🤖 Generated with Claude Code

https://claude.ai/code/session_016isSPnE9rsNNnxSw1x9Lva

davanstrien and others added 6 commits November 2, 2026 13:02
Comparisons from one page share an image and its difficulty, so they are
not independent. Resampling single comparisons made intervals too narrow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016isSPnE9rsNNnxSw1x9Lva
Identical or few pages give zero-width intervals, which could end adaptive
judging after one batch. Rankings now need at least 10 distinct pages to count
as resolved. A model absent from a resampled replicate now gets no rating in
that replicate instead of an arbitrary one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016isSPnE9rsNNnxSw1x9Lva
A model seen on one page could get a narrow interval and end targeted judging,
because the page minimum counted pages across the whole board.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016isSPnE9rsNNnxSw1x9Lva
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016isSPnE9rsNNnxSw1x9Lva
Each fit centres on its own models, so a replicate that omitted a model sat on
a different scale. A rare model could inflate other models' intervals with no
new evidence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016isSPnE9rsNNnxSw1x9Lva
@davanstrien
davanstrien merged commit 4aa1285 into main Nov 2, 2026
1 check passed
@davanstrien
davanstrien deleted the fix/page-level-bootstrap branch November 2, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant