Skip to content

[PPOTrainer] - add comment of zero masking (from second query token)#763

Merged
younesbelkada merged 1 commit intohuggingface:mainfrom
zuoxingdong:patch-1
Sep 13, 2023
Merged

[PPOTrainer] - add comment of zero masking (from second query token)#763
younesbelkada merged 1 commit intohuggingface:mainfrom
zuoxingdong:patch-1

Conversation

@zuoxingdong
Copy link
Copy Markdown
Contributor

It took a while to understand why zero-masked tokens are one less than the length of query tokens.

If I got it correctly, it is because the first logit (and state-value) from the outputs refers to the second token in the query.

Hope this comment can be helpful to others who may encounter a similar question in the first-pass reading of the code :)

It took a while to understand why zero-masked tokens are one less than the length of query tokens. 

If I got it correctly, it is because the first logit (and state-value) from the outputs refers to the second token in the query. 

Hope this comment can be helpful to others who may encounter a similar question in the first-pass reading of the code :)
@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

HuggingFaceDocBuilderDev commented Sep 13, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Copy Markdown
Contributor

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, makes sense, thank you!

@younesbelkada younesbelkada merged commit 80890b1 into huggingface:main Sep 13, 2023
@zuoxingdong zuoxingdong deleted the patch-1 branch September 13, 2023 08:41
kushal-tri pushed a commit to kushalarora/trl that referenced this pull request Sep 19, 2023
…uggingface#763)

It took a while to understand why zero-masked tokens are one less than the length of query tokens. 

If I got it correctly, it is because the first logit (and state-value) from the outputs refers to the second token in the query. 

Hope this comment can be helpful to others who may encounter a similar question in the first-pass reading of the code :)
lapp0 pushed a commit to lapp0/trl that referenced this pull request May 10, 2024
…uggingface#763)

It took a while to understand why zero-masked tokens are one less than the length of query tokens.

If I got it correctly, it is because the first logit (and state-value) from the outputs refers to the second token in the query.

Hope this comment can be helpful to others who may encounter a similar question in the first-pass reading of the code :)
yxliu-TAMU pushed a commit to mincheolseong/ECEN743-GRPO-Project-Proposal that referenced this pull request Apr 20, 2025
…uggingface#763)

It took a while to understand why zero-masked tokens are one less than the length of query tokens. 

If I got it correctly, it is because the first logit (and state-value) from the outputs refers to the second token in the query. 

Hope this comment can be helpful to others who may encounter a similar question in the first-pass reading of the code :)
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