-
Notifications
You must be signed in to change notification settings - Fork 11.4k
Reverse prompt is sometimes ignored. #292
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I think this might have to do with the way the program deals with a large Related to this, there is the issue of interactive mode dropping out back to the shell after the number of requested tokens has been consumed. This makes people use large I think we could handle running out of tokens when in interactive mode differently, similar to what alpaca.cpp does. Instead of closing the program, resetting the counter and going into interacting mode. I will try to explore both issues later today and see if I can make a pull request. |
For this, we could add a flag that forbid the sampler to draw control symbols like begin/end of stream. |
Masking past context might be an issue, but I think it's useful to sample end of stream symbols if the model decides a particular sequence should end early. The main issue here (which is very easy to solve), is that ending the stream (or running out of token budget) shouldn't mean we should close the program if we are in interactive mode, but rather let the user input more text. I think I have figured out where the bug with the sampler not stopping when it should is. It seems the program keeps sampling new tokens regardless of the interactive state. If I'm not mistaken, the conditions in main.cpp:937 and main.cpp:995 can be true at the same time, but while I'll see if I can fix it, test it and make a pull request. |
This comment was marked as outdated.
This comment was marked as outdated.
I mentioned it in another issue: llama was trained with tokenizer augmentations, means the tokenizer occasionally did sub-optimal word partitioning at training time: https://github.com/google/sentencepiece#subword-regularization-and-bpe-dropout It is claimed it improves generalization. As a side effect trained model now considers forming words with sub-optimal tokens. Reverse prompt is detected by matching lists of tokens. So, if you search for |
I can confirm this has happened to me several times. |
* Check for reverse prompt by characters instead of tokens (#292) * Update main.cpp Wording. * Cleanup. * Remove unnecessary use of std::stringstream. --------- Co-authored-by: Johnman <tjohnman@github> Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
… (ggml-org#330) * Check for reverse prompt by characters instead of tokens (ggml-org#292) * Update main.cpp Wording. * Cleanup. * Remove unnecessary use of std::stringstream. --------- Co-authored-by: Johnman <tjohnman@github> Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
… (ggml-org#330) * Check for reverse prompt by characters instead of tokens (ggml-org#292) * Update main.cpp Wording. * Cleanup. * Remove unnecessary use of std::stringstream. --------- Co-authored-by: Johnman <tjohnman@github> Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
… (ggml-org#330) * Check for reverse prompt by characters instead of tokens (ggml-org#292) * Update main.cpp Wording. * Cleanup. * Remove unnecessary use of std::stringstream. --------- Co-authored-by: Johnman <tjohnman@github> Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
… (ggml-org#330) * Check for reverse prompt by characters instead of tokens (ggml-org#292) * Update main.cpp Wording. * Cleanup. * Remove unnecessary use of std::stringstream. --------- Co-authored-by: Johnman <tjohnman@github> Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
…ngs-0.22.0 Bump mkdocstrings from 0.21.2 to 0.22.0
… (ggml-org#330) * Check for reverse prompt by characters instead of tokens (ggml-org#292) * Update main.cpp Wording. * Cleanup. * Remove unnecessary use of std::stringstream. --------- Co-authored-by: Johnman <tjohnman@github> Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
… ideas * add translations packages * add translations packages * begining of translation * Check for reverse prompt by characters instead of tokens (ggml-org#292) (ggml-org#330) * Check for reverse prompt by characters instead of tokens (ggml-org#292) * Update main.cpp Wording. * Cleanup. * Remove unnecessary use of std::stringstream. --------- Co-authored-by: Johnman <tjohnman@github> Co-authored-by: Georgi Gerganov <ggerganov@gmail.com> * metal : fix `ggml_metal_log` vargs (ggml-org#4373) * docs: utilize the forward slash (/) as the path separator for Unix-like systems (ggml-org#11770) * close dropdown Menu function * no export here * automatic close sidebar when choice is made (mobile UX improvement) * fix closeDropDownMenu * Translation config in Header now * Translation config in Header now * French promt example * continue translation * continue translation * change refreshing when language is selected will use first config in json file if present and if in the correct language * Add languages and translations * fix loading when no prompt from language is found * fix click on manual settings if already checked in dropdown * rename Sidebar to ConversationList, better understanding, refactor code to have all that concerns this component in the same place * rename Sidebar to ConversationList, better understanding, refactor code to have all that concerns this component in the same place * rename Sidebar to ConversationList, better understanding, refactor code to have all that concerns this component in the same place * UI improvements UX is easier to understand * json reformat * UI buttons margins * configs and language selection in appcontext, improve UI * continue translation * add favicon (no more console log errors) * start changing Setting Dialog * fix color in light/auto theme * fix color in light/auto theme * UX/UI improvements, no more drawer * code refactor * code refactor, continue translation, UX/UI improvements * fix key * format * format * loading / save presets * translations * build * embed translations * remove log * code refactor, main functions in app.context * build * fix not needed, revert * New README.md for Web UI app. * prompts renamed to presets * favicon * remove unused parameter in json preset files * add favicon (no more console logs) * new build * readme and screenshoots --------- Co-authored-by: Votre Nom <Vous@exemple.com> Co-authored-by: tjohnman <tjohnman@users.noreply.github.com> Co-authored-by: Johnman <tjohnman@github> Co-authored-by: Georgi Gerganov <ggerganov@gmail.com> Co-authored-by: Finn Voorhees <finnvoorhees@gmail.com> Co-authored-by: jason_w <jason.wang@126.com> Co-authored-by: poulphunter <>
I haven't found a consistent pattern to reproduce this, but sometimes the model will continue outputting text even after it has printed the reverse prompt. If colors are enabled, they will change as if the new text was user input, but it is generated by the model. After this happen it might or might not revert to its proper behavior once it finds the reverse prompt again.
I have noticed the color change doesn't always happen right on the prompt, but sometimes it happens a few words before it. I don't know enough about how this code works yet to speculate, but in case this has something to do with parallelism, I'm using
-t 16
.The text was updated successfully, but these errors were encountered: