LLMs: OpenAI official heavy update - new GPT-3.5Turbo reconciliation API update function

LLMs: OpenAI official heavy update - new GPT-3.5Turbo reconciliation API update function

Guide : On August 22, 2023, OpenAI officially released that developers can now use their own data to customize the GPT-3.5 Turbo model for their use cases. Fine-tuning for GPT-3.5 Turbo is available now, and fine-tuning for GPT-4 will be available this fall. This update enables developers to customize models to provide better performance for their use cases and run those customized models at scale. Preliminary tests show that a fine-tuned version of GPT-3.5 Turbocan match the capabilities of the base GPT-4 level, or even perform better on some narrow tasks . As with all of our APIs, the data sent to the fine-tuning API is owned by the client and will not be used by OpenAI or any other organization to train other models.

Table of contents

fine-tuning example

fine-tuning steps

Step 1, prepare your data

Step 2, upload files

Step 3, create a fine-tuning job

Step 4, use the fine-tuned model

safety

pricing

The updated GPT-3 model


Blog post address : GPT-3.5 Turbo fine-tuning and API updates

Fine-tuning guide address : https://platform.openai.com/docs/guides/fine-tuning

fine- tuning example

Since the release of GPT-3.5 Turbo, developers and enterprises have been seeking the ability to customize models to create unique and differentiated experiences for their users . With this release, developers can now run supervised fine-tuning to make the model perform better for their use case.

In our private beta, fine-tuning customers have been able to significantly improve model performance in common use cases, such as: >>
Improved controllability : Fine-tuning enables businesses to better follow instructions , such as making output more concise or always ending in Reply in a given language. For example, developers can use fine-tuning to ensure that a model always responds in German when prompted in German.
>> Reliable output formatting : Fine-tuning improves the model's ability to consistently format responses - critical for applications that require a specific response format, such as code completion or composing API calls. Developers can use the tweak to more reliably convert user prompts into high-quality JSON fragments that can be used with their own systems.
>> Custom pitch : Fine-tuning is a great way to hone the qualitative feel of a model's output (like its pitch), making it more in line with the corporate brand's voice. Businesses with a recognizable brand voice can use Nudge to make the model more consistent with their tone.

In addition to improving performance, fine-tuning enables businesses to shorten prompts while ensuring similar performance . Fine-tuning with GPT-3.5 Turbo can also process 4k tokens - twice as many as our previous fine-tuned model. Early testers have shrunk the hint size by up to 90%, speeding up every API call and reducing costs by fine-tuning the instructions into the model itself.

Fine-tuning works best when combined with other techniques such as hint engineering, information retrieval, and function calls . Check out our fine-tuning guide to learn more. Support for fine-tuning with function calls and gpt-3.5-turbo-16k will be available later this fall.

fine-tuning steps

Step 1, prepare your data

{
  "messages": [
    { "role": "system", "content": "You are an assistant that occasionally misspells words" },
    { "role": "user", "content": "Tell me a story." },
    { "role": "assistant", "content": "One day a student went to schoool." }
  ]
}

Step 2, upload files

curl https://api.openai.com/v1/files \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -F "purpose=fine-tune" \
  -F "file=@path_to_your_file" 

Step 3, create a fine-tuning job

curl https://api.openai.com/v1/fine_tuning/jobs \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
  "training_file": "TRAINING_FILE_ID",
  "model": "gpt-3.5-turbo-0613"
}'

Once a model has completed the fine-tuning process, it is immediately ready to use in production with the same shared rate limits as the base model.

Step 4, use the fine-tuned model

curl https://api.openai.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
  "model": "ft:gpt-3.5-turbo:org_id",
  "messages": [
    {
      "role": "system",
      "content": "You are an assistant that occasionally misspells words"
    },
    {
      "role": "user",
      "content": "Hello! What is fine-tuning?"
    }
  ]
}'

We will also be rolling out a fine-tuning UI in the near future, allowing developers to more easily access information about in-progress fine-tuning jobs, completed model snapshots, and more.

safety

For us, fine-tuned deployments are very important. To preserve the security features of the default model through the fine-tuning process, fine-tuned training data is passed through our Moderation API and a moderation system powered by GPT-4 to detect unsafe training data that conflicts with our security standards.

pricing

The fine-tuning cost is divided into two parts: initial training cost and usage cost:
>> training : $0.008 / 1K tokens
>> using input : $0.012 / 1K tokens
>> using output : $0.016 / 1K tokens

For example, for a gpt-3.5-turbo fine-tuning job with a training file of 100,000 tokens , the expected cost is $2.40 after 3 training epochs .

The updated GPT-3 model

In July, we announced that the original GPT-3 base models (ada, babbage, curie, and davinci) would be shutting down on January 4, 2024. Today, we offer babbage-002 and davinci-002 as replacements for these models , either as base models or as fine-tuned models. Clients can access these models by querying the Completions API.

These models can be fine-tuned using our new API endpoint /v1/fine_tuning/jobs. This new endpoint provides pagination and more extensibility to support future development of the fine-tuning API. Transitioning from /v1/fine-tunes to newer endpoints is straightforward, more details can be found in our new fine-tuning guide. This will deactivate the old /v1/fine-tunes endpoint, which will be shut down on January 4, 2024.

The base model and the fine-tuned GPT-3 model are priced as follows:

Guess you like

Origin blog.csdn.net/qq_41185868/article/details/132565612