5 Fine-tuning Foundational Models on AWS

 

This chapter covers

  • An overview of fine-tuning foundational models
  • Fine-tuning with instruction on Amazon Bedrock and Amazon SageMaker
  • Creating a dataset for fine-tuning
  • Fine-tuning with Llama 2 on Amazon Bedrock
  • Reinforcement learning

Fine-tuning foundational models is crucial for enhancing their capabilities, especially in new domains and specific tasks. While pre-trained models, such as those found in natural language processing (NLP) and artificial intelligence, demonstrate strong general performance, they may struggle with domain-specific language, vocabulary, or unique patterns. Fine-tuning helps these models specialize in particular domains, improving their accuracy and efficiency. Additionally, fine-tuning allows models to perform tasks more accurately, especially in cases where the foundational model’s general training may not fully align with the specific requirements of the new task. It also introduces cost savings at inference time by reducing the need for long prompts and numerous examples, as is the case with few-shot learning. This can significantly streamline operations without compromising performance.

5.1 Overview of fine-tuning Foundational Models

 
 
 
 

5.1.1 Hyperparameters for Fine-Tuning

 
 
 

5.1.2 Instruction-based Fine-tuning on AWS

 
 
 
 

5.2 Creating a Dataset for Fine-Tuning from Your Output

 
 

5.2.1 Formatting of a Multitask Instruction Dataset

 
 
 
 

5.2.2 Converting a Dataset to be used for Instruction

 
 

5.3 Fine-tuning with Instruction on Amazon Bedrock

 
 
 

5.3.1 Setting up for Fine-Tuning

 

5.3.2 Creating the Fine-Tuning Model Based on Llama 3.1

 
 

5.3.3 Invoking the Fine-Tuning Model

 

5.3.4 Cleaning Up the Resources

 

5.4 Fine Tuning on Amazon SageMaker JumpStart

 
 
 

5.4.1 Amazon SageMaker JumpStart

 

5.4.2 Deploying a Llama Model with Amazon SageMaker

 

5.4.3 Fine-Tuning through SageMaker Studio

 
 

5.5 Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest