feat: add minority opinion detection for ranking disagreements#129
Open
bledden wants to merge 3 commits intokarpathy:masterfrom
Open
feat: add minority opinion detection for ranking disagreements#129bledden wants to merge 3 commits intokarpathy:masterfrom
bledden wants to merge 3 commits intokarpathy:masterfrom
Conversation
Adds calculate_tournament_rankings() as an alternative to simple mean ranking. Algorithm: - Convert ordinal rankings to pairwise matchups - For each pair of models, majority vote determines winner - Ties awarded 0.5 points to each - Final score = wins / total_matchups Benefits over mean ranking: - More robust to outlier rankings - Theoretically principled (Condorcet-style) - Handles cyclic preferences gracefully Both ranking methods now included in metadata: - aggregate_rankings: mean position (existing) - tournament_rankings: pairwise win percentage (new) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Documents the tournament-style pairwise comparison algorithm with: - Explanation of why it's more robust than mean averaging - Concrete example showing self-promotion bias scenario - Tables comparing mean vs tournament results - Outlier robustness validation (mean degrades 1.0→1.5, tournament stays 100%) - Summary of validation test coverage 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Detects when ≥30% of rankers significantly disagree with the consensus ranking for a model (placing it more than 1 position away from consensus). Backend changes: - Add detect_minority_opinions() function to council.py - Uses tournament ranking as consensus baseline - Reports dissent rate, positions, dissenters, and direction (overvalued/undervalued) - Configurable threshold (default 30%) and position tolerance (default 1) - Include minority_opinions in run_full_council metadata Frontend changes: - Add minorityOpinions prop to Stage2 component - Display minority opinions in a warning-styled card - Show direction badges (overvalued in red, undervalued in green) - List consensus position, dissent positions, and dissenter models Validation tests: - 8 test cases covering consensus, dissent detection, direction, threshold filtering, tolerance, edge cases, and realistic scenarios 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds minority opinion detection to flag when a significant portion of council members disagree with the consensus ranking.
Changes
Backend (
backend/council.py):detect_minority_opinions()functionrun_full_council()metadataFrontend:
Stage2.jsx: AddedminorityOpinionsprop and display componentStage2.css: Added warning-styled card with overvalued/undervalued badgesChatInterface.jsx: Pass minority_opinions to Stage2Validation
8 test cases in
tests/test_minority_opinions.py:test_no_minority_when_consensustest_minority_detected_with_dissenttest_minority_direction_undervaluedtest_below_threshold_not_flaggedtest_within_tolerance_not_flaggedtest_empty_inputstest_5_model_realistic_scenariotest_custom_thresholdDependencies
This PR builds on the tournament ranking feature (PR #128) which provides the consensus baseline.
Test plan
python3 tests/test_minority_opinions.py- all 8 tests pass🤖 Generated with Claude Code