Full fine tuning
Full fine tuning uses the base model’s previous knowledge as a starting point to tailor the model by tuning it with a smaller, task-specific dataset. The full fine-tuning method changes the parameter weights for a model whose weights were set through prior training to customize the model for a task.
How fine tuning works
Use the Tuning Studio to run a fine-tuning experiment that uses supervised learning to train a foundation model on a specific task. You provide training data that consists of examples of user input and the expected foundation model output pairs that are modeled for your task. With the data that you provide, the Tuning Studio runs a fine-tuning experiment.
The fine-tuning experiment manages a series of training runs in which the output that is generated by the foundation model is compared to the training data output. Based on the differences between the two responses, the experiment adjusts the underlying foundation model parameter weight values. After many runs through the training data, the model finds the parameter weights that generate output that more closely matches the output you want. The result of the fine-tuning experiment is a new foundation model that is tuned for your task.
Full fine-tuning workflow
During a full fine-tuning experiment, the parameter weights of the tuning model are repeatedly adjusted so that its predictions can get better over time.
The following diagram illustrates the steps that occur during a fine-tuning experiment run.
The parts of the experiment flow that you can configure are highlighted with a user icon . These decision points correspond with experiment tuning parameters
that you control. See Parameters for tuning foundation models.
The diagram shows the following steps of the full fine-tuning experiment:
-
The experiment reads the training data, tokenizes it, and converts it into batches.
The size of the batches is determined by the batch size parameter.
-
Sends input from the examples in the batch to the foundation model for the model to process and generate output.
-
Compares the model's output to the output from the training data that corresponds to the training data input that was submitted. Then, computes the loss gradient, which measures the difference between the predicted output and the actual output from the training data.
The experiment adjusts the foundation model parameter weights based on the computed loss of the model. When this adjustment occurs depends on how the Accumulation steps parameter is configured.
-
Adjustments are applied to the parameter weights of the foundation model. The degree to which the weights are changed is controlled by the Learning rate parameter.
-
Input from the next example in the training data is submitted to the foundation model as input.
-
The process repeats until all of the examples in all of the batches are processed.
-
The entire set of batches are processed again as many times as is specified in the Number of epochs parameter.
Learn more
Parent topic: Tuning Studio