သဘောတရား · AIF-C01 အပေါ် ဆက်လေ့လာရန်
Data for fine-tuning, continued pre-training and distillation
JSONL formats for fine-tuning, continued pre-training and distillation, and how to split and store them.
ဒီသင်ခန်းစာကို မြန်မာဘာသာ မပြန်ရသေးလို့ အင်္ဂလိပ်လို ပြထားပါတယ်။
AI Practitioner မှ သင်သိပြီးသားများ
- Fine-tuning data should be curated, labeled and representative.
- Quality counts more than size.
- Data governance covers what you may use.
Fine-tuning
- Data
- Labeled prompt and answer
- Format
- JSONL prompt, completion
Fine-tuning, chat models
- Data
- Conversations
- Format
- JSONL messages by role
Continued pre-training
- Data
- Unlabeled domain text
- Format
- JSONL input text
Distillation
- Data
- Prompts or logs
- Format
- JSONL or invocation logs
| Goal | Data | Format |
|---|---|---|
| Fine-tuning | Labeled prompt and answer | JSONL prompt, completion |
| Fine-tuning, chat models | Conversations | JSONL messages by role |
| Continued pre-training | Unlabeled domain text | JSONL input text |
| Distillation | Prompts or logs | JSONL or invocation logs |
- 1Collect data you may use.
- 2Remove duplicates, empty records and errors.
- 3Write each record as a JSON line in the right format.
- 4Hold out a validation set, then upload to S3.
အဆင့်ဆင့်
- 1Collect data you may use.
- 2Remove duplicates, empty records and errors.
- 3Write each record as a JSON line in the right format.
- 4Hold out a validation set, then upload to S3.
From raw data to files in S3.
ဘာလဲ
Bedrock customization reads JSON Lines files in S3: one JSON object per line. Fine-tuning for text models uses prompt and completion pairs, for example {"prompt": "...", "completion": "..."}. Some models, such as Amazon Nova, use a conversation format: a messages list with system, user and assistant turns, as in the Converse API. Continued pre-training uses unlabeled text, one record per line with an input field, to teach a model a domain: it needs lots of raw domain text rather than labeled pairs. Check the data format page for the exact fields of the model you use.
ဘာလဲ
Distillation trains a small student model from a large teacher. You supply prompts only, or use the invocation logs that Bedrock stored in S3 for the teacher model. With prompts only, Bedrock generates the teacher responses. If your invocation logs already hold responses from the same teacher model, Bedrock reuses them and skips regeneration. If the logged model is different, the logged responses are not used. You need at least 100 prompts and at most 15,000. Bedrock then fine-tunes the student on the responses. Turn on model invocation logging first, and filter the logs by metadata to pick the prompts you want.
ဘာလဲ
Quality rules apply to all of them. Remove duplicates, empty or broken records and wrong answers. Keep the style and length of the data like real use. Hold out a validation set from the same source as training, and a separate test set for evaluation. Store files in S3 in the same Region, and give the Bedrock service role read access to the training prefix and write access to the output prefix.
မှတ်ထားရန်
- JSONL: one JSON object per line, in S3.
- Fine-tuning: prompt and completion pairs, or a messages conversation for some models.
- Continued pre-training: unlabeled domain text, an input field per line.
- Distillation: prompts only, or invocation logs from the teacher model.
မှတ်ထားရန်
- Clean, deduplicate and hold out a validation set.
- The Bedrock service role needs S3 read and write access.
စာမေးပွဲမှာ
- “Teach a model the vocabulary of a field using unlabeled documents” points to continued pre-training.
- “Build a smaller, cheaper model from a large model’s answers” points to distillation, with invocation logs or prompts.
- “Labeled question and answer pairs for a task” points to fine-tuning with prompt and completion data.
ဒီ task ထဲမှာ · 1.2
Glue ETL
DataBrew
EMR
Data Wrangler
SageMaker Processing
Athena
Feature Store
- Transforming streaming data
- Feature engineering techniques
- Embedding models for text and image
- Text pre-processing and tokenization
- Preparing documents for RAG
- Masking, redaction and anonymization
- Data for fine-tuning, continued pre-training and distillation