Fine-tuning

Overview

LLMs in general are typically trained for generic use cases. Fine-tuning LLMs allows users to further train the model to provide more accurate answers for a specific domain or use case. This process involves providing the model with a dataset containing examples of input and output from a specific domain. LLM Labs helps simplify this process by providing a user-friendly way to fine-tune and deploy open-source models, allowing you to tailor LLMs to your exact needs.

Create fine-tuned models

This section guides you through the process of fine-tuning your models in LLM Labs.

Step 1: Set up model

  1. Navigate to the Models page.

  2. Open My models tab, and then open the Fine-tuned LLMs section. Click on the Create fine-tuned model button.

    My models page
  3. Once the creation wizard is opened, you need to set up your project.

    Set up model
  4. Name your fine-tuned model.

    1. Select a base model that you want to fine-tune. You can select either:

      1. Pre-trained LLMs. Currently, we support:

        1. Amazon Nova Micro

        2. Amazon Nova Lite

        3. Amazon Nova Pro

        4. Amazon Titan Text G1 - Express

        5. Amazon Titan Text G1 - Lite

        6. Cohere Command

        7. Cohere Command Light

        8. Meta Llama 3.1 8B

        9. Meta Llama 3.1 70B

      2. Existing fine-tuned models

  5. Choose a dataset. You can upload either a .csv consisting of 2 columns: prompts, expected completions, or you can choose an existing dataset from the library. For the validation dataset, you have 3 options:

    1. Split from selected dataset: Datasaur will split the uploaded dataset and use it for validation data. You will need to configure the validation size using a percentage.

      Split from selected dataset
    2. Use new dataset: You will need to add a new dataset to use as validation.

      Use new dataset
    3. None: Choose this option if you don't want to add a validation dataset.

      1. Please note that if you select Cohere Command or Cohere Command Light as the base model, you are required to have validation data.

Learn more on how to create the Dataset here.

Step 2: Adjust hyperparameters

Next, you will need to configure and adjust the hyperparameters for your fine-tuning project.

Adjust hyperparameters

The fundamental hyperparameters are:

Models
Hyperparameters

Amazon Titan Text G1 - Express

Epochs, and Learning rate.

Amazon Titan Text G1 - Lite

Epochs, and Learning rate.

Cohere Command

Epochs, and Learning rate.

Cohere Command Light

Epochs, and Learning rate.

Meta Llama 2 13B

Epochs, and Learning rate.

Meta Llama 2 70B

Epochs, and Learning rate.

In addition to the fundamental hyperparameters, there are advanced hyperparameters with preset default values. These hyperparameters are always applied, but you can adjust them for further hyperparameter fine-tuning if desired. The advanced hyperparameters include:

Models
Hyperparameters

Amazon Titan Text G1 - Express

Batch size, and Learning rate warmup steps

Amazon Titan Text G1 - Lite

Batch size, and Learning rate warmup steps

Cohere Command

Batch size, Early stopping threshold, and Early stopping patience.

Cohere Command Light

Batch size, Early stopping threshold, and Early stopping patience.

Meta Llama 2 13B

Batch size.

Meta Llama 2 70B

Batch size.

Step 3: Review job

  1. The last step of the creation wizard is to review your fine-tuning job before you start the process. In this step, you will need to review all the configurations that you have chosen. The important part of this page is to review the cost that it will take to start the fine-tuning process.

    Review job

    You can also view the predicted cost by clicking the View total predicted cost button on the Costs section.

    Costs section

    It will calculate and show you the total predicted cost for starting the fine-tuning process.

    Total predicted costs

Please note that this is just a cost prediction. The final cost may be higher or lower, as each model has its own tokenizer.

  1. Once you have reviewed the configuration, you will need to check the acknowledgement checkbox.

  2. Lastly, click the Start fine-tuning job button to start the fine-tuning process.

  3. The training process has now started.

    Training process started

It will take several hours for the training process to be completed. Datasaur will notify you by email when the training process is complete.

  1. Once the training process is complete, your model will be available in the My models section.

    My models page

Model management

Model status

There are 7 possible statuses for the fine-tuned model.

  1. Training: The model is currently being trained on your dataset. This status indicates that the training process is in progress, and the model is learning from your data.

    Training status
  2. Training failed: The model training process has failed due to an error. This status indicates that the training process was interrupted, and you may need to investigate and resolve the issue.

    Training failed
  3. Stopping training: The model training process is being stopped. This status indicates that someone has chosen to stop the training.

    Stopping training
  4. Training stopped: The model training process has been stopped. This status indicates that the training process has been successfully stopped, and you can’t continue the training once it stopped.

    Training stopped
  5. Not deployed: The model has been trained but has not yet been deployed for use. You can deploy the model to use it in Sandbox.

    Not deployed
  6. Deploying: The model is being deployed for use. This status indicates that the deployment process is in progress, and the model will soon be available for use in Sandbox.

    Deploying
  7. Deployed: The model has been successfully deployed. This status indicates that the model is now available for use in Sandbox, and you can start using it to generate predictions or responses.

    Deployed

Learn more about deploying or undeploying models.

View model details

To view the model details, click the three-dots button in the top right corner of the model card.

Model card

Choose the View details menu, and the details of the fine-tuned model will be shown.

View details menu

Here you can view the dataset, validation dataset, models used, hyperparameter configurations, the creator, and storage cost information.

View details

Delete fine-tune models

To delete the fine-tune model, click the three-dots button in the top right corner of the model card.

Delete menu

Choose the Delete option.

Delete model dialog

Acknowledge that you understand the impact of deleting the fine-tuned model by checking the acknowledgement checkbox.

After that, confirm the delete process by clicking the Delete model button, and your model will be deleted.

Delete model success

Deploy and undeploy model

To deploy a fine-tuned model:

  1. Navigate to the My models tab, and expand the Fine-tuned LLMs section.

  2. Click the Deploy model button to start the deployment.

    Deploy model
  3. Once you click the Deploy model button, you can specify the auto undeploy schedule based on your needs.

    Deploy model dialog
  4. Click the Deploy model button to start the deployment process.

    Deploying process
  5. Once deployment is complete, your model will be available to use for experiment in Sandbox. Learn more about Sandbox.

    Model deployed

To undeploy a model:

  1. Navigate to the My models tab, and expand the Fine-tuned LLMs section.

  2. Click the three-dots button in the right corner of the model card.

    Undeploy model
  3. Choose the Undeploy option.

    Undeploy model dialog
  4. Confirm the undeployment by clicking the Undeploy button, and your model will be undeployed. You will no longer be charged for the hourly cost.

Access via Sandbox

Once the fine-tuned model is deployed, it will be available in the Sandbox for further experimentation and testing. This allows you to integrate and test the specialized model within your specific applications. Learn more about Sandbox.

Access model via Sandbox

Last updated