Fine-Tuning

Fine-tuning is the process of taking a pretrained model and further training it on a domain-specific dataset to improve its knowledge and provide better responses in that domain.

When you fine tune a model in AI quick actions, you're creating a Data Science job to do that. You need to have the necessary policy to use Data Science Jobs to create a fine-tuning job to fine tune a foundation model in AI quick actions. When you create a fine-tuning job, you can select a dataset to train the base model. Foundation models with the tag Ready to Fine Tune in the Model explorer can be fine-tuned. You can select a dataset from Object Storage or upload a dataset from the storage of the notebook that you're working in. When you upload datasets from a notebook, they're saved to the Object Storage bucket where the fine-tuned model is saved. Hence, you need the policy to let the notebook session write files to Object Storage. The dataset must be in JSONL format and must include the necessary 'prompt' and 'completion' columns. Optionally, you can include a 'category' column. If a dataset file with the same name already exists in the bucket, it's replaced by the new file. The dataset must contain a minimum of 100 records for fine-tuning.

You have the option to set what percentage of the dataset is for model validation. Model version set is a way to group a set of models related to each other together. You can select an existing model version set to put the fine-tuned model in or create a new one. You can save the fine-tuned model in an Object Storage bucket which must have versioning enabled.

After you have entered the Model Information, Dataset, Model Version set, and where to save the fine-tuned model, you can pick the compute infrastructure and networking for the fine tuning job. Optionally, you can set up logging to monitor the fine-tuning job. We recommended logging for troubleshooting any errors in the job. You need the necessary policy to set up logging. Single-node training and training with several GPU cards are supported. You can specify the parameters for fine-tuning the model, the epochs, and learning rate.

You can review the configurations and parameters you have set for the fine-tuning job before the job is created.

    1. Navigate to the Model Explorer.
    2. Select the model card for the foundation model you want to fine-tune.
    3. Select Fine-Tune to fine tune the model with the dataset.
      The Create fine-tuned model page is shown.
    4. Accept the default name or enter a name for the fine-tuned model.
    5. (Optional) Add a description.
    6. To specify a dataset, select Choose an existing dataset or Upload dataset from notebook storage.
    7. (Optional) If you selected Choose an existing dataset in step 6, select the compartment.
    8. (Optional) If you selected Choose an existing dataset in step 6, select the Object Storage location of the dataset.
    9. (Optional) Specify the validation split, to indicate what percentage of the dataset to use for validation.
    10. To specify a model version set, select Choose an existing version set or Create a new versions set.
    11. (Optional) If you selected Choose an existing version set, select the version set.
    12. (Optional) If you selected Create a new versions set:
      1. Enter the version set name.
      2. Optional: Give the version set a description
    13. Specify the Object Storage bucket to store the results in:
      1. Select the compartment.
      2. Select the Object Storage location.
      3. Optional: Specify the Object Storage path.
    14. Select Next.
    15. Under Infrastructure, select the Instance shape you want to use.
    16. In Replicas, specify the number of instances of the shape.
    17. (Optional) Under Networking, select the VCN and subnet to use.
    18. (Optional) Under Logging, select the log group and log to use.
    19. Under Parameters, specify the number of epochs and the learning rate to use.
    20. Select Next.
      The review page is shown for the fine-tuning you want to create.
    21. Select Submit to start the fine-tuning.
  • For a complete list of parameters and values for AI Quick Actions CLI commands, see AI Quick Actions CLI.

  • This task can't be performed using the API.