Repository navigation
Fix Probability metric to aggregate over gold choices, not all choices - #1461
Open
Sivadheeraj5356 wants to merge 2 commits into
Open
Sivadheeraj5356 wants to merge 2 commits into
Sivadheeraj5356 wants to merge 2 commits into
Conversation
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.
Bug
Probability.computeinsrc/lighteval/metrics/metrics_sample.pynever usesdoc.gold_index: it aggregatesnp.exp(logprobs)over all choices, so with the defaultnp.maxaggregation it returns the probability of the best-scoring choice rather than the gold one. This contradicts the class docstring ("Returns the probability of choosing gold choice ignoring probabilities of other choices... aggregated probability of the gold choices"),ProbabilityMetric's docstring ("returns the probability of the gold choice given normalization"), and the siblingNormalizedMultiChoiceProbability, which indexesnormalized_probs[gold_ixs].Reproduction
Fix
Filter to gold probabilities before aggregating, mirroring
NormalizedMultiChoiceProbability(as_listhandles both int and list gold indices):Tests
test_prob, which encoded the current behavior by aggregating over non-gold choices; it now exercises aggregation over multiple gold indices.metrics_sample.pywith heavy third-party deps stubbed and asserting 4 numeric cases: single gold 0.7, multi-gold min-aggregation 0.1, gold-not-argmax 0.1 (regression), gold-is-argmax 0.7 unchanged.