Description

The FINETUNE statement lets you retrain a model with additional training data.

Imagine you have a model that was trained with a certain dataset. Now there is more training data available and you wish to retrain this model with a new dataset. The FINETUNE statement lets you partially retrain the model, so it takes less time and resources than the RETRAIN statement. In the machine learning literature, this is also referred to as fine-tuning a model.

Syntax

Here is the syntax:

FINETUNE [MODEL] project_name.model_name
FROM integration_name
    (SELECT column_name, ... FROM table_name)
[USING
    key = value,
    ...];

Where:

ExpressionsDescription
project_nameName of the project where the model resides.
model_nameName of the model to be retrained.
integration_nameName of the integration created using the CREATE DATABASE statement or file upload.
(SELECT column_name, ... FROM table_name)Selecting additional data to be used for retraining.
USING key = valueOptional. The USING clause lets you pass multiple parameters to the FINETUNE statement.

Model Versions

Every time the model is retrained/adjusted, its new version is created with an incremented version number. Unless overridden, the most recent version becomes active when training completes.

You can query for all model versions like this:

SELECT *
FROM project_name.models_versions;

For more information on managing model versions, check out our docs here.

Examples

Example 1: OpenAI Model Fine-Tuning

Example 2: Llama2 Model Fine-Tuning

Example 3: Regression Model Fine-Tuning

Example 4: Classification Model Fine-Tuning