📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials Prompt Engineering Prompt Engineering Patterns Reference

Prompt Engineering Patterns Reference

5 min read Quiz at the end
Reference guide to 10 core prompt patterns — choose the right pattern for each task type.

Prompt Engineering Patterns Reference

PatternWhen to UseKey Phrase
Zero-ShotSimple, standard tasksJust the instruction
Few-ShotNovel format neededExample 1... Example 2... Now:
Chain-of-ThoughtComplex reasoning/mathLet us think step by step
ReActTool use, multi-step infoThought/Action/Observation
Self-ConsistencyHigh-stakes answersRun 5x, majority vote
Critique & RefineImprove output qualityList weaknesses, then rewrite
Tree of ThoughtsComplex planning/designExplore 3 approaches, rate each
RAGFactual Q&A over docsContext: [docs] Question: [q]
PersonaNeed expertise/toneYou are a [expert role]...
TemplateReusable promptsVariables: {var1} {var2}
# Meta-prompt: ask LLM to improve your prompt
You are an expert prompt engineer.
My current prompt is:
{current_prompt}

It has these issues:
{issues_observed}

Rewrite it using prompt engineering best practices.
Explain each change you made.