Self-Refine โ Prompting Guide & Examples
Self-Refine is a technique where the AI generates an initial response, critiques its own output, then produces an improved version. This iterative self-improvement cycle can be repeated multiple times, with each round producing better results.
How It Works
Three phases: (1) Generate an initial response, (2) Ask the model to critique that response identifying weaknesses, (3) Ask it to produce an improved version addressing the critique. Repeat steps 2-3 until quality is satisfactory.
When to Use
Use self-refine for writing tasks, code generation, creative content, and any output where quality matters more than speed. Especially effective for first drafts that need polishing, or when you want to catch errors before human review.
Model-Specific Tips
ChatGPT / GPT-4
GPT-4 handles self-refine excellently. Use a single conversation with 'Now critique...' and 'Now improve...' follow-ups, or chain API calls programmatically.
Claude
Claude is excellent at self-critique. Ask Claude to rate its output on specific dimensions, then improve. Claude's honesty about weaknesses makes self-refine very effective.
Gemini
Gemini supports self-refine well. Use multi-turn conversations to iterate. Gemini can maintain context across critique and improvement cycles.
Pros & Cons
Pros
- โ Significantly improves output quality
- โ Model catches its own mistakes
- โ Works for any content type
- โ Simple to implement in any workflow
Cons
- โ 2-3x more tokens per task
- โ Slower due to multiple rounds
- โ Diminishing returns after 2-3 iterations
- โ Model may not always identify real weaknesses
Example Prompts
Write a cold outreach email to a VP of Engineering about our API testing platform. Now critique this email: What's weak? What could be more compelling? What might make the recipient delete it? Now rewrite the email addressing every critique.
Generate a Python function that finds the k most frequent elements in an array. Review this code for: edge cases, performance, readability, and best practices. List all issues. Now produce a final version that fixes every issue you identified.
Write a product description for wireless noise-canceling headphones. Rate this description 1-10 on: specificity, emotional appeal, SEO value, and uniqueness. Explain each rating. Now write the best possible version scoring 9+ on all criteria.