သဘောတရား · AIF-C01 အပေါ် ဆက်လေ့လာရန်
Task-specific prompt engineering
Build a prompt for one task: examples, reasoning, role, output schema and sampling settings, then test and version it.
ဒီသင်ခန်းစာကို မြန်မာဘာသာ မပြန်ရသေးလို့ အင်္ဂလိပ်လို ပြထားပါတယ်။
AI Practitioner မှ သင်သိပြီးသားများ
- Zero-shot, single-shot and few-shot differ in how many examples you show.
- Chain-of-thought asks for step-by-step reasoning. A system prompt holds standing rules.
- Prompt chaining feeds one answer into the next prompt.
Zero-shot
- Use for
- Simple, clear tasks
- Cost
- Fewest tokens
Few-shot
- Use for
- Format and tone
- Cost
- More tokens each call
Chain of thought
- Use for
- Logic and math
- Cost
- Longer output
Role and system prompt
- Use for
- Rules and persona
- Cost
- Small
JSON schema
- Use for
- Output parsed by code
- Cost
- Small
Prompt chaining
- Use for
- Multi-step tasks
- Cost
- More calls
| Technique | Use for | Cost |
|---|---|---|
| Zero-shot | Simple, clear tasks | Fewest tokens |
| Few-shot | Format and tone | More tokens each call |
| Chain of thought | Logic and math | Longer output |
| Role and system prompt | Rules and persona | Small |
| JSON schema | Output parsed by code | Small |
| Prompt chaining | Multi-step tasks | More calls |
1 / 2
Zero-shot
- Use for
- Simple, clear tasks
- Cost
- Fewest tokens
Few-shot
- Use for
- Format and tone
- Cost
- More tokens each call
Chain of thought
- Use for
- Logic and math
- Cost
- Longer output
| Technique | Use for | Cost |
|---|---|---|
| Zero-shot | Simple, clear tasks | Fewest tokens |
| Few-shot | Format and tone | More tokens each call |
| Chain of thought | Logic and math | Longer output |
2 / 2
Role and system prompt
- Use for
- Rules and persona
- Cost
- Small
JSON schema
- Use for
- Output parsed by code
- Cost
- Small
Prompt chaining
- Use for
- Multi-step tasks
- Cost
- More calls
| Technique | Use for | Cost |
|---|---|---|
| Role and system prompt | Rules and persona | Small |
| JSON schema | Output parsed by code | Small |
| Prompt chaining | Multi-step tasks | More calls |
Temperature
Randomness. Low for facts, high for creative text.
Top-p
Sample from the smallest set of tokens whose chances add up to p.
Top-k
Sample only from the k most likely tokens.
Max tokens and stop
Limit the length and end the output at a marker.
ဘာလဲ
Shape the prompt to the task. For classification or extraction, give a role, the allowed labels, two or three examples (few-shot) and the exact output format. For math or logic, ask for step-by-step reasoning (chain of thought) before the final answer. Put standing rules and the role in the system prompt and the request in the user prompt. Ask for JSON that follows a stated schema so code can parse it, and validate it in code. Split a big task into a chain: one prompt extracts, the next summarizes, so each is simpler and easier to test.
ဘာလဲ
Sampling settings change the style of the output. Temperature controls randomness: a low value (near 0) gives consistent, factual answers, and a high value gives varied, creative ones. Top-p (nucleus sampling) picks from the smallest group of likely tokens whose probabilities add up to p. Top-k picks only from the k most likely tokens. Change temperature or top-p, not both at once. Maximum tokens and stop sequences limit the output.
Treat prompts like code. Keep them in Amazon Bedrock Prompt Management, which stores versions and variables. Test every change against a fixed set of examples, for example with a Bedrock evaluation job, and compare versions before release.
မှတ်ထားရန်
- Few-shot examples fix format and tone. Chain of thought helps multi-step reasoning.
- System prompt: role and standing rules. User prompt: the request.
- Ask for JSON in a stated schema, then validate it.
- Prompt chaining: split a task into simple prompts.
မှတ်ထားရန်
- Temperature: low for facts and extraction, high for creative text. Top-p and top-k limit the token pool.
- Version prompts and test them against a fixed example set.
စာမေးပွဲမှာ
- “The same answer every time for data extraction” points to a low temperature.
- “Output must be parsed by code” points to a JSON output schema in the prompt.
- “Compare two versions of a prompt before release” points to prompt versions and an evaluation job.
ဒီ task ထဲမှာ · 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