I am using the “text-davinci-003” model and I copied the code form the OpenAI playground, but the bot keeps giving me random response to a simple “Hello” everytime.
This is the code I am using :
response: dict = openai.Completion.create(model="text-davinci-003",
stop=[" Human:", " AI:"])
choices: dict = response.get('choices')
text = choices.get('text')
The response to simple “hello” chat 3 different times :
the first time it gave me a hello world program for Java
second time it answered correctly - ‘Hi there! How can I help you today?’
the third time -
# To invoke this method we would call:
I just dont get it, as using the same simple ‘hello’ prompt in the playground gives me accurate response eveytime - Hi there! How can I help you today?
March 13, 2023, 7:54am
The temperature parameter can be thought of as a measure of how random/creative your output will be.At higher temperatures, the program is more likely to generate random text, hence the different solutions you might be getting. Try at a lower temperature, that should make your output more deterministic
March 13, 2023, 12:11pm
both temperature and top_p are set very high. both parameters have massive influence to the output, especially when used both at the same time.
you can see both parameters like sliders determination <> haluzination
March 13, 2023, 1:57pm
However, i think the documentation recommends to change only one at time and not both.
March 14, 2023, 12:19pm
that’s true, the documentation doesn’t recommend it, but it’s a valid option tho.
Actually, the documentation recommends against using
top_p at the same time, so I disable
top_p and only use temp.
March 15, 2023, 9:13am
Thats nice to know, i still use both w/o problems
From the OpenAI API docs:
We generally recommend altering this or
temperature but not both.
OpenAI API: Completion Create
March 16, 2023, 12:45pm
Ja, i know it’s there and i tell you hereby it works with BOTH parameters used, although it’s not recommended
So why do you do what is not recommended?
Just to be antagonistic ? A “parameter rebel”
March 16, 2023, 12:50pm
Because there in fact is a hotspot, where the responses are deterministic yet not being repetetive.
When i use only one of those parameters, it’s still way to repetitive than a human would be.
If they wouldn’t want you to use both parameters, it would be easy for them just to disable this in the api.