I am just starting out with OpenAI, and I am trying out a basic shopping list completion model to get my feet wet. I created the specialized model with a tight JSONL file that had format like this:
{"prompt":"Where can I find air fresheners?","completion":"Air fresheners are in aisle 22A."}
{"prompt":"Where can I find aluminum foil?","completion":"Aluminum foil is in aisle 19A."}
{"prompt":"Where can I find antacids?","completion":"Antacids are in aisle 5A."}
{"prompt":"Where can I find applesauce?","completion":"Applesauce is in aisle 12A."}
and based on how I interpreted the documentation, I gave that to OpenAI to make a model with this command:
openai api fine_tunes.create -t preset_prepared.jsonl -m text-davinci-003
When I test out the model through the API or through the playground, I often get poor responses, garbled responses when attempting to find out about items not directly listed. For example, I have this line:
{"prompt":"Where can I find crackers?","completion":"Crackers are in aisle 15B."}
And when I enter “Where are the triscuits?” in my API test or in the playground, I get this (the prompt repeated several times):
I don’t doubt this is a “newbie” error. Can you give me info about how to do this model and how to test it/refine it? The ChatGPT-3.5 and ChatGPT-4 bots aren’t giving me straightforward info about how to fix this.
{“prompt”:“Do business banking customers have exclusive offers for personal loans? ->”,“completion”:" Yes, exclusive offers for personal loans may be available for business banking customers. It is advisable to contact the bank offering business banking services for more information.\n"}
in this stop sequence is \n
but when i apply stop sequence in playground
it does not work
it is giving responce multiple line statment
Usually stop sequence has to be a unique substring/set of tokens which is very unlikely to appear naturally in the middle of the completion. ‘\n’ isn’t unique enough and simply means newline.
FWIW you can try using “.\n” as a possible stop sequence if all you completions end with a “.” followed by “\n”
The “.” was the only thing at the end of each of the training model’s responses, and I get the same behavior when I use “.” as a stop sequence in the playground. I do not have any newlines in the file. I thought that since there was only one “.” and that was at the end, that would have been the stop sequence to use.
Yes, it won’t work. It would have been better to use something like “###” or “+++” as they have almost zero probability of appearing mid completion.
EDIT: @jimcampbell1710 You also need to use a separator to mark the end of the prompt, which like stop sequence has to be distinctive. eg “####”, “^%^”, something unlikely to appear in regular model usage.
Hi, let’s quickly tackle the issue you’re encountering:
Problem: Your fine-tuning process currently uses fixed item-aisle mappings, which can become inaccurate if product locations change.
Solution: I recommend implementing a backend with an API. This would manage a dynamic database with product titles and aisle locations. In this case, if a product like “Air fresheners” changes from “22A”, the database updates accordingly.
With some prompt engineering, GPT-3.5 can transform user queries into specific API calls. For example, “Where can I find air fresheners?” would be converted to: your_api.com/api?product_name=air-fresheners.
This approach ensures users always receive accurate, up-to-date information, regardless of their query. Improving these systems often involves experimentation, so keep at it. I hope you find this advice helpful!
Hello. I have experienced the same issue. In my case, the reason was that for some reason the training file (JSONL) had swiped completions and prompts. It happened to me only once while I followed the usual procedure for fine-tuning (I did it many times).
Great suggestion on the API! My shopping list project was a “toy” project to get my feet wet but I am looking forward to expanding this experience in “real” projects.
while fetching the answer from finetuned model it break in middle sometimes not everytime what to do for this
and also i want to restrict for only loan queries that menas i user ask any other doamin question bot should reply somethiing like “i do not now please ask me on loan”
in dataset i have also included other domain question and thrier corresponding answer is “i do not now please ask me on loan”
but sometimes it give answer for the other domain also and sometimes it does not recognize the loan quesry and reply with “i do not now please ask me on loan”