I m using chatGPT to extract content from text and create questions from the text.
Recently I was struggling to get good results in terms of the output.
- I need to have an array of objects, each with a question and answer → Most of the time I was getting a single object back instead of an array.
- My prompts are quite complex and heavily customized → inconsistent responses - for example if I ask for the results in a different language than the original language the api only complies about 50% of the time.
- Inconsistent formatting. → I would get responses like {“responses”:[… or {“questions”:[ or ```JSON …
I tried many things to ensure better and more consistent responses. I was using 3.5 turbo originally.
I tried GPT4 preview → results were more or less than same as 3.5
GPT4 → better responses but its too expensive for my use case
Fine tuned GPT3.5 → surprisingly this gave me WORSE results. I fine tuned it with responses that were arrays of objects, always containing multiple objects, and yet the responses I got were always a single object.
I also played around with asking for the response to be in json_format, this somewhat works but again often ended up in the situation where I only had one item instead of a whole array.
I also couldn’t figure out why when using the playground I was getting great results compared to the API. Well it turns out that in the API I was feeding my prompt in as a message with the role “user”. In the playground the role is “assistant”. After changing it in my code to “assistant” the responses seem much better. (that said I went back to the playground and tried sending the content with “user” and the results good)
I need to keep testing but it has anybody had this experience? I dont understand why it would be the case. From the documentation I can’t see what impact the role would have here.