Price for Fine Tuning with gpt-3.5 turbo and gpt-4

How to estimate the price of fine tuning with gpt 3.5-turbo 1106?
What’s the price for fine tuning with gpt-4?

Welcome to the forum.

I believe you meant fine-tuning something (gpt-3.5/4), not with something.

If this is the case, you can see the price on the OpenAI pricing page for 3.5. GPT-4 you cannot fine tune yet.

Model Training Input usage Output usage
gpt-3.5-turbo $0.0080 / 1K tokens $0.0030 / 1K tokens $0.0060 / 1K tokens

fine-tune accepts a training file, with many example conversations showing the kind of new response the AI should produce for that style of input.

Each message within an example conversation and final completion, such as [system, user, assistant] has language the AI model receives, encoded by a BPE tokenizer. An exact calculation of the contents of the JSON lines can be made by tiktoken, which is a library that encodes language the same way as the cost is calculated.

Additionally, the size of the file in total tokens is multiplied by the n_epochs parameter, which is the number of reinforcement learning passes performed on the training file. Expect about 8 epochs on a small file if you leave the epochs parameter unspecified to be auto-configured by OpenAI.

That is the “training” cost above.

Using the model also costs considerably more than the base, but for particular applications, hopefully you can improve the quality beyond that even offered by more expensive models and more prompting.

1 Like