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

[feature] Exempt arbitrary tokens from penalties #3675

Closed
shibe2 opened this issue Oct 19, 2023 · 3 comments
Closed

[feature] Exempt arbitrary tokens from penalties #3675

shibe2 opened this issue Oct 19, 2023 · 3 comments
Labels

Comments

@shibe2
Copy link
Contributor

shibe2 commented Oct 19, 2023

Some tokens are meant to appear often in the text, and it may be desirable to avoid penalizing them because of their frequency. For newline token, there is an option: penalize_nl or --no-penalize-nl. However, other tokens that are used in prompt formatting appear often as well, and there's no option to exclude them from penalties.

Models with added tokens may have some tokens both in formatting and in model's output. In particular, some models use im_end token as stop token. This is already being discussed in #3538. The concern is that responses may get unnecessarily long as the stop token gets penalized more and more because of its presence in every message.

To address this issue, I propose adding an option to exempt arbitrary tokens from penalties. This new option would work similarly to penalize_nl, and would supersede it. It should be independent from the logit_bias.

Another possible solution is to automatically exclude all stop tokens from penalties. While this approach may be easier, it does not cover all cases, such as semicolon. Though in fact, these approaches are not mutually exclusive and could both be implemented if desired.

Copy link
Contributor

github-actions bot commented Apr 4, 2024

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this as completed Apr 4, 2024
@aehlke
Copy link

aehlke commented Apr 5, 2024

dont think this is stale?

@shibe2
Copy link
Contributor Author

shibe2 commented Apr 6, 2024

Someone else proposed a more general solution: supplying separate text for penalty calculation. It can exclude formatting elements like "ASSISTANT:" and end tokens. But I can't find that proposal now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants