Fine-Tuning the Base Models in Generative AI

 Important



Pre-General Availability: 2023-09-18

The following legal notice applies to Oracle pre-GA (Beta) releases. For copyright and other applicable notices, see Oracle Legal Notices.

Pre-General Availability Draft Documentation Notice

This documentation is in pre-General Availability status and is intended for demonstration and preliminary use only. It may not be specific to the hardware on which you are using the software. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to this documentation and will not be responsible for any loss, costs, or damages incurred due to the use of this documentation.

This documentation is not a commitment by Oracle to deliver any material, code, functionality or services. This documentation, and Oracle Pre-GA programs and services are subject to change at any time without notice and, accordingly, should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality for Oracle’s Pre-GA programs and services remains at the sole discretion of Oracle. All release dates or other predictions of future events are subject to change. The future availability of any future Oracle program or service should not be relied on in entering into any license or service agreement with Oracle.

Create custom models by fine-tuning the base models with your own dataset. You can create new custom models or create new versions of existing custom models.

The following workflow displays the tasks for fine-tuning a pretrained model and hosting the fine-tuned model.

The following tasks include the steps for fine-tuning a pretrained model and hosting the fine-tuned model.

Add training data for fine-tuning a base model to a bucket in Object Storage.
Create a dedicated AI cluster for fine-tuning a pretrained model.
Create a new custom model or create a new version from an existing model on the dedicated AI cluster that you created for fine-tuning.
Create a dedicated AI cluster for hosting models.
Create an endpoint on the dedicated AI cluster that you created for hosting.
Run the custom model in the playground.
Managing the Custom Models
After you create a new custom model or create a new version from an existing model, you can perform the following tasks on custom models:
List the custom models
Get a custom model's details
Update a custom model
Delete a custom model
Fine-Tuning Parameters

Generative AI fine-tunes your selected pretrained model with your provided training dataset. You don't need to set up the fine-tuning parameters used for training your model. These parameters are listed in the following table, and you can find them in the custom model's detail page.

Parameter	Valid Range	Description
Total training epochs	

1 - infinity

[integer]

	The number of times the training iterates through the entire training dataset. For example, 1 epoch means that the model is trained using the entire training dataset one time.
Learning rate	

0 - 1.0

[float]

	The speed at which the model weights are updated against the error gradient.
Batch size	

1 - GPU memory allows

[integer]

	The number of samples in a mini batch computed at once for error gradient and model updates. A larger batch size results in smoother convergence.
Early stopping patience	

0: disable

1 - infinity

[integer]

	The number of grace periods in evaluation cycles before the early stopping takes action (terminating the training). The count is reset by evaluation loss better than earlyStoppingThreshold during the grace period.
Early stopping threshold	

0 - infinity

[float]

	Controls the minimum improvement of evaluation loss between two evaluation cycles to prevent the early stopping to kick in. For example, –1 * (eval_loss2 - eval_loss1) > earlyStoppingThreshold prevents the early stopping and vice versa.
Log model metrics interval in steps	

0: disable

1 - totalTrainingSteps

[integer]

	Controls how frequent in number of training steps to log training loss.
Training config	TFEW_TRAINING_CONFIG	The training method used for fine-tuning the custom model.
The following equation shows how the model calculates the totalTrainingSteps parameter.
totalTrainingSteps = (totalTrainingEpochs * size(trainingDataset)) / trainingBatchSize
In the preceding equation, the model ignores some rounding calculations.