Repository navigation
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.
Describe the bug
Recall uses
argmaxat depth 1, which chooses the first tied choice, but reverses an ascendingargsortfor larger depths. A correct choice at depth 1 can therefore disappear at depth 2 even though the scores and gold label are unchanged.To Reproduce
Before:
[1, 0, 1]. After:[1, 1, 1].Expected behavior
For valid floating-point log-probabilities (including negative infinity), use the same first-choice tie preference at every depth so top-k choices remain nested. This does not define NaN handling. Keep the existing
argmaxfast path at depth 1 and stably sort descending scores at larger depths. Gold-label handling, aggregation, API and dependencies are unchanged.Regression tests cover all ties, ties at the cutoff, different gold positions, multiple golds, unequal scores, negative infinity, a single choice, zero depth and depth larger than the choice count. They also check monotonicity and equivalence with unnormalized log-probability accuracy at depth 1.
Version info
Reproduced through normal imports from an editable installation of main
7fa19dc6f53a713ba8bb6541e7ed66dad2e24fd7: LightEval 0.13.1.dev0, Python 3.12.14, NumPy 2.5.4, Linux.Validation
make quality: passed.pre-commit run --all-files: passed.The 59 passing cases come from
tests/test_unit_base_metrics.py,tests/unit/metrics/test_normalizations.py, the newtests/unit/metrics/test_recall.py, and the selected JSON fixtures throughtests/unit/metrics/test_automated_metrics_pytest.py. This is a selected offline run, not the full metrics suite.The three existing skips are
test_pass_at_k_estimator(existing “Need to understand what it does” placeholder),test_f1_score_quasiandtest_f1(existing NLTK placeholder tests).The 14 deselections are:
test_f1_dynamic_metricandtest_exact_match_dynamic_metric: optional multilingual tokenization dependencies were not installed.bert_score,bleurt,extractiveness,faithfulness,bleu,bleu_1,bleu_4,rouge1,rouge2,rougeL,rougeLsum, androuge_t5. No full GPU/dev-gpu CI or end-to-end benchmark was run. No separate type-check command is defined by the repository CI.Prepared with AI assistance; no human review is claimed.