You know, I have mixed feelings about this fine tuning process. On the one hand I’m excited there are now tools to lower costs and increase the robustness and production value of GPT-3. But on the other hand I’m a bit disappointed that it requires such a brute force effort of amassing hundreds or thousands of high quality examples to achieve these gains, when the original spirit and promise of GPT-3 was few-shot learning and prompt design.
I would have hoped for a more clever way of getting GPT-3 to fine tune itself using natural language or at least assist in the process, or using some kind of reinforcement learning on a particular prompt to help it achieve better results. Maybe this is just a stop-gap until better things come down the pike like GPT-4 or 5.
What I like most about prompt design is that it feels like you are teaching another human a task with instructions and a few examples.
However, the difficulty with prompt design is not knowing what GPT-3 is paying attention to or what sources are influencing its output. I wish I could just teach it with natural language to pay attention to the instructions or input context I’m providing, or be precise with how it formats the output based on examples, or use only these trusted sources to provide answers and filter with these constraints before you generate your output.
I really just want to teach an AI not train it.
So, now I’m thinking…I wonder if by using the currently provided fine tuning methods, could I train a base model to become more teachable in the ways I described above?
On a per line basis, the limit is the same 2048 token limit. As for total file size, we’re limiting to 80-100mb. If you require more, please reach out to finetuning@openai.com and we’ll work through a solution.
I haven’t read all the docs yet, but I am very excited to try it.
For your information, we’ve been working on something for a few months, and we found the best way to get great results was to include training data with each request. Still in development so now we can switch to incorporating fine tuning.
I had similar thoughts about it and still have, but I do see an opportunity to try your approach as an experiment, and as a matter of fact, I am working on something similar to teach GPT-3, a foreign language.
For that, I had the thought to both include “language classes” plus natural language texts.
It will be interesting to see what happens if you take your training sessions and inject them as completions. In that way, it might not need so much training as you might think.
If you try that, please share your experience with it.
Thanks for your suggestions. I’m always interested in good ideas. Could you provide an example how I might take training sessions and inject them as completions? Not sure I completely understand what you mean by “inject”.
When I read through the docs, a light bulb went off when I saw that prompts could be left blank while only providing examples for completions to more generally finesse the output. So wondering if I could generally improve GPT-3’s ability to pick up certain cues from provided instructions.
So basically, I want to train GPT-3 to follow instructions better.
@JasonW, I meant that you could use the playground to set up your desired prompt + completion to make sure it works fine, then add it to the fine-tuning file.
I can’t promise that it will work, but for me, it worked.
Generally speaking, you suppose to use fine-tuning to train GPT-3 to follow instructions better by providing many examples of prompts+completions.
My suggestion was to try to add more sophisticated prompts and completions that include the instructions within them so the model might also pick up the instructions and use more than just statistic completion.
Hi Luke. I’ve applied for access to the Davinci fine-tuning service. I’ve tried curie and it simply doesn’t work for my use case. Is there a time frame in which I could expect a response? Is there a large queue?
“You requested a model that is not compatible with this engine at the moment. (Feel free to email support@openai.com if you need assistance.)”
trying to run a finetuned curie model, I’m assuming the error message is incorrect and that the model simply just isn’t ready? How long does it usually take for the model to be ready?
After your job first completes, it may take several minutes for your model to become ready to handle requests. If completion requests to your model time out, it is likely because your model is still being loaded. If this happens, try again in a few minutes.
@luke, Does your application need to be approved for this to work? I’m getting API key errors? I’ve stared out the response below.
C:\Users\KevinM\AppData\Local\Programs\Python\Python39\Scripts>py openai api fine_tunes.create -t C:\Users\KevinM\AppData\Local\Programs\Python\Python39\upload.json -m curie
←[91mError:←[0m Incorrect API key provided: “******************************************”. You can find your API key at https://beta.openai.com. (HTTP status code: 401)
Solution
I had used Set OPENAI_API_KEY="<OPENAI_API_KEY>" before running (on Windows). This didn’t work, use the -k flag to pass in the API Key directly.
Thanks to @m-a.schenk for the 2nd time helping me out here.
openai installation successful and even tried ```
response = openai.Completion.create(engine=“davinci”, prompt=“This is a test”, max_tokens=5)
print(response)
giving response properly.
But in next step when trying to upload the training data csv file, it’s giving syntax error as mentioned earlier.
I may be able to help you out. If you’re getting errors right at the beginning of that command, then it sounds like you may not have the Python 3.9 path set in your Environmental Variables so that Command Prompt will find ‘openai’ and run it properly. ‘openai’ is located at [Python install path]\Scripts\openai, as shown below:
Make sure in your Environmental Variables you have this:
Where ‘iadmin’ is your username. This will allow your system to find that ‘openai’ file and you’ll be able to use it accordingly. However, have a look at my post discussing the best way to use the ‘openai’ tool with Windows here. Basically, using Command Prompt and PowerShell is problematic with the ‘openai’ command, but downloading Git Bash or any terminal with Bash shell support in Windows is the way to go. This is because the ‘openai’ file is designed to work with Linux’s Bash shell primarily and since it doesn’t technically have an extension, using the ‘openai’ commands within Command Prompt and PowerShell will result in those terminals asking you which program you’re trying to open ‘openai’ with instead of actually running the command as desired.
I recommend Git Bash simply because as soon as you install it you can run it and start using the ‘openai’ command.
Lastly, I see you reference the path as: \Users\username\Desktop\trial\local.csv
but you should really reference any file within quotations and ensure that you have the full path: "C:\Users\<USERNAME>\Desktop\trial\local.csv"
so the correct command you’d run in Git Bash or any terminal with Bash shell support in Windows is:
@DutytoDevelop
Hi Nicholas,
Thanks for your nice response. I tried with adding path in Environmental Variables and adding openai tools fine_tunes.prepare_data -f “C:\Users<USERNAME>\Desktop\trial\local.csv”
In CLI & PowerShell, it didn’t work. But I tried by installing git Bash and successfully created .jsonl
Then when I tried to create the model using
openai api fine_tunes.create -t “C:\Users<USERNAME>\Desktop\trial\local_prepared.jsonl”
It’s giving API Key authentication error. Can you please help me in fixing it. Thanks.
Nice, glad to hear that Git Bash worked successfully!
If you get the OpenAI API key error, then you need to ensure that:
The environmental variable ‘OPENAI_API_KEY’ is set correctly with the correct OpenAI API key listed on the API key page (‘SK-…’) and that you also restarted your system after that to access the environmental key. NOTE: Do not add quotes to the API key if you’re adding it as an environmental variable.
Let me know if that doesn’t work because I believe you can also manually set the api_key variable by running:
# Confirmed this is correct (Line 161 in OpenAI module -> util.py file)
openai.api_key = "SK-..." # Quotes around API key is needed in this scenario.
Then try to create a fine_tune and let me know if it works after that!
Edit: Also ensure that you’ve completely upgraded the openai-python module by running the ‘pip install --upgrade openai’ command