[GH-ISSUE #306] why tokenized_prompts.argmax =49407,'<|endoftext|>' #262

Open
opened 2026-10-31 21:13:07 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @Harzva on GitHub (Dec 16, 2022).
Original GitHub issue: https://github.com/openai/CLIP/issues/306

Can <|endoftext|> represent global information of tokenized_prompts?why tokenized_prompts.argmax(dim=-1)
'<|endoftext|>': 49407
like cls_token of transformer?
Thanks

Originally created by @Harzva on GitHub (Dec 16, 2022). Original GitHub issue: https://github.com/openai/CLIP/issues/306 Can <|endoftext|> represent global information of tokenized_prompts?why tokenized_prompts.argmax(dim=-1) '<|endoftext|>': 49407 like cls_token of transformer? Thanks
Author
Owner

@jongwook commented on GitHub (Dec 17, 2022):

Yes. argmax selects the largest value in the input which is the EOT token. Because of the autoregressive mask, SOT (or CLS for the same purpose) at the beginning position will not be able to aggregate the global information, so the network is instead trained to produce the text features at the position of EOT.

<!-- gh-comment-id:1355911444 --> @jongwook commented on GitHub (Dec 17, 2022): Yes. `argmax` selects the largest value in the input which is the EOT token. Because of the autoregressive mask, SOT (or CLS for the same purpose) at the beginning position will not be able to aggregate the global information, so the network is instead trained to produce the text features at the position of EOT.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openai/CLIP#262
No description provided.