Hello everyone,
I’ve been working on integrating the OpenAI GPT-3 API into a chatbot application, and I’ve come across an issue that’s left me stumped. I’m hoping someone here might have encountered something similar or could offer some insights.
Issue Description:
When sending various queries to the GPT-3 model, the responses I receive are unexpectedly repetitive. Here are a couple of examples:
- Prompt: “How are you?” Response: “I am fine. I am fine. I am fine…” (and it continues like this)
- Prompt: “What is the color of grass?” Response: “The color of grass is green. The color of grass is green…” (again, repetitive)
Attempts to Resolve:
- I’ve tried adjusting the model parameters, such as
temperature
andmax_tokens
, to see if they influence the outcome, but the repetitive behavior remains consistent. - As an experiment, I introduced a system message to the prompts (e.g., “You are a helpful assistant.”) with the hope of guiding the model’s behavior. Unfortunately, this didn’t yield the desired improvement.
- I also tested the model using a direct API call in a standalone Python script and observed the same repetitive outputs.
Environment:
- I’m using Flask for the server-side operations and JavaScript for the frontend.
- The API interactions are done using Python’s
openai
library.
Has anyone here encountered such behavior with GPT-3 or any other models? If so, do you have any recommendations or workarounds to achieve more coherent and varied responses?
Thanks in advance for any assistance or advice you can offer!
Best regards, Noah
PS: I have little experience in coding so I´ve mostly just been following what GPT-4 told me to do