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

Bug in calculating loss when using DPO #30

Closed
zeta-zl opened this issue Apr 22, 2024 · 1 comment
Closed

Bug in calculating loss when using DPO #30

zeta-zl opened this issue Apr 22, 2024 · 1 comment

Comments

@zeta-zl
Copy link

zeta-zl commented Apr 22, 2024

I have encountered what appears to be a bug in the calculation of the loss function within the dataloader.py file, specifically between lines 167 and 174. This issue arises while using the dpo method.

pi_logratios = idk_loss_current - forget_loss_current
ref_logratios = idk_loss_oracle - forget_loss_oracle

beta = 0.1
loss = -F.logsigmoid(beta * (pi_logratios - ref_logratios)).mean()
print(loss.item())
loss = -pi_logratios.mean()
loss = -idk_loss_current.mean()  

It appears that the final calculation of loss as -idk_loss_current.mean() contradicts the expected retult described in the paper.
Thank you for your attention to this matter.

@molereddy
Copy link

It was clarified on an earlier issue that the "dpo" loss is deprecated and isn't used in the results #20 (comment)

@zeta-zl zeta-zl closed this as completed Apr 23, 2024
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