[CI][Bugfix] Improve cosine similarity calculation by incorporating length harmony adjustment in text comparison#2964
Merged
Conversation
…length harmony adjustment in text comparison Signed-off-by: wangyu <410167048@qq.com>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Collaborator
Author
|
@amy-why-3459 PTAL |
Contributor
|
Thank you so much for your quick fix. To prevent CI from continuing to fail, we need to merge the bug fix before merging this change. |
nainiu258
pushed a commit
to nainiu258/vllm-omni
that referenced
this pull request
Apr 21, 2026
…ength harmony adjustment in text comparison (vllm-project#2964) Signed-off-by: wangyu <410167048@qq.com> Signed-off-by: nainiu258 <cperfect02@163.com>
qinganrice
pushed a commit
to qinganrice/vllm-omni
that referenced
this pull request
Apr 23, 2026
…ength harmony adjustment in text comparison (vllm-project#2964) Signed-off-by: wangyu <410167048@qq.com>
lengrongfu
pushed a commit
to lengrongfu/vllm-omni
that referenced
this pull request
May 1, 2026
…ength harmony adjustment in text comparison (vllm-project#2964) Signed-off-by: wangyu <410167048@qq.com>
clodaghwalsh17
pushed a commit
to clodaghwalsh17/nm-vllm-omni-ent
that referenced
this pull request
May 12, 2026
…ength harmony adjustment in text comparison (vllm-project#2964) Signed-off-by: wangyu <410167048@qq.com>
daixinning
pushed a commit
to daixinning/vllm-omni
that referenced
this pull request
May 28, 2026
…ength harmony adjustment in text comparison (vllm-project#2964) Signed-off-by: wangyu <410167048@qq.com>
quyifei23
pushed a commit
to quyifei23/vllm-omni
that referenced
this pull request
Jun 6, 2026
…ength harmony adjustment in text comparison (vllm-project#2964) Signed-off-by: wangyu <410167048@qq.com>
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.
PLEASE FILL IN THE PR DESCRIPTION HERE ENSURING ALL CHECKLIST ITEMS (AT THE BOTTOM) HAVE BEEN CONSIDERED.
Purpose
To address the insensitivity issue in similarity calculation exposed by #2953 and #2812 when dealing with repeated text patterns in test case.
Problem Analysis:
The n-gram counting cosine similarity treats multiple occurrences of "ABC" in "ABCABCABC" as part of the vector, still considering it "directionally similar" to a single "ABC". This results in an inflated similarity score where length differences are not properly reflected, making it difficult to flag as anomalous.
Solution:
In cosine_similarity_text, introduce a length-imbalance-sensitive factor (e.g., F1-style harmonic mean of lengths) multiplied by the original cosine similarity. This approach keeps the behavior unchanged for equal-length texts while suppressing similarity scores in such repetitive cases.
Test Plan
2.run test case in CI
Test Result
1.local
2.ci
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model. Please runmkdocs serveto sync the documentation editions to./docs.BEFORE SUBMITTING, PLEASE READ https://github.com/vllm-project/vllm-omni/blob/main/CONTRIBUTING.md (anything written below this line will be removed by GitHub Actions)