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

Bi-gram Repetation Penalty for the TGI configuration #2731

Open
mertege opened this issue Nov 7, 2024 · 0 comments
Open

Bi-gram Repetation Penalty for the TGI configuration #2731

mertege opened this issue Nov 7, 2024 · 0 comments

Comments

@mertege
Copy link

mertege commented Nov 7, 2024

Feature request

Add a new configuration parameter, "bigram_repetition_penalty", to the Text Generation Inference module. This parameter will introduce a mechanism that penalizes repeated bigrams in generated text, similar to how "repetition_penalty" operates for individual tokens, but extend this logic to two-token sequences (bigrams).
Integrate the "bigram_repetition_penalty" as an optional parameter within the text generation configuration. This would function by reducing the probability of selecting any token that, combined with the last generated token, forms a bigram already appearing in the generated sequence.

Motivation

Repetition in the generated text is a common issue in large language models, where the output may become redundant or repetitive, diminishing the quality of responses. While the existing "repetition_penalty" addresses this concern for individual tokens, it can decrease the usage of "stop words" and affect the response's nature. However, adding a "bigram_repetition_penalty" would provide finer control over text generation by preventing the model from generating the exact two-token phrases repeatedly.

Your contribution

I am open to collaborating with the community to implement this feature.

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

1 participant