Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update utils.py #1012

Merged
merged 3 commits into from
Nov 29, 2023
Merged

Update utils.py #1012

merged 3 commits into from
Nov 29, 2023

Conversation

ZihanWang314
Copy link
Contributor

update compute_accuracy to deal with the cases where str_chosen and str_rej got the same scores, which is probably what the developers don't want

update compute_accuracy to deal with the cases where str_chosen and str_rej got the same scores, which is probably what the developers don't want
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@lvwerra
Copy link
Member

lvwerra commented Nov 20, 2023

Thanks for the PR! Can you elaborate a bit more why this is bad and what bad side effects this has?

@ZihanWang314
Copy link
Contributor Author

When a model gives exactly same scores for the sentence to accept and the sentence to reject, the current evaluation metric will set this pair to be "correct". However, the above scenario is usually caused by the model having some problems in encoding sentences (e.g. over-quantized), or the two sentences exactly being the same, which we both don't expect. I think putting a warning here and defining this pair as "wrong" or "random" would be helpful for the developers to observe these problems.

@lvwerra
Copy link
Member

lvwerra commented Nov 21, 2023

I see, thanks! In that case I'd prefer to just add a warning but leave the computation logic the same. Does that make sense?

@ZihanWang314
Copy link
Contributor Author

sure it makes sense. Thanks for your suggestions!

updated so only warning is reserved
trl/trainer/utils.py Outdated Show resolved Hide resolved
Co-authored-by: Leandro von Werra <[email protected]>
@lvwerra lvwerra merged commit 4b67af3 into huggingface:main Nov 29, 2023
9 checks passed
lapp0 pushed a commit to lapp0/trl that referenced this pull request May 10, 2024
* Update utils.py

update compute_accuracy to deal with the cases where str_chosen and str_rej got the same scores, which is probably what the developers don't want

* Update utils.py

updated so only warning is reserved

* Update trl/trainer/utils.py

Co-authored-by: Leandro von Werra <[email protected]>

---------

Co-authored-by: Leandro von Werra <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants