Skip to content

Conversation

jonatanklosko
Copy link
Member

When generating text with batch_size > 1, if there are padded batch items, the model gets zeroed input and may output arbitrary tokens. For some models that could be EOS and it would make no difference, but others could keep outputting a random token until the max length is reached (making the generation longer unnecessarily).

@jonatanklosko jonatanklosko merged commit 7617ff5 into main Jun 17, 2025
0 of 2 checks passed
@jonatanklosko jonatanklosko deleted the jk-padded-generation branch June 17, 2025 18:27
@jonatanklosko jonatanklosko mentioned this pull request Jun 17, 2025
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.

1 participant