hey all - I'm getting a really weird bug from Open...
# 06-technical-discussion
b
hey all - I'm getting a really weird bug from OpenAI. when I prompt it with something like "please summarize this text" I get repeating words like this: "I'm proficient in Python, SQL, and machine/deep learning, and I'm passionate, and I'm a quick, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and, and," any ideas?
d
Any chance you're using Semantic-Kernel? There was a bug in earlier versions that could cause issues like that. If you're not using Semantic-Kernel, I think the root cause was passing an invalid model identifier (eg. not gpt-3.5-turbo or etc) to OpenAI in your API calls
b
this is coming straight out of the OpenAI api so no Semantic Kernel
d
Right but could (possibly) have the same root cause of a bad model specifier being sent to OpenAI by the caller
b
got it. so basically just a typo or something when setting the model?
d
My guess in the situation I encountered was OpenAI was somehow defaulting to a crappy ancient internal test model (there are around 100? models that can be specified by the API).
I can't guarantee it's a bad model specifier, but I was definitely getting garbage that looked like.
b
hm looks good to me
d
yeah, that does look sensible
does gpt-4 behave better?
b
i dont think so
there are so many summary products out there. we have to be doing something wrong haha
d
I haven't played with contexts that can overflow the working memory of the GPU. Is it possible you're sending it too big a document (hopefully they return a sensible error but since I've never done that I don't know personally how they handle it)
b
we're sending emails over so honsetly not crazy
d
^ pure guess on that last one, just trying to be helpful but probly not succeeding 🙂
b
yea haha
apprecaite the help
better than banging my head against this
do you know if OpenAI has support?
d
My guess is Azure's version is more likely to have support than OpenAI (same models and APIs, just supported by a different org and billed through a different company)
b
ah
d
(I've also heard the Azure variant has significantly faster response times, but I haven't confirmed that myself)
b
we're on AWS
d
The Azure folks probably wont mind an opportunity to try to convince you of their goodness lol
b
yea haha
d
OpenAI might have support as well, they're just a newer and smaller company and good support orgs tend to take time to build
Anyway I'm well out of my domain of actual knowledge here
b
yea - im gonna bug my investors to get in front of openai and see if that works lol
OpenAI discord was useless
v
This is a hallucination error, modify the prompt to let it know the tone that it needs to use or use CoT prompting. For eg: Summarize the text such that it can be used in my LinkedIn profile, and give reasons for why.
Try this, and let me know if it works out! 🙂
b
whats CoT?
v
Chain of thought prompting
b
ah
weve tried a lot of stuff like "please do not repeat words over and over again" lol
v
Can you try what I suggested and let me know?
b
yea will have to wait for tomorrow
lead eng is out. im the designer lol
& founder
l
check your frequency penalty. also are you using chat or completions api? feel like chat has been RLHF'ed more so it's less likely to do this whereas completions is probably closer to the original models but tends to fall into pits like this
i don't think it's a hallucination problem because this isn't an issue of truthfulness, and i'm pretty sure the api would return an error message if you did manage to exceed the context window (like, just ML-wise, transformers on their own just dont take any wrong sized input)
ok yeah found your post in the discord. i think it's 100% a frequency and presence penalty bug. these penalties REDUCE the likelihood of words being repeated (frequency penalizes more common words more heavily, whereas presence is a flat penalty for any word that appears at least once). your penalty is negative, which means you're encouraging it to repeat itself. so, to fix: just change both to some number that's not negative. 0 is the default for both in openai playground and that works fine for me generally
🔥 1
(edit: lol playground doens't even let you use negative penalties)
(also, as a side note, if you want text summaries, wouldn't you want temperature as low as possible ie. 0 to get maximum factuality and minimize creativity?)
b
omg thank you!!
that sounds about right
we've been busy building out other pieces of infra so we have kinda left the parameters of the openai calls unchecked but this is super helpful
will fix penalty and temp and let you know how it goes
🫡 1
gg yalll did it @Leon Wu!
issue resolved
🔥 1
🧠 1
l
yesss let's goo!!!