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

Length Penalty only affects beam search #1143

Open
jacob-mink-1996 opened this issue Nov 4, 2024 · 2 comments
Open

Length Penalty only affects beam search #1143

jacob-mink-1996 opened this issue Nov 4, 2024 · 2 comments
Assignees

Comments

@jacob-mink-1996
Copy link

In the docs, it specifies that length_penalty is only for beam search - that means that in multinomial sampling, length_penalty does not change the generation.

* @param length_penalty exponential penalty to the length that is used with beam-based generation. It is applied as an exponent to

It would be useful if length_penalty could be used in combination with max_length or max_new_tokens in order to scale the importance of the eos token during multinomial sampling, then it would help to get prompt results that end more naturally as the max_length limit approaches.

@Wovchena
Copy link
Collaborator

Wovchena commented Nov 5, 2024

@sbalandi, is length_penalty applied to greedy and multinational after the implementation switched to the Sampler? If so, please update doc strings for C++ and Python.

@sbalandi
Copy link
Contributor

sbalandi commented Nov 5, 2024

no, length_penalty is supported for beam search only now

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

3 participants