GPT-3.5 Turbo fine-tuning now available (and new GPT3 models)

New blog post with announcement:

Fine-tuning for GPT-3.5 Turbo is now available, with fine-tuning for GPT-4 coming this fall. … Early tests have shown a fine-tuned version of GPT-3.5 Turbo can match, or even outperform, base GPT-4-level capabilities on certain narrow tasks.

Fine-tuning with GPT-3.5-Turbo can also handle 4k tokens—double our previous fine-tuned models. Early testers have reduced prompt size by up to 90% by fine-tuning instructions into the model itself, speeding up each API call and cutting costs.

Today, we are making babbage-002 and davinci-002 available, either as base or fine-tuned models. Customers can access those models by querying the Completions API.

These models can be fine-tuned with our new API endpoint /v1/fine_tuning/jobs . This new endpoint offers pagination and more extensibility to support the future evolution of the fine-tuning API. Transitioning from /v1/fine-tunes to the updated endpoint is straightforward and more details can be found in our new fine-tuning guide.

11 Likes

This is going to be huge!

Lots of potential for some very cool applications.

This is incredibly exciting!

5 Likes

Does anyone know if you can fine tune for function calls?

There is no documentation around it, but was hoping you might be able to do something like this:

  "messages": [
    { "role": "system", "content": "You are a general purpose agent" },
    { "role": "user", "content": "What's the weather in Jackson, wy" },
    { "function_call": "get_weather", args: {"location": "jackson, wy"} }
  ]

Then again, I’m not even 100% sure this version of GPT3.5 supports function calls at all…

I’m really confused about davinci-002. Do they mean the older models? We used to be able to fine-tune davinci-003

“Support for fine-tuning with function calling and gpt-3.5-turbo-16k will be coming later this fall.”


You could finetune davinci, but not text-davinci-003
“Fine-tuning is currently only available for the following base models: davinci , curie , babbage , and ada . These are the original models that do not have any instruction following training (like text-davinci-003 does for example).”

3 Likes

Notable:

Can I continue fine-tuning a model that has already been fine-tuned?
(OpenAI Platform) No, we do not currently support continuing the fine-tuning process once a job has finished. We plan to support this in the near future.

Pricing: fine-tune davinci-002 output is 1/10th the cost of GPT-3 davinci fine-tune - and the same price as curie (without direct replacement).


It will be interesting to explore deeper what comes along with the pretrained/reweighted replacement completion models, now available in the playground. Definitely a difference in the output and wildly different runs at temperature and top-p as low as 0.5 with the curiously-behaving babbage-002, with only one result that is close to accurate:

old babbage: A few-shot training is a technique where the model is trained on a small set of data. The idea is that the model will learn the “rules” of the data, and it will be able to answer questions about the data with a high degree of accuracy.
babbage-002: (freq-penalty 1) It’s a method of training AI systems that is not based on the use of large amounts of data. Instead, it relies on the use of small amounts of data to train a model. The term “few-shot” refers to the fact that only a small number (typically 10-20) questions are used for training.
babbage-002: (penalties 0.05) It’s a process where a large number of questions are asked to the AI, and the answers are generated based on the questions that were asked. This process is useful for learning new concepts, and is a good way to get started with machine learning.
babbage-002: (again) It’s a technique for training an AI to perform well on a small number of test data, and then use that data to improve the performance of the AI on a larger set of test data.

Quite high perplexity gives randomness (and also got a loop output):
image


and are the new models already fine-tuned for you?

davinci (base, old) obeys:

image

davinci-002 denies:

image

1 Like

When I try to fine tune with gpt-3.5-turbo it is kicking me back an error:
{ “error”: { “message”: “Invalid base model: gpt-3.5-turbo-0613 (model must be one of ada, babbage, curie, davinci) or a fine-tuned model created by your organization: XXXXXX”, “type”: “invalid_request_error”, “param”: null, “code”: null } }

Has anyone else experienced this or does anyone know a way to fix it?

Are you using the new FineTuningJob endpoint?

2 Likes

I’m actually using orhanerday (for php).
Specifically with this:

$result = $open_ai->createFineTune([
“training_file” => “file-XXX”,
‘model’=>“gpt-3.5-turbo-0613”,
]);

1 Like

I haven’t had a chance to test, but wouldn’t be surprised if you need to use the new API endpoint to fine-tune 3.5. So you’ll either need to write your own curl code or wait for the library to update.

2 Likes

Actually your answer put me on the correct path. For anyone needing help:
in the Url.php file, replace:
public static function fineTuneUrl(): string
{
return self::OPEN_AI_URL . “/fine-tunes”;
}

With:
public static function fineTuneUrl(): string
{
return self::OPEN_AI_URL . “/fine_tuning/jobs”;
}

2 Likes

I’m looking to fine-tune the gpt-3.5-turbo to mimic a specific character’s tone. What’s the best way to go about assembling the training set?

At times, the character responds to another speaker’s queries, initiates the conversation topics, or simply engages in monologues. Given this, the roles of the user and assistant aren’t always perfectly aligned. Would it be acceptable if the assistant’s inputs outnumber those of the user?

By the way, how to rename a fine-tuned model?

gpt-3.5-turbo also can take a “name” parameter. This hasn’t been shown yet in fine-tune examples, but this is how it could go:

{
  "messages": [
    { "role": "system", "content": "You are Harry Potter. You chat with both Hermione Granger and Ron Weasley." },
    { "role": "user", "name": "Hermione", "content": "What do you think of Ron Weasley, Harry?" },
    { "role": "assistant", "name": "Harry", "content": "Well, Hermione, Ron is my best mate and a really loyal friend. Sure, he might have his moments of goofiness, but he's got a heart of gold. We've been through so much together, and I know I can always count on him. Plus, he's got a knack for lightening the mood, even in the darkest times. So yeah, I think Ron's a great guy and I'm lucky to have him by my side." }
  ]
}

The AI doesn’t actually have a way to add a “name” to its own responses, this would only be seen in role inputs including past conversation.


Omitting either the “user” or “assistant” part of past conversation is often done, so that the chat history shows recent topics or responses without excessive contextual information. I would reconsider carefully using such a technique in fine-tuning though, if it would not actually appear the exact same in AI chatbot use.

Not verified on new endpoint:

Can a fine-tuned model be used by other people with their own API keys? Like if I write open-source software based around one and try to share it, will nobody else be able to use it?

Only if you add them to your Organization, which doesn’t sound like a great idea for this model. There’s no way to make a fine-tuned model public or to share it. Best you can do is share the training file and instructions on how to have users create their own fine-tuned model on their account.

1 Like

I’d love to add these features (Website Crawlers to read the website full information + file uploaded with data parser) then integrated with OpenAI with 3.5 fine-tune, is this idea achieveable?

I read the documentation last week and they said it was “coming”