Use foundation models in Studio - Amazon SageMaker

Use foundation models in Studio

You can fine-tune, deploy, and evaluate both publicly available and proprietary JumpStart foundation models directly through the Amazon SageMaker Studio UI.

Important

As of November 30, 2023, the previous Amazon SageMaker Studio experience is now named Amazon SageMaker Studio Classic. The following section is specific to using the updated Studio experience. For information about using the Studio Classic application, see Amazon SageMaker Studio Classic.

In Amazon SageMaker Studio, open the JumpStart landing page either through the Home page or the Home menu on the left-side panel. This opens the SageMaker JumpStart landing page where you can explore model hubs and search for models.

  • From the Home page, choose JumpStart in the Prebuilt and automated solutions pane.

  • From the Home menu in the left panel, navigate to the JumpStart node.

For more information on getting started with Amazon SageMaker Studio, see Amazon SageMaker Studio.

From the SageMaker JumpStart landing page in Studio, you can explore model hubs from providers of both publicly available and proprietary models. You can find specific hubs or models using the search bar. Within each model hub, you can search directly for models, sort by Most likes, Most downloads, or Recently updated, or filter based on a list of provided model tasks. Choose a model to see its model detail card. In the upper right corner of the model detail card, choose Fine-tune, Deploy, or Evaluate to start working through the fine-tuning, deployment, or evaluation workflows, respectively. Note that not all models are available for fine-tuning or evaluation.

Fine-tune foundation models in Studio

Fine-tuning trains a pre-trained model on a new dataset without training from scratch. This process, also known as transfer learning, can produce accurate models with smaller datasets and less training time. To fine-tune JumpStart foundation models, navigate to a model detail card in the Studio UI. For more information on how to open JumpStart in Studio, see Open and use JumpStart in Studio. After navigating to the model detail card of your choice, choose Train in the upper right corner. Note that not all models have fine-tuning available.

Important

Some foundation models require explicit acceptance of an end-user license agreement (EULA) before fine-tuning. For more information, see EULA acceptance in Amazon SageMaker Studio.

Model settings

When using a pre-trained JumpStart foundation model in Amazon SageMaker Studio, the Model artifact location (Amazon S3 URI) is populated by default. To edit the default Amazon S3 URI, choose Enter model artifact location. Not all models support changing the model artifact location.

Data settings

In the Data field, provide an Amazon S3 URI point to your training dataset location. The default Amazon S3 URI points to an example training dataset. To edit the default Amazon S3 URI, choose Enter training dataset and change the URI. Be sure to review the model detail card in Amazon SageMaker Studio for information on formatting training data.

Hyperparameters

You can customize the hyperparameters of the training job that are used to fine-tune the model. The hyperparameters available for each fine-tunable model differ depending on the model.

The following hyperparameters are common among models:

  • Epochs – One epoch is one cycle through the entire dataset. Multiple intervals complete a batch, and multiple batches eventually complete an epoch. Multiple epochs are run until the accuracy of the model reaches an acceptable level, or when the error rate drops below an acceptable level.

  • Learning rate – The amount that values should be changed between epochs. As the model is refined, its internal weights are being nudged and error rates are checked to see if the model improves. A typical learning rate is 0.1 or 0.01, where 0.01 is a much smaller adjustment and could cause the training to take a long time to converge, whereas 0.1 is much larger and can cause the training to overshoot. It is one of the primary hyperparameters that you might adjust for training your model. Note that for text models, a much smaller learning rate (5e-5 for BERT) can result in a more accurate model.

  • Batch size – The number of records from the dataset that is to be selected for each interval to send to the GPUs for training.

Review the tool tip prompts and additional information in the model detail card in the Studio UI to learn more about hyperparameters specific to the model of your choice.

For more information on available hyperparameters, see Commonly supported fine-tuning hyperparameters.

Deployment

Specify the training instance type and output artifact location for your training job. You can only choose from instances that are compatible with the model of your choice within the fine-tuning the Studio UI. The default output artifact location is the SageMaker default bucket. To change the output artifact location, choose Enter output artifact location and change the Amazon S3 URI.

Security

Specify the security settings to use for your training job, including the IAM role that SageMaker uses to train your model, whether your training job should connect to a virtual private cloud (VPC), and any encryption keys to secure your data.

Additional information

In the Additional Information field you can edit the training job name. You can also add and remove tags in the form of key-value pairs to help organize and categorize your fine-tuning training jobs.

After providing information for your fine-tuning configuration, choose Submit. If the pre-trained foundation model that you chose to fine-tune requires explicit agreement of an end-user license agreement (EULA) before training, the EULA is provided in a pop-up window. To accept the terms of the EULA, choose Accept. You are responsible for reviewing and complying with any applicable license terms and making sure they are acceptable for your use case before downloading or using a model.

Deploy foundation models in Studio

To deploy JumpStart foundation models, navigate to a model detail card in the Studio UI. For more information on how to open JumpStart in Studio, see Open and use JumpStart in Studio. After navigating to the model detail page of your choice, choose Deploy in the upper right corner of the Studio UI. Then, follow the steps in Deploy models with SageMaker Studio.

Important

Some foundation models require explicit acceptance of an end-user license agreement (EULA) before deployment. For more information, see EULA acceptance in Amazon SageMaker Studio.

Evaluate foundation models in Studio

Amazon SageMaker JumpStart has integrations with SageMaker Clarify foundation model evaluations (FME) in Studio. If a JumpStart model has built-in evaluation capabilities available, you can choose Evaluate in the upper right corner of the model detail page in the JumpStart Studio UI. For more information, see Evaluate a foundation model.