Newsletter, guides

Self-refine prompting: Self-critique loops for LLMs

How self-refine prompting works, with Python code for a draft, critique and refine loop, when self-critique helps or hurts, and Rephrase and Respond.

, 7 min read, updated

You ask an LLM for a slogan, an email or a blog title and get a first draft that is bland, generic or just okay. LLMs are like an eager intern: their first idea is rarely their best one. Asking again with “make it better” helps a little, but the model has no idea what “better” means to you.

Self-refine prompting is a prompting technique that improves LLM output by having one model draft, critique the draft against explicit criteria, and rewrite it. The idea comes from the Self-Refine paper by Madaan et al., which needs no extra training or second model. This guide builds a Creative Assistant that uses the loop, shows when self-critique helps and when it hurts, and covers Rephrase and Respond as a lighter option.

Key takeaways

  • Self-refine prompting runs three steps with one model: draft, critique against named criteria, then refine using the critique.
  • The Self-Refine paper reported about 20 percent absolute improvement on average across seven tasks over one-step generation.
  • Explicit criteria are what make the critique useful. “Is it short and catchy?” beats “Review your answer”.
  • Self-critique works best on open-ended work like writing and code. On reasoning tasks without outside feedback, it can make answers worse.
  • Run each step as a separate API call when you need to log, evaluate or stop the loop early.
  • Rephrase and Respond is a lighter technique: the model restates the question in its own words before it answers.

What is the problem with first drafts?

The first draft is the model’s most likely answer, and the most likely answer is usually the most generic one. Ask for a creative task and you get the average of everything the model has seen.

Use case: “Write a slogan for our new, eco-friendly water bottle.”

An illustrative first draft: “Stay hydrated, save the planet.” It is bland, it is generic, and it is not catchy. The bot did the task, but the quality is low. It gave you its first thought, and nothing in the prompt asked for a second one.

How do you build a self-critique and refinement loop?

You ask for a process instead of an answer: draft, critique against your criteria, then finalize from the critique. The simplest version fits in one prompt.

  1. Draft: generate the first idea.
  2. Critique: analyze that idea against named criteria.
  3. Finalize: write a new version that fixes what the critique found.
# filename: example.py
# description: A single-prompt draft, critique and finalize process.
prompt = """
I need a slogan for a new eco-friendly water bottle.

Please follow this exact 3-step process:

1.  DRAFT: First, generate one initial slogan.

2.  CRITIQUE: Second, critically evaluate your own DRAFT.
    - Is it short and catchy?
    - Does it clearly communicate "eco-friendly"?
    - What is its single biggest weakness?

3.  FINALIZE: Third, based on your critique, write a
    final, improved slogan.
"""

The final slogan usually beats the draft, because the prompt made the model look for flaws in its own first idea. The criteria do the work. Add the ones your brand cares about, such as target audience or brand voice, and the critique gets sharper.

How do you run self-refine as separate API calls?

Split draft, critique and refine into separate calls and loop until the critique passes or a round limit hits. That is the Self-Refine method, and it is the self-correction chain Anthropic’s prompting guide describes.

Separate calls let you log each step, score the draft with an eval, and stop early when the critique finds nothing to fix. The single prompt above cannot do any of that.

Self-refine loop: a draft call, a critique call against criteria, and a refine call that repeats until the critique passes or a round limit stops it
# filename: self_refine.py
# description: Draft, critique and refine as separate calls with a stop condition.
from openai import OpenAI

client = OpenAI()
MODEL = "gpt-5-mini"  # any current chat model works

def complete(prompt: str) -> str:
    return client.responses.create(model=MODEL, input=prompt).output_text

CRITERIA = """- Is it under eight words?
- Does it say "eco-friendly" without using that phrase?
- Would a 25-year-old repeat it to a friend?"""

def self_refine(task: str, max_rounds: int = 3) -> str:
    draft = complete(task)
    for _ in range(max_rounds):
        critique = complete(
            f"Task: {task}\nDraft: {draft}\n\nCheck the draft against:\n{CRITERIA}\n"
            "List concrete problems. If there are none, reply exactly: PASS"
        )
        if critique.strip() == "PASS":
            break
        draft = complete(
            f"Task: {task}\nDraft: {draft}\nCritique: {critique}\n\n"
            "Rewrite the draft to fix every problem. Reply with the new version only."
        )
    return draft

