概念
Fine-tuning and continued pre-training in Bedrock
Customization jobs in Amazon Bedrock: data in S3, a few hyperparameters, and a custom model you must serve.
本课尚未翻译,暂以英文显示。
Fine-tuning
- Data
- Labeled prompt and completion pairs
- Goal
- Task, format, tone
Continued pre-training
- Data
- Unlabeled text
- Goal
- Domain knowledge
Distillation
- Data
- Prompts and teacher answers
- Goal
- A small, fast model
Reinforcement tuning
- Data
- Prompts and a reward function
- Goal
- Better answers by score
| Job | Data | Goal |
|---|---|---|
| Fine-tuning | Labeled prompt and completion pairs | Task, format, tone |
| Continued pre-training | Unlabeled text | Domain knowledge |
| Distillation | Prompts and teacher answers | A small, fast model |
| Reinforcement tuning | Prompts and a reward function | Better answers by score |
1 / 2
Fine-tuning
- Data
- Labeled prompt and completion pairs
- Goal
- Task, format, tone
Continued pre-training
- Data
- Unlabeled text
- Goal
- Domain knowledge
Distillation
- Data
- Prompts and teacher answers
- Goal
- A small, fast model
| Job | Data | Goal |
|---|---|---|
| Fine-tuning | Labeled prompt and completion pairs | Task, format, tone |
| Continued pre-training | Unlabeled text | Domain knowledge |
| Distillation | Prompts and teacher answers | A small, fast model |
2 / 2
Reinforcement tuning
- Data
- Prompts and a reward function
- Goal
- Better answers by score
| Job | Data | Goal |
|---|---|---|
| Reinforcement tuning | Prompts and a reward function | Better answers by score |
- 1Bedrock reads the training data from S3.
- 2It trains a private copy of the model.
- 3Serve it with Provisioned Throughput. Only a few models can use an on-demand deployment.
分步说明
- 1Bedrock reads the training data from S3.
- 2It trains a private copy of the model.
- 3Serve it with Provisioned Throughput. Only a few models can use an on-demand deployment.
From S3 data to a served custom model.
是什么
An Amazon Bedrock customization job trains a copy of a foundation model on your data. Fine-tuning (supervised) uses labeled examples, prompt and completion pairs in a JSONL file in Amazon S3, to teach a task, a format or a tone. Continued pre-training uses large amounts of unlabeled text from your domain to widen the model’s knowledge. It was offered only for a few Amazon Titan text models. The current Bedrock customization pages no longer list it, so check the console before you plan on it. On the exam, unlabeled domain text still points to continued pre-training.
是什么
Bedrock also offers distillation, and reinforcement fine-tuning, which scores answers with a reward function you write in AWS Lambda.
You supply training data and, optionally, validation data in S3, an S3 output location and an IAM service role. You set hyperparameters such as epochs, batch size and learning rate; each model lists the ranges it allows. Only some models can be customized, and the list differs by Region. At the time of writing, Amazon Nova models were listed in US East (N. Virginia) and Meta Llama and Claude 3 Haiku in US West (Oregon), so check the current table.
是什么
For security you can run the job in your VPC, with subnets and security groups, so training data stays on private networks. You can also encrypt the custom model with your own AWS KMS key. Training is billed on tokens processed (tokens in the training data times epochs), plus a monthly fee for storing each custom model.
是什么
A custom model is not called like a base model. To serve it, buy Provisioned Throughput for the model. Only a few base models can use a custom model deployment and pay per token. These are some Amazon Nova models and Llama 3.3 70B, in limited Regions. Other custom models need Provisioned Throughput to run. Provisioned Throughput is billed by the hour whether or not you send requests, so delete it when you stop.
要记住
- Fine-tuning: labeled prompt and completion pairs. Continued pre-training: unlabeled text.
- Data in S3 as JSONL, with an optional validation set.
- Settings: epochs, batch size and learning rate.
- VPC configuration and a KMS key protect data and the custom model.
- Billed on tokens times epochs, plus storage each month.
要记住
- Serve with Provisioned Throughput. Only a few models can use an on-demand deployment.
考试中
- “Teach the model our ticket format using 3,000 labeled examples” points to Bedrock fine-tuning.
- “A large archive of unlabeled company documents” points to continued pre-training.
- “Run the fine-tuned model in production” points to Provisioned Throughput for the custom model, or an on-demand deployment.
本任务内容 · 2.2
- Built-in algorithms for tabular data
- Built-in algorithms: clustering, dimensionality reduction, anomaly
- Built-in algorithms: text, sequence and forecasting
- Built-in algorithms: image and video
- Training jobs, script mode and ML libraries
SageMaker AMT
- Reducing training time
- Distributed training and HyperPod
- Overfitting, underfitting and catastrophic forgetting
- Combining models
- Epochs, steps, batch size and learning rate
- Task-specific prompt engineering
- Fine-tuning and continued pre-training in Bedrock
- PEFT, LoRA and fine-tuning on SageMaker
- Model distillation
- Optimizing retrieval and embedding models