概念
Fine-tuning methods
Ways to adapt a pre-trained model: instruction tuning, domain adaptation, transfer learning and continued pre-training.
本课尚未翻译,暂以英文显示。
Instruction tuning
- Data
- Labeled prompt and response pairs
- Goal
- Follow your requests better
Domain adaptation
- Data
- Text from one field
- Goal
- Handle the field's language
Transfer learning
- Data
- A small task data set
- Goal
- Reuse what the model knows
Continued pre-training
- Data
- Large unlabeled text
- Goal
- Widen domain knowledge
| Method | Data | Goal |
|---|---|---|
| Instruction tuning | Labeled prompt and response pairs | Follow your requests better |
| Domain adaptation | Text from one field | Handle the field's language |
| Transfer learning | A small task data set | Reuse what the model knows |
| Continued pre-training | Large unlabeled text | Widen domain knowledge |
1 / 2
Instruction tuning
- Data
- Labeled prompt and response pairs
- Goal
- Follow your requests better
Domain adaptation
- Data
- Text from one field
- Goal
- Handle the field's language
Transfer learning
- Data
- A small task data set
- Goal
- Reuse what the model knows
| Method | Data | Goal |
|---|---|---|
| Instruction tuning | Labeled prompt and response pairs | Follow your requests better |
| Domain adaptation | Text from one field | Handle the field's language |
| Transfer learning | A small task data set | Reuse what the model knows |
2 / 2
Continued pre-training
- Data
- Large unlabeled text
- Goal
- Widen domain knowledge
| Method | Data | Goal |
|---|---|---|
| Continued pre-training | Large unlabeled text | Widen domain knowledge |
Labeled data
Inputs with the right answers. Used for fine-tuning.
Unlabeled data
Raw text with no answers. Used for continued pre-training.
是什么
Fine-tuning changes a pre-trained model so it fits your task. It starts from what the model already knows, so it needs far less data and compute than training from scratch. This reuse is called transfer learning.
Instruction tuning trains the model on pairs of an instruction and a good response, so it follows your kind of requests better. Domain adaptation tunes the model on text from one field, such as law or medicine, so it handles that language. Continued pre-training feeds the model large amounts of unlabeled text from your field to widen its knowledge.
是什么
The data type is the main difference. Fine-tuning needs labeled examples, which are prompt and response pairs, and teaches a task. Continued pre-training uses unlabeled text with no answers and teaches a domain. In Amazon Bedrock the training data sits in Amazon S3. You can set a few training settings: epochs (passes over the data), learning rate (size of each update) and batch size (examples per update).
要记住
- Transfer learning: reuse a pre-trained model's knowledge. Instruction tuning: train on instruction and response pairs.
- Domain adaptation: tune on text from one field.
- Fine-tuning uses labeled prompt and response pairs. Continued pre-training uses unlabeled text.
- In Amazon Bedrock the data sits in Amazon S3. Main settings: epochs, learning rate, batch size.
要记住
- Fine-tuning changes the model. RAG does not.
考试中
- “Train on prompt and response pairs so the model follows instructions” describes instruction tuning.
- “Add large unlabeled domain text to the model's knowledge” describes continued pre-training.
别和这些弄混
- Training a foundation modelPre-training, continued pre-training, fine-tuning and distillation: who does what, and what it costs.
- Preparing fine-tuning dataCuration, governance, size, labeling and representativeness: what makes training data good.
- Retrieval Augmented Generation (RAG)Look up facts first, add them to the prompt, then let the model answer from them.