logit_bias: apply configurable escalating EOG bias at low n_remain #14229
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
give eog an increasing (with length - per token, could be per codepoint in future) bias, only after a configured amount generated
add to
sample_apply
ann_remain
param, which is safer than having logit_bias maintain state for how many times it's called (which would lead to wrong assumptions e.g. when calling multiple times per token).see new command line options (incl a request 'after' instead of 'remain'):
-eog, --eog-bias-per-tok N when fewer than -start-eog-at-remain tokens are left to generate after
-n, add this bias eog for each subsequent token (default: 0.0)
-remain, --start-eog-at-remain N start applying -eog bias when this many tokens remain of the -n max
(default: 0.0)
-after, --start-eog-after N start applying -eog bias after this many tokens generated (default:
1000000000.0); whichever happens first between -remain and -after
applies
Verified that eog bias was effective at avoiding
overgeneration and is a reasonable supplement or alternative to editing the prompt; a constant eog bias, already supported in samplers, is likely to allow pathologically short outputs.
Make sure to read the contributing guidelines before submitting a PR