Skip to content

feat(arena): weight model selection toward under-voted models#448

Draft
simonaszilinskas wants to merge 1 commit into
developfrom
feat/weighted-model-sampling
Draft

feat(arena): weight model selection toward under-voted models#448
simonaszilinskas wants to merge 1 commit into
developfrom
feat/weighted-model-sampling

Conversation

@simonaszilinskas

Copy link
Copy Markdown
Collaborator

Leaderboard stats get unreliable when some models have 10k battles and others ~100. This tilts selection slightly toward under-voted models so vote counts converge and comparisons rest on similar sample sizes.

Selection uses w_i = 1 / (n_match_i + smoothing)^alpha, normalized, with the max/min weight ratio capped at 3x. n_match comes from the RankingResult already cached in Redis by the leaderboard pipeline, so no new DB load. pick_two fetches the ranking once per call and reuses it across both pick_one picks.

Defaults are alpha=0.4, smoothing=50, max_ratio=3.0, all tunable via WEIGHTED_SAMPLING_* settings, with an ENABLED kill-switch in case anything looks off in prod.

The Methodology tab on the ranking page has a short new section explaining the bias (fr/en/da/sv).

Draft for now, want to eyeball real staging numbers before marking ready. Plan:

  • deploy to staging, check logs (weighted_pick at debug) for a day or two
  • verify n_match spread starts narrowing across low-vote models
  • then flip to ready

Tests: backend/llms/tests/test_weighting.py covers ordering, ratio clip, zero-vote smoothing, flag-off, and a Monte-Carlo distribution check. Run with .venv/bin/python -m unittest backend.llms.tests.test_weighting.

Leaderboard statistics get unreliable when some models have 10k battles
and others have ~100. Tilting selection slightly toward under-voted
models helps vote counts converge so comparisons rest on similar
sample sizes.

Selection uses w_i = 1 / (n_match_i + smoothing)^alpha, normalized,
with the max/min weight ratio capped at 3x. n_match comes from the
RankingResult already cached in Redis by the leaderboard pipeline,
so no new DB load. pick_two fetches once and passes the ranking to
both pick_one calls.

Defaults alpha=0.4, smoothing=50, max_ratio=3.0 are tunable via
WEIGHTED_SAMPLING_* settings, with an ENABLED kill-switch.

Methodology tab on the ranking page gets a short section explaining
the bias in fr/en/da/sv.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant