Prompting Techniques
Simple tricks to get better answers from any AI. Think of these as different ways to ask a question — some work better than others depending on what you need.
Which Technique Should I Use?
Just Ask (Zero-Shot)
Starting pointBest for: Simple questions with clear answers
Just type your question normally. No tricks needed. This is how most people use AI — and it works great for everyday questions. Only try fancier techniques when this doesn't give you what you want.
EXAMPLE PROMPT
What's a good birthday gift for a 10-year-old who likes science?DO
- + Start here for every question
- + Be clear about what you want
- + Mention the format if it matters ("give me a list")
DON'T
- - Overthink simple questions
- - Add unnecessary instructions for basic stuff
Think Step by Step (Chain-of-Thought)
+10-20% more accurateBest for: Math problems, comparing options, planning
Just add "think step by step" to your question. This forces the AI to show its work instead of jumping to an answer — like asking a student to show their math. You can catch mistakes along the way. Skip this on "thinking" models like Claude Opus — they already do it automatically.
EXAMPLE PROMPT
I'm choosing between two cars:
- Car A: $30,000, gets 35 mpg, $200/mo insurance
- Car B: $25,000, gets 25 mpg, $250/mo insurance
I drive 15,000 miles a year and gas is $3.50/gallon.
Which car is cheaper over 5 years?
Think step by step.DO
- + Use for math, comparisons, and decisions
- + Use on regular models (Sonnet, GPT-4o, Gemini Flash)
- + Let the AI show its work so you can check it
DON'T
- - Use on thinking models (they already do this)
- - Use for simple facts like "what year was X born"
- - Expect it to know things it doesn't
Show Me What You Want (Few-Shot)
+15-30% more accurateBest for: Getting a specific style, format, or tone
Show the AI 2-3 examples of what good output looks like, then ask it to do the same thing. It's like showing a new employee examples of past work before asking them to do something similar.
EXAMPLE PROMPT
Write short product descriptions in this style:
Example: "Classic White Tee — Soft cotton, relaxed fit. The one you'll reach for every morning. $29"
Example: "Weekend Joggers — Stretchy, breathable, looks good at brunch or on the couch. $55"
Now write one for:
- A waterproof hiking jacket, $120
- A leather laptop bag, $89DO
- + Use 2-5 examples that show variety
- + Make sure examples match the difficulty of your real task
- + Include edge cases if they matter
DON'T
- - Use examples that contradict each other
- - Use more than 7 examples (you hit diminishing returns)
- - Use examples way simpler than your actual task
Give It a Role (Persona Prompting)
+14-18% on specialized topicsBest for: Getting expert-level answers, matching a specific tone
Tell the AI to pretend it's a specific type of expert. "You are a friendly pediatrician" gives very different health advice than "you are a medical researcher." The more specific the role, the better the answer.
EXAMPLE PROMPT
You are a patient, experienced home inspector
with 20 years in the business.
I'm buying my first house and the inspection report
mentions "minor foundation cracks." Should I be worried?
What questions should I ask the seller?
Explain like you're talking to someone who knows
nothing about houses.DO
- + Be specific about the role ("experienced pediatrician" not just "doctor")
- + Mention the audience ("explain to a beginner")
- + Combine roles for different perspectives
DON'T
- - Use vague roles ("expert")
- - Expect the role to give it new facts it doesn't know
- - Assign conflicting roles in the same prompt
Explore Multiple Angles (Tree-of-Thought)
+83% on complex problemsBest for: Big decisions with multiple factors to weigh
Ask the AI to consider a problem from several different angles, evaluate each one, then combine them into a recommendation. It's like asking your friend to think about a decision from the money side, the lifestyle side, and the risk side before giving advice.
EXAMPLE PROMPT
I'm deciding whether to accept a job offer in a new city.
Look at this from 3 angles:
Angle 1: Money (salary difference, cost of living,
moving expenses)
Angle 2: Career (growth potential, industry trends,
resume impact)
Angle 3: Personal (distance from family, city lifestyle,
partner's job options)
After exploring all 3, give me your overall recommendation.DO
- + Use for important life decisions
- + Ask for at least 3 different perspectives
- + Ask it to weigh the perspectives against each other
DON'T
- - Use for simple questions (way overkill)
- - Skip the final synthesis step
- - Expect it to know personal preferences — tell it what matters most to you
Ask 3 Times and Compare (Self-Consistency)
-15-20% fewer wrong answersBest for: When you need to be really sure the answer is right
Ask the same question 3-5 times in separate chats and see if you get the same answer each time. If all 3 agree, you can trust it. If they give different answers each time, the AI is unsure and you should verify elsewhere.
EXAMPLE PROMPT
[Ask this same question in 3 separate chats]
Based on these symptoms — persistent dry cough
for 3 weeks, no fever, worse at night — what are
the most likely causes? List them in order of
probability.
[Compare: if all 3 chats say the same top causes
→ high confidence. If they disagree → see a doctor.]DO
- + Use when accuracy really matters
- + Run at least 3 separate chats
- + Pay attention when answers disagree
DON'T
- - Use for creative tasks (different answers are normal)
- - Run fewer than 3 tries
- - Ignore it when the answers conflict — that means the AI is guessing
Let It Think Deeply (Extended Thinking)
Better answers on hard problemsBest for: Complex questions that need real analysis
Some newer AI models (Claude Opus, OpenAI o3, Gemini Thinking) can "think" internally before answering. Instead of telling them exactly how to reason, just say "think carefully" or "think deeply" and let them figure out the best approach. It's like giving someone time to really think before they answer.
EXAMPLE PROMPT
Think carefully about this.
I have $50,000 in savings, $30,000 in student loans
at 5% interest, and my employer matches 401k
contributions up to 5% of my $70,000 salary.
What's the smartest order to use my money?
Consider the math but also real-life factors.DO
- + Use with thinking models (Claude Opus, o3, Gemini Thinking)
- + Give the big picture, let the AI figure out the details
- + Use for complex decisions, tricky problems, or detailed analysis
DON'T
- - Say "think step by step" (redundant — thinking models do this on their own)
- - Micromanage how it should think
- - Use on regular models (they won't think deeper, they'll just say "okay")
Ask for a Specific Format (Structured Output)
Consistent, organized answersBest for: Getting clean data, filling templates, organized lists
Tell the AI exactly how to organize its answer. Want a table? Ask for a table. Want bullet points with headers? Say so. Want it to fill in a template? Paste the template. This prevents rambling and makes answers easier to use.
EXAMPLE PROMPT
Compare these 3 phones for me in a table with columns:
Phone Name | Price | Battery Life | Camera Quality | Best For
iPhone 16
Samsung Galaxy S25
Google Pixel 9DO
- + Ask for tables, lists, or specific formats by name
- + Paste a template if you have one
- + Be specific about what columns, sections, or categories you want
DON'T
- - Leave the format up to the AI when you have a preference
- - Ask for overly complicated formats with 20 columns
- - Forget to mention the format and then complain about the layout
Set Boundaries (Constraints)
+10-25% more focusedBest for: Keeping answers on topic, limiting scope, controlling length
Tell the AI what NOT to do, how long the answer should be, or what to exclude. Constraints narrow the output so you get exactly what you need without filler. Think of it like giving a contractor a budget and a deadline — they make better decisions with boundaries.
EXAMPLE PROMPT
Write a product description for a standing desk.
Constraints:
- Maximum 3 sentences
- No superlatives (no "best," "amazing," "revolutionary")
- Must mention the price ($449)
- Don't compare to competitors
- Write for someone who already knows what a standing desk isDO
- + Set word or sentence limits
- + List things to exclude (topics, words, formats)
- + Specify the audience level so it doesn't over-explain
- + Combine with other techniques for precision
DON'T
- - Add so many constraints the AI can't answer at all
- - Contradict yourself ("be detailed" + "keep it under 50 words")
- - Use vague constraints like "keep it short" — say exactly how short
Quick Comparison
| Technique | How Much It Helps | Effort | Works On |
|---|---|---|---|
| Just Ask | Baseline | None | All AIs |
| Think Step by Step | +10-20% accuracy | Add one sentence | Regular models |
| Show Examples | +15-30% accuracy | Write 2-3 examples | All AIs |
| Give It a Role | +14-18% on expert topics | Add one sentence | All AIs |
| Explore Multiple Angles | +83% on hard problems | Write a detailed prompt | All AIs |
| Ask 3 Times | Catches 15-20% more errors | Run 3 separate chats | All AIs |
| Let It Think Deeply | Varies (often big improvement) | Add one phrase | Thinking models only |
| Ask for a Format | Much cleaner answers | Describe the format | All AIs |
For Developers: Auto-Tune Your Prompts
If you're building an app that uses AI, these tools can automatically find the best prompt for your use case — often beating hand-written prompts by ~20%.
DSPy
Ready to useBuild prompt pipelines that optimize themselves. Best for production apps.
TextGrad
Getting thereFine-tunes prompts for specific hard tasks. Great for coding and science.
OPRO
Getting thereThe AI tries different prompts and picks the best one. Easy to set up.
metaTextGrad
ExperimentalOptimizes the optimizer itself. Cutting-edge research.