-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Add token healing to main
and server
#7187
base: master
Are you sure you want to change the base?
Conversation
8c44086
to
c9b2297
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks OK, though I haven't ran any tests. Would appreciate if people play with this and provide some feedback before merging
Overall, I'm a bit concerned that the logic for managing the sampling state and the KV cache in the examples starts to become very convoluted when we add such kind of techniques (e.g. context shifting, self-extend, templates, speculation, ...). We have to start refactoring this and simplify it.
It's not specific to this PR, just a general thought that I have lately. Will try to prioritise this a bit, though I don't have a very good idea what specifically needs to be done yet, so any ideas and help from others of how to simplify the code are appreciated
8abdf56
to
ffca1bb
Compare
ffca1bb
to
50af2fc
Compare
Dynamic rollback now starts checking prefixes based on the length of the longest token.
Infill tokens were being rolled back in certain cases.
Unify `main` and `server` token healing argument handling.
2ffe10a
to
b27f87d
Compare
I am sharing my results of evaluating token healing with a simple evaluation script that uses either
|
Add different token healing strategies to
main
andserver
. Token healing works by chopping off some tokens from the tokenized prompt and then constraining the decoding to match the bytes of the removed tokens.Example usage:
Server usage:
Solves #5765.