Advanced Prompt Techniques: Self-Critique and Iteration
Once you've mastered basic prompt construction, a new set of techniques becomes available — ones that use the model's own reasoning to improve its outputs. Self-critique, iterative refinement, meta-prompting, and prompt chaining can turn a single-shot interaction into a quality-controlled pipeline.
These techniques are especially valuable when:
- A single prompt attempt isn't reliable enough for production use
- The task is complex enough that the model needs to check its own work
- You need outputs that meet specific quality criteria
- You're building automated workflows, not one-off queries
Self-Critique
Self-critique asks the model to evaluate its own output before finalizing it. This leverages the observation that models are often better at identifying problems than avoiding them in a single generation.
Basic Pattern
[Step 1 — Generate]
Write a Python function that parses a CSV file and returns a list of
dictionaries. Handle common errors.
[Receive initial output]
[Step 2 — Critique]
Review the function you just wrote. Identify:
1. Any cases where it might fail silently
2. Missing error handling
3. Performance issues for large files
4. Anything that doesn't follow Python best practices
[Step 3 — Revise]
Rewrite the function addressing all issues you identified.
Self-Critique in a Single Prompt
For efficiency, you can instruct the model to critique and revise in one pass:
Write a Python function to parse CSV files, then immediately review it for
error handling gaps, performance issues, and Python anti-patterns. Finally,
provide a revised version that addresses all issues. Format as:
Draft:
[initial version]
Critique:
[identified issues]
Final Version:
[revised version]
What Self-Critique Catches
Self-critique is most effective at catching:
- Missing edge case handling
- Off-by-one errors in logic
- Logical inconsistencies in arguments
- Omissions from a required checklist
- Factual statements the model isn't confident about
It's less effective at catching fundamental misunderstandings — if the model misunderstood your request, it will likely critique the wrong things.
Iterative Refinement
Iterative refinement runs multiple rounds of generation and feedback, each round narrowing the output toward the target.
Manual Iteration
This is the most common pattern in practice — you provide feedback between rounds:
Round 1: Write an executive summary of this Q3 report. [paste report]
→ [receive draft]
Round 2: The tone is too formal. Make it more direct and action-oriented.
Cut the third paragraph — it duplicates information from paragraph one.
→ [receive revision]
Round 3: Good. Now tighten the opening sentence — it's currently 45 words.
Aim for under 20.
→ [receive final]
Automated Iteration with Criteria
For automated pipelines, define success criteria the model can check itself:
Your task is to write a product tagline. Requirements:
- Under 8 words
- No jargon
- Communicates the core value proposition (fast + secure file sharing)
- Does not use the words "fast", "quick", "secure", or "safe"
Generate a tagline, then check it against each requirement. If any requirement
fails, generate a new tagline and check again. Repeat until all requirements
pass. Show your final answer only.
Constitutional Prompting
Constitutional prompting defines a set of principles (a "constitution") that the model applies as a filter over its own output. This is useful for maintaining consistent values, tone, or constraints across many different tasks.
Before finalizing any response, verify it against these principles:
1. Every claim is supported by evidence or marked as opinion
2. No language that could be interpreted as dismissive or condescending
3. Complexity is introduced gradually — simpler explanations precede complex ones
4. Action items are concrete and specific, not vague recommendations
If the response violates any principle, revise it until all principles are satisfied.
Then output the final response only.
Meta-Prompting
Meta-prompting uses a model to generate or improve the prompt for another task. Instead of writing the prompt yourself, you describe what you want to achieve and ask the model to construct the optimal prompt.
Generating Prompts
I need to write a prompt for an AI that will help customer support agents
classify support tickets. Tickets come in via email and chat. Categories are:
billing, technical, account, feature-request, spam.
The prompt needs to:
- Instruct the model to classify each ticket
- Handle ambiguous tickets (assign the primary category)
- Return only the category name, nothing else
- Be robust to tickets in different languages
Write the optimal system prompt for this use case.
Improving Existing Prompts
Here is a prompt I'm using for [task]:
[paste existing prompt]
The current issues are:
1. Responses are sometimes too long
2. The model occasionally goes off-topic
3. Output format is inconsistent
Rewrite the prompt to fix these issues while preserving what works.
Explain each change you make.
Prompt Chaining
Prompt chaining breaks a complex task into sequential steps, feeding the output of each step as input to the next. Each step is simpler and more reliable than attempting everything in one shot.
Example: Research-to-Report Pipeline
Step 1 — Outline
Prompt: "Given this topic [X], generate a structured outline for a 1000-word
explanatory article. Include 4-5 main sections with 2-3 sub-points each."
→ Output: outline
Step 2 — Draft each section
Prompt (run for each section): "Write the [section name] section of the article
about [X]. This section should cover: [sub-points from outline]. Target 200 words.
Maintain a [tone] tone."
→ Output: section drafts
Step 3 — Combine and smooth
Prompt: "Here are 5 independently written sections for an article about [X].
Combine them into a cohesive article, ensuring smooth transitions between sections
and a consistent voice throughout. Do not add new content — only integrate and smooth.
[paste sections]"
→ Output: final article
When to Chain vs. Single-Shot
Use chaining when:
- The task has distinct phases (research → draft → edit)
- Each phase requires different expertise or tone
- A single prompt would exceed context limits
- You need to inject human review between steps
- Early steps determine the structure of later steps
Implementing Chains in Code
import anthropic
client = anthropic.Anthropic()
def run_chain(topic: str) -> str:
# Step 1: outline
outline_response = client.messages.create(
model="claude-opus-4-5",
max_tokens=500,
messages=[{"role": "user", "content": f"Outline a 1000-word article about: {topic}"}]
)
outline = outline_response.content[0].text
# Step 2: draft (simplified — real impl iterates sections)
draft_response = client.messages.create(
model="claude-opus-4-5",
max_tokens=1500,
messages=[{
"role": "user",
"content": f"Using this outline, write the full article:\n\n{outline}"
}]
)
return draft_response.content[0].text
Combining Techniques
The most robust pipelines combine multiple techniques:
1. Meta-prompting → generate optimal task prompt
2. Prompt chaining → break task into phases
3. Self-critique → review output of each phase
4. Constitutional check → verify final output meets standards
5. Iterative refinement → address any remaining gaps
This is overkill for simple tasks but appropriate for high-stakes automated workflows.
Key Takeaways
- Self-critique catches issues the initial generation misses — especially omissions and edge cases
- Iterative refinement with explicit criteria converges faster than vague feedback
- Meta-prompting can generate better task prompts than manual writing
- Prompt chaining breaks complex tasks into reliable, verifiable steps
- Combine techniques for automated, high-stakes pipelines