Prompt Engineering
Unlock the complete study guide + 1,040 practice questions across 16 full exams.
Bundled into the existing AWS Certified AI Practitioner AIF-C01 premium course — no separate purchase.
Included in this chapter:
- Prompt anatomy, techniques, and best practices
- Prompt-level risks and how to defend against them
- Exam-pattern recognition: technique, attack, and distractor traps
Zero-shot vs. few-shot vs. chain-of-thought prompting
| Aspect | Zero-shot | Few-shot (in-context learning) | Chain-of-thought |
|---|---|---|---|
| Examples in prompt | None: instruction only | A few paired input-output examples ("shots") | Often zero or few, plus a "reason step by step" cue |
| Best for | Simple, well-understood tasks the model already handles | Enforcing a specific format, label set, or style | Multi-step reasoning, arithmetic, and logic problems |
| Token cost | Lowest: shortest prompt | Higher: examples add input tokens | Higher: model generates extra reasoning tokens |
| Reliability | Variable on nuanced or formatted tasks | More consistent output matching the examples | More accurate on problems needing intermediate steps |
Decision tree
Cheat sheet
Unlock with Premium — includes all practice exams and the complete study guide.
Also tested in
References
- Prompt engineering guidelines for foundation models - Amazon Bedrock
- What is prompt engineering? - Amazon Bedrock
- Prompt management - Amazon Bedrock
- Best practices - LLM prompt engineering best practices (AWS Prescriptive Guidance)
- Common prompt injection attacks - LLM prompt engineering best practices (AWS Prescriptive Guidance)
- Stop harmful content using Amazon Bedrock Guardrails