print(self_refine("Write a slogan for our new eco-friendly water bottle."))

The round limit matters. Without it, a picky critique can loop forever and cost a call per round.

When does self-critique help, and when does it hurt?

Self-critique helps on open-ended output where quality has many dimensions: writing, code style, summaries. It hurts most on reasoning problems with one right answer, when the model has nothing but its own judgment to check against.

Huang et al. tested this in “Large Language Models Cannot Self-Correct Reasoning Yet”. Without external feedback, models struggled to fix their own reasoning, and some got worse after self-correction. A model that was confident in a wrong answer tends to stay confident when asked to review it.

The fix is to give the critique something real to check. Run the tests, call a validator, or retrieve the source documents, and put the result in the critique prompt. For answers grounded in documents, see fact-checking RAG answers with a verification step. For scoring outputs at scale, the evals lab builds that loop end to end.

What is Rephrase and Respond prompting?

Rephrase and Respond, or RaR, asks the model to restate and expand the question in its own words before it answers. It comes from Deng et al., who found it improved results across many models and tasks.

The one-step version is a single prompt:

prompt = """
I need a short, exciting slogan for a new video game
about space pirates.

First, rephrase and expand your understanding of this task.

Then, generate 3 slogans.
"""

The rephrasing surfaces what the task implies (“high energy”, “science fiction”, “a pirate theme”) before the model writes. In the two-step version, one call rephrases the question and a second call answers using both the original and the rephrased question.

Two-step Rephrase and Respond: a rephrasing call rewrites the user's question, then a responding call answers using both versions

RaR does not critique an answer. It clarifies the question. Use it when vague requests produce off-target answers, and use self-refine when the answers are on target but weak. The paper also found RaR works alongside chain-of-thought prompting.

What to do next

  1. Pick one task where first drafts come back bland, such as a slogan, an email or a summary.
  2. Write three to five critique criteria that name what good looks like for that task.
  3. Try the single-prompt draft, critique and finalize version and compare it to a plain prompt.
  4. Move to separate calls with a round limit once you need logging or an early stop.
  5. For tasks with a right answer, feed the critique external evidence such as test results or source documents.
  6. Add Rephrase and Respond to prompts where vague requests lead to off-target answers.

Frequently asked questions

What does self-refinement mean?

Self-refinement means an LLM improves its own output by critiquing it and rewriting it, with no human in the loop. The model drafts an answer, gives itself feedback against criteria, and revises using that feedback. The Self-Refine paper showed this works with one model and no extra training. It improved results across seven tasks, including code and dialogue.

What are the components of the prompt refinement process?

A prompt refinement process has a draft step, a critique step and a refine step, plus a stop condition. The critique uses explicit criteria, such as length, tone or correctness. The refine step rewrites the draft to fix every problem the critique named. The stop condition is a passing critique or a round limit, so the loop cannot run forever.

Does self-critique always improve LLM output?

No. Self-critique reliably helps open-ended work such as writing and code style, where the model can spot weak phrasing. On reasoning tasks with one right answer, research by Huang et al. found models often fail to fix their own mistakes without external feedback. In some cases accuracy dropped after the review. Give the critique test results or source documents to check against.

When should I use Rephrase and Respond instead of a refinement loop?

Use Rephrase and Respond when the model misreads vague or ambiguous requests. It clarifies the question before the answer, often in a single prompt. Use a self-refine loop when the model understands the task but the first answer is weak. The two combine well: rephrase the task first, then draft, critique and refine the answer.

What is the difference between self-refine and self-consistency prompting?

Self-refine improves one answer over several rounds by critiquing and rewriting it. Self-consistency samples many independent answers to the same question and picks the most common final answer. Self-refine suits open-ended tasks like writing, where there is no single answer to vote on. Self-consistency suits problems with one checkable answer, such as maths.

Sources

Subscribe to Top 1% Engineers

One issue at a time on building AI systems that hold up in production: architecture, the open source that matters, and what to do on Monday. Every number cited.

We email you each new issue. You can leave at any time. Privacy

More guides

See the newsletter and every guide