Elo Rating Update
Background
The Elo system updates two players' ratings after a match. The chess-rating heritage carried over directly to LLM-arena leaderboards: each side-by-side vote is a "match", winning model gains rating points, losing model drops. Anchor it to a starting rating (typically 1500) and you have ranked LMArena outputs.
Problem statement
Implement elo_update(rating_a, rating_b, score_a, K=32):
score_a is if A won, if B won, for a draw. Return (new_a, new_b).
Input
rating_a,rating_b—float, current ratings.score_a—floatin .K—float, the K-factor (default32for new ratings;16for stable).
Output
Returns a tuple (new_a: float, new_b: float).
Examples
Example 1 — equal ratings, A wins → A gains K/2
Input: rating_a=1500, rating_b=1500, score_a=1.0, K=32
Output: (1516.0, 1484.0)
Example 2 — equal ratings, draw → no change
Input: rating_a=1500, rating_b=1500, score_a=0.5
Output: (1500.0, 1500.0)
Example 3 — total rating is conserved
Input: any single update
Output: (new_a + new_b) == (rating_a + rating_b)
Example 4 — upset → large swing
Input: rating_a=1800, rating_b=1400, score_a=0.0, K=32
Output: a drops, b rises by ~30 points
Constraints
score_ain (binary or draw).K > 0.- Returns Python
floats.
Notes
- K-factor. Higher K = faster adjustment. FIDE uses 40 for new players, 20 for established, 10 for masters. LMArena tunes K based on number of votes received.
- Bradley-Terry equivalence. Elo ratings are a logarithmic re-scaling of Bradley-Terry strengths: .
▶ Run executes the 3 visible sample tests below in your browser. Submit runs the full suite — including hidden tests — on the server for an official verdict.
- •Reference example — equal ratings A wins
- •Sample — equal ratings draw, no change
- •Reference — upset, favorite loses