Skip to content

Conversation

@graehl
Copy link
Contributor

@graehl graehl commented Jun 16, 2025

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 an n_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

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` an `n_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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

examples server testing Everything test related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant