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

Where is the sequence parameter in SimPo_loss funciton #67

Open
yunyiliu opened this issue Sep 20, 2024 · 1 comment
Open

Where is the sequence parameter in SimPo_loss funciton #67

yunyiliu opened this issue Sep 20, 2024 · 1 comment

Comments

@yunyiliu
Copy link

for the code https://github.com/princeton-nlp/SimPO/blob/main/scripts/simpo_trainer.py#L560
I have a question where is the parameter that represents the sentence sequence length, which is used to limit the text length mentioned in the paper?

@yumeng5
Copy link
Collaborator

yumeng5 commented Oct 13, 2024

Hi @yunyiliu

The length normalization is computed here:

return (per_token_logps * loss_mask).sum(-1) / loss_mask.sum(-1)

Best,
Yu

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