概念
Prompt best practices
Habits that raise answer quality: be specific, keep it short, give examples, test and add guardrails.
このレッスンはまだ翻訳されていないため、英語で表示しています。
Be specific
Say the task, audience and format.
Be concise
Cut words that add nothing.
Show examples
Sample answers set the format.
Use multiple comments
Separate, labeled instructions.
Add guardrails
Rules for what is allowed.
Experiment
Test variations, keep the best.
- 1Write or change the prompt.
- 2Run it on sample inputs.
- 3Review the answers and go back to refine.
概要
Good prompts improve the quality of responses, make the format predictable and cut wrong answers. Prompt engineering also helps you discover what a model can and cannot do.
Be specific: say exactly what you want, for whom, and in what format. Be concise: remove words that add nothing, because long prompts cost tokens and can confuse the model. Show examples when the format matters. Break instructions into separate, clearly labeled lines or comments, so each one is easy to follow and to change. Add guardrails, which are rules for what the model may and may not do.
概要
Treat a prompt like code you test. Try variations, compare the results, keep notes and save the best version.
覚えること
- Specific and concise: say exactly what you want, in few words.
- Show examples when the output format matters.
- Use several short, labeled instructions or comments instead of one long block.
- Add guardrails: limits on topics, tone and content.
- Experiment: change one thing at a time and compare.
覚えること
- Keep what works. Good prompts are reused and versioned.
試験では
- “Make the prompt clear and direct to improve response quality” points to specificity and concision.
- “Try variations and compare the outputs” describes prompt experimentation.
混同しやすいもの
- Prompting techniquesZero-shot, few-shot, chain-of-thought, negative prompts, templates, roles, chaining and ReAct, with one clue each.
- Prompt risks and limitsExposure, poisoning, hijacking and jailbreaking: how prompts get attacked and how to defend.
- Amazon Bedrock Prompt ManagementSave, version and reuse prompts, and compare prompt variants, inside Amazon Bedrock.