Introduction
SpergSort highly-opinionated implementation of adaptive sorting using the Bradley-Terry model for paired comparisons with the goal of generating the most informative ranking of ไนๆจๅ๏ผ๏ผ members. Based on Gwernโs research on statistical pairwise ranking and sorting of items, it provides a statistically robust way to rank idols through pairwise comparisons.
Mathematical Foundation
Bradley-Terry Model
At its core, SpergSort uses the Bradley-Terry model which posits that each item i has a latent โstrengthโ parameter $\beta_i$, and the probability of item i being preferred over item j is:
\[P(i \text{ beats } j) = \frac{\exp(\beta_i)}{\exp(\beta_i) + \exp(\beta_j)}\]Adaptive Selection
Rather than using a fixed comparison sort algorithm, SpergSort employs an adaptive strategy that prioritizes comparisons that would be most informative. For each potential comparison between items i and j, we calculate a score:
\[\text{score}_{ij} = c_{ij} - \frac{|\beta_i - \beta_j|}{1000} + p_{ij}(t)\]Where:
- $c_{ij}$ is the number of previous comparisons between i and j
- $\beta_i - \beta_j$ represents uncertainty (larger differences suggest more certain ordering)
- $p_{ij}(t)$ is a time penalty that decreases as time passes since the last comparison
Confidence Level
The confidence in our sorting is determined by two factors:
- Average comparisons per item ($\bar{c}$)
- Standard deviation of scores ($\sigma$)
For n items, we target: \(\bar{c} = \lceil n \log_2(n) \cdot 0.3 \rceil \text{ comparisons}\) \(\sigma_{target} = 100\sqrt{\frac{n}{10}} \text{ score spread}\)
<90 IQ Section: Sorting with Fruits ๐๐๐
Imagine you have a basket of different fruits and you want to rank them by how much you like them. But hereโs the catch - you can only compare two fruits at a time!
How It Works (Simple Version)
- The app shows you two fruits
- You pick which one you like better
- The app remembers your choice
- It keeps showing you different pairs
- Eventually, it figures out your complete ranking!
For example:
- Round 1: ๐ vs ๐ (you pick ๐)
- Round 2: ๐ vs ๐ (you pick ๐)
- Round 3: ๐ vs ๐ (you pick ๐)
Final ranking:
- ๐ Orange (best)
- ๐ Apple (second)
- ๐ Banana (third)
Use cases
Entertainment Content Ranking
- Example: Tom Scottโs โWhat Is The Best Thing?โ project where he used pairwise comparison to rank 7,188 items with 1.2 million votes to determine the best things in the world
- Perfect for ranking subjective content like media, songs, or fan preferences
Product Feature Prioritization
- Example: Labsterโs UX Research team used pairwise comparison to test assumptions about customer feature requests
- Helped identify that what the sales team thought was a top priority actually didnโt make the top 10 customer needs
Competitive Gaming Rankings
- Example: Chess.comโs player rating system using Glicko 2
- Each game serves as a pairwise comparison between players
- Players start at 1500 points and move up/down based on performance