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

Implementation of RRHF #5

Closed
Guochry opened this issue Jul 16, 2023 · 2 comments
Closed

Implementation of RRHF #5

Guochry opened this issue Jul 16, 2023 · 2 comments

Comments

@Guochry
Copy link

Guochry commented Jul 16, 2023

Firstly, great thanks to your amazing work on alignment!
Besides, I am curious about the implementation of RRHF in your first experiment: is it initialized by the open source Wombat models provided by RRHF team, or the model you trained by RRHF method?

@agi-templar
Copy link
Owner

agi-templar commented Jul 16, 2023

We used the open-sourced implementation and trained the model on our dataset for a fair comparison (so that the data factor is controlled). We find the main issue of RRHF is, if the ratings are the same for multiple completions, the loss calculation based on ranking will be wrong (how to decide their rankings since their scores are the same)? Some other users have found the same issue (see GanjinZero/RRHF#25).

Stable Alignment does not have this issue as we use the difference in the scores to modulate the margin. So if the difference is zero (same score, same ranking), the margin for contrastive learning will be canceled. And the floor operation in the loss can make sure we are not overoptimizing because those already aligned samples will be skipped during learning (loss = 0, by torch.max).

@Guochry
Copy link
Author

Guochry commented Jul 16, 2023

Great thanks again

@Guochry Guochry closed this as completed Aug 31, 2023
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

No branches or pull requests

2 participants