Questions about fine-tuning GPT-3.5-turbo

OpenAI has taken away some of the other machine learning hyperparameters that were previously used, and we know that they adjust these based on the training data size. That you specify a different number of epochs and don’t see the change is unexpected.

Here is exact code where I ask for and receive one epoch


import os
import openai
openai.api_key = key
try:
    created = openai.FineTuningJob.create(
        training_file="file-90N19999999999999STwdz",
        model="gpt-3.5-turbo",
        hyperparameters={"n_epochs": 1})
except openai.error.APIError as err:
    # Handle API error, e.g. retry or log
    print(f"OpenAI API returned an API Error: {err}")
    pass
# more error handing omitted
except Exception as err:
    error_message = f"Error: {str(err)}"
    print(error_message)
    pass

Fine-tune can now be continued, meaning you can train for one epoch, and then specify your fine-tune model as the base to generate a second model equivalent to two epochs.

Also, you don’t need to hold out half of your questions for validation; you’ll get better inference with more varied coverage from including more of those you have prepared. I would shuffle around the questions and just validate on 10-20%.

The actual score is just how well token sequences in the unseen data are predicted. You should also try out the model to see the actual quality of the responses to validation, and also to those outside of the trained domain using your application identity.

1 Like