Guide9 min readUpdated Feb 2025
Prompt Engineering Techniques: 7 Advanced Methods
A practical guide to zero-shot, few-shot, chain-of-thought, roles, self-consistency, templates, and grounded answers—each with a copy-paste example.
Polish outputs faster
Format and rewrite with microtools.
Method 1
Zero-shot prompting
State the goal clearly with constraints. Works for straightforward tasks and when speed matters.
Example
Summarize this transcript for executives in 3 bullets and 3 action items. Keep under 120 words. No jargon.
Method 2
Few-shot prompting
Provide 1-3 examples to steer style/structure. Use when format or tone matters.
Example
Rewrite release notes.
Example:
Input: "Added SSO"
Output: "🔐 Single sign-on: Log in with Okta/AAD; rollout today."
Now rewrite: "{{notes}}"Method 3
Chain-of-thought
Ask the model to reason step-by-step before the final answer. Great for reasoning or multi-step decisions.
Example
Think step-by-step to decide the best pricing tier for this use case: {{context}}. Show reasoning first, then final choice.Method 4
Role prompting
Assign a persona to set context and tone. Combine with goals and constraints.
Example
You are a senior support lead. Draft a 3-step response to de-escalate an angry customer about {{issue}}. One CTA. Under 110 words.Method 5
Self-consistency
Ask for multiple options and pick the best. Helps reduce variance.
Example
Generate 3 subject lines for {{campaign}}. Keep under 40 chars. Return the top option last with a short reason.Method 6
Template prompting
Use placeholders to make prompts reusable across tasks.
Example
You are a {{role}} writing for {{audience}}. Goal: {{goal}}. Tone: {{tone}}. Format: bullets. Length: {{length}} words max.Method 7
Knowledge integration
Provide source text and ask the model to ground answers only in that text.
Example
Using only this doc, answer the question. Cite the section.
Doc: {{content}}
Question: {{question}}Best practices
- State goal, audience, tone, format, and length up front.
- Use few-shot when style/format matters; keep examples short.
- Ground answers in provided text to reduce hallucinations.
- Ask for the reasoning first (CoT) and a concise final output.
- Generate multiple options (self-consistency) and pick the best.
FAQ
Which model should I start with?
Use a fast model (Claude Haiku/GPT-4o mini) for drafts; switch to Claude Sonnet/GPT-4o for nuance or safety.
Do I always need examples?
No. Use few-shot when tone/format matters. For simple tasks, zero-shot with clear constraints is enough.
How do I reduce hallucinations?
Ground responses in provided text, set scope (“only use the doc above”), and keep tasks narrow.
How long should prompts be?
Long enough to set goal, role, constraints, and format. Avoid dumping unnecessary context.