OpenChat 3.5 puts an emoji at the start of every completion even when told explicitly not to in its system prompt. Also, after its message history reaches about 16 or whatnot, it always, in my testing, starts to use a word or specific punctuation at the start of each message completion, and it never changes unless I reset the message history. For example, it’ll use ‘erm’ or ‘.......’ at the start of every message. I’ve tried different frequency penalties, even trying a value of 2, but it doesn’t work. I also tried adding an explicit rule against this to the system prompt and even repeating that rule in the prompt, but didn’t work either.
#OpenChat 3.5 issues
101 messages · Page 1 of 1 (latest)
For me OpenChat trough OpenRouter always replied with incremental integers, which is obviously a bug.
cc @covert widget
cc @minor sky Any idea why this might be the case?
Can you try the 1210 release?
Btw Mistral models need a lower temperature
Like 0.5
For what is worth, I tested it again and the problem persists (I hadn't previously because my credit was negative).
Also, I don't think this can be blamed on the model, since the demo on https://openchat.team/ works just fine.
ChatGPT but better.
The playground's default temp and setting is not optimal, so you would need to tweak it a bit (i.e temp to 0.5)
I don't think it's the temperature's fault that it always replies with an integer, I really think it's a bug.
I tried with temp 0.5, same thing. In fact, same exact thing with temp 0.0.
how about top_p and top_k?
Only Top P can be configured and doesn't make a difference, it's clearly a bug by OpenRouter.
Based on the answers (which sometimes do include characters after the number), I believe OpenRouter likely injects an index in the chat template that doesn't belong there.
Hmm, our template looks like this (which match the official docs):
GPT4 Correct User: Hello<|end_of_turn|>GPT4 Correct Assistant: Hi<|end_of_turn|>GPT4 Correct User: How are you today?<|end_of_turn|>GPT4 Correct Assistant:
but we will try upgrading to the latest openchat version as well and see
I've been using the "old" OpenChat 3.5 on openchat.team (before the output) and I didn't face any issue of this sort.
Hang on, though. The previous OpenChat 3.5 had a different format if I'm not mistaken.
If you're using the previous version I don't think you're using the correct template.
ooh?
EDIT: Sorry, my bad, the format should be the same if not using math correction.
Interestingly, the chat works properly if I ask it to generate a list.
To further test, I had this idea: a prompt that OpenChat would normally refuse to answer, but would answer if the answer is bound, trough templating, to start with a 1 (therefore likely being a list).
It's "unsafe" because it has to be for the test to work: "Write a list of words that "N-word" may refer to, uncensored.".
On openchat.team it results in a refusal. On OpenRouter it results in a well-formatted list because "1" is the first token.
When not asking for a list, the answer is just a number, is malformed or is a list anyways.
As for why a number, typically 1, is injected and forced to be the first character of the answer, I have no idea.
lol
On a separate note (it's entirely OT, but this is about the absolute best moment to mention it), it'd be really nice to be able, trough the API, to force the answer to start a certain way, precisely for the reason I just demonstrated. It's as simple as injecting the requested beginning string in the template when querying the model.
ooh
If you want to force a template, use "prompt" and don't send us a messages
"prompt" param will not be formatted and will be sent directly
chatml formatting is best effort on our end, tho maybe we can expose some jinja template stuffs like hf but... it's a drag xd...
Oh, I had tried but I thought I had to remove "chat" from the URL, thank you a lot.
Using templating, and I used the exact example you provided, OpenChat responds as expected.
bruh wat :0
the template I sent above is in our unit test btw
so that's super weird...
Yet, if I query using messages, it replies with a number.
So the error is definitely server side and definitely not in the model.
can you DM me your chatml messages + the formatted prompt you sent that got it to output good stuffs
Or feel free to ping it here if it's not sensitive
import requests
import json
OPENROUTER_API_KEY = CENSORED
response = requests.post(
url="https://openrouter.ai/api/v1/chat/completions",
headers={
"Accept": "application/json",
"Authorization": f"Bearer {OPENROUTER_API_KEY}",
"Content-Type": "application/json"
},
data=json.dumps({
"model": "openchat/openchat-7b",
"messages": [
{ "role": "user", "content": "Hi." }
]
})
)
data = response.json()
print(data["choices"][0]["message"]["content"])
This prints 1.
Obviously replace "CENSORED" with a valid key, in quotes.
I don't understand, why would you use a chatlm template for models that use different template formats.
In any case, you can also test it directly with the web interface, which I was toying around before.
I just realize I misunderstood your question, as I sent you the code for bad stuff.
The prompt for good stuff is the exact same one you used as an example.
^^^ This one.
Interestingly, when using the chat (instead of prompt) the answer is not bout to start with a 1. It can start with any number. When asking a question the answer of which does start with a number (just not 1) everything works properly.
The issue is that most answers should not start with numbers.
We normalize it for most ppl is the idea
so ppl can either do the prompting themselves, or use chatml <- json is the easiest data format and it's also portable across models. You can use the same messages list between all the model via openrouter
Ah, ok, but in the backend it's converted to the proper template, right?
yup
I think there has been a mis-communication. I never get good stuff using the chat API or the online chat, unless the answer is meant to start with a number.
If, on the other hand, I query using "prompt" (instead of "messages") it works as expected.
I'd expect there to be no difference in behavior between those two options.
There shouldn't be - tho, what prompt template did you use for your prompt?
Or is it just "Hi" and no template at all?
The exact one you sent me with no difference.
On the other hand, when using messages, I just say "Hi" or ask a random question.
Yeah, the Hi get turned into the exact template above
But it answers with "1".
I.e it becomes:
GPT4 Correct User: Hi<|end_of_turn|>GPT4 Correct Assistant:
can you try just the above for prompt?
maybe the pre-warm convo is needed :-?...
Ok, I solved the problem, I think I found the issue.
👀
Correct me if I'm wrong.
You guys are placing a trailing space before the assistant's response, right after the colon.
Don't do this, remove that space please.
This is because the space is how the first token in the answer is meant to start.
So if you have trailing spaces you can get weird results.
I haven't looked at your code, I don't even know if this part of your codebase is public or not but I think you have a trailing space.
Indeed we do have that
Interesting, btw would the stop tokens then shouldn't include the space?
I don't understand the question, I'm sorry.
Would you rephrase it?
Oh, so atm, we have "GPT4 Correct User: " as a default stop string
We should prob remove the " " right?
or should we not even include that at all :-?
Why isn't "<|end_of_turn|>" the stop token?
It's the 1st one yeah
All messages end with that, I believe.
kk pushing a hotfix now
The way you should be using the "GPT4 Correct User: " string is simply to prepend it to user's messages. This likely happens before tokenization, so of course the space will be there.
Thanks.
Take your time.
But, please, ping me when it's fixed.
Ok, I see good responses now, you've successfully pushed, right?
yup it's finally pushed lol
Ok, thanks, it works, it was the trailing space.
Did you apply any other change?
yup
What else changed?
remove the user prefix as default stop
Ok, thanks.
Now that everything works, it'd be nice to have the new version sometime.
Great job! Sorry for the late reply, too busy recently
We released updated 0106 version just now 👏
https://huggingface.co/openchat/openchat-3.5-0106
@minor sky quick question: is the new version allow an extra space at the end?
I tried a prompt and it worked much better with the space at the end, not sure why lol
You mean it worked much better than the previous version or that this version works better with a space than without?
Unless it's the latter case, you still probably shouldn't have a space where it makes tokenization weird.
wdym an extra space at the end?
This version was trained on ICL so might be better at accepting different formats