Self-refine is a prompting technique in which a single language model produces an initial answer, writes specific feedback on its own output, and then rewrites the answer using that feedback, repeating the cycle until a stopping condition is met. In prompting, it belongs to the family of iterative self-refinement methods that improve quality at inference time without fine-tuning, extra training data or a second model.
The approach was formalized in 2023 research on large language models, which framed it as three roles played by one model: generator, critic and refiner. It works best on tasks where quality is easy to judge but hard to achieve in one pass, such as style, readability, constraint satisfaction and code clarity.
How the self-refine loop works
Self-refine runs a feedback-and-rewrite loop controlled entirely by prompts. Each stage uses its own instruction and usually its own few-shot examples, and the model sees the history of earlier drafts and critiques so that it does not repeat mistakes it has already identified.
The following table describes the three stages and what each prompt must contain.
| Stage | Input to the model | Expected output |
|---|---|---|
| Initial generation | Task instruction and examples | A first complete draft |
| Self-feedback | Task, draft and a critique prompt | Concrete, actionable criticism by dimension |
| Refinement | Task, draft history and feedback | A revised draft that addresses the feedback |
The quality of the loop depends mostly on the feedback prompt. Useful feedback is specific and actionable, for example naming the sentence that is too long or the function that recomputes a value, rather than a generic verdict such as “could be better”. Feedback that scores several named quality dimensions gives the refiner a clear target.
Stopping conditions and key parameters
A self-refine loop needs an explicit stopping rule, because a model asked to criticize will almost always find something to change. In practice, implementations combine a maximum iteration count with a signal from the feedback step.
| Parameter | Typical setting | Effect |
|---|---|---|
| Maximum iterations | 2 to 4 rounds | Caps cost and latency |
| Stop signal | Feedback states no further changes | Ends early when the draft is acceptable |
| Score threshold | For example 8 of 10 on every dimension | Makes the stop decision measurable |
| History length | All drafts or only the latest | Trades context cost against repetition control |
| Temperature | Low for feedback, moderate for drafts | Keeps critique consistent while allowing rewrites |
Gains are usually largest in the first one or two iterations and then flatten. Each round adds roughly two extra model calls, so a three-round loop costs several times as many tokens as a single answer, and the output can drift or degrade if the loop runs too long.
Self-refine compared with related techniques
Self-refine differs from neighboring techniques mainly in where the feedback comes from and whether the answer is rewritten. The table places it among related methods from the same area of prompting.
| Technique | Source of feedback | What changes |
|---|---|---|
| Self-refine | The same model, in natural language | One answer is rewritten repeatedly |
| Self-consistency | No feedback, majority vote | Several answers are sampled and compared |
| Chain-of-verification | Model answers its own check questions | Factual claims are verified and corrected |
| Reflexion | External signal such as test results | A reflection is stored for the next attempt |
| Iterative prompting | A human user | The user edits the prompt between turns |
The most important distinction is between intrinsic and grounded feedback. Self-refine in its pure form is intrinsic: the model judges itself with no outside evidence. Methods that add compiler output, unit tests, search results or a separate judge model tend to be more reliable on tasks where correctness, rather than style, is the goal.
Where self-refine works and where it fails
Self-refine is most effective when the model can recognize a better answer more easily than it can produce one. This asymmetry exists for many writing and formatting tasks, but not for multi-step reasoning, where a model that made an error often cannot detect the same error on review.
| Task type | Expected benefit | Reason |
|---|---|---|
| Rewriting and tone adjustment | High | Style flaws are easy to name and fix |
| Constrained generation | High | Missing constraints can be checked one by one |
| Code readability and efficiency | Moderate to high | Feedback can point to specific lines |
| Arithmetic and logic problems | Low or negative | The model rarely finds its own reasoning error |
| Factual questions | Low without retrieval | Self-review cannot supply missing knowledge |
Later studies reported that intrinsic self-correction can lower accuracy on reasoning benchmarks, because the model sometimes changes a correct answer into an incorrect one. The safe conclusion is that self-refine improves quality judged by clear criteria, but should not be relied on to fix correctness without an external check.
Designing effective self-refine prompts
Well-designed self-refine prompts separate the critic from the writer and give the critic a fixed rubric. The following practices reduce wasted iterations and drift.
- Define three to five named criteria in the feedback prompt, such as accuracy, concision and adherence to format.
- Ask the critic to quote the problematic passage and propose a concrete fix for each issue.
- Instruct the refiner to change only what the feedback names, which prevents unrelated rewrites.
- Use a structured output format, for example JSON with scores, so code can read the stop signal.
- Log every draft and critique, because the history is essential for debugging and prompt evaluation.
The short version
Self-refine asks an AI model to check and improve its own work. The model writes a first draft, then reads it like an editor and lists what is wrong, then writes a better version based on that list. The cycle can repeat a few times.
It is similar to a student who drafts an essay, rereads it with a red pen and rewrites it. The method helps most with clarity, tone and following instructions. It helps much less when the first answer is wrong because of a reasoning mistake, since the same mind that made the error often misses it on review.
Where it makes a difference
A software company generates release notes from lists of merged changes. A single prompt often produced notes that were too technical, exceeded the 150-word limit for the product dashboard, or forgot to mention breaking changes. The team added a self-refine loop with a maximum of three rounds: the critic scores each draft from 1 to 10 on audience fit, length and completeness of breaking changes, and the loop stops when every score reaches 8.
In internal review over two months, editors reported that most drafts stopped after one revision and needed noticeably fewer manual corrections than before. Token costs rose by about 2.5 times per note, which the team accepted because each note is short. For the separate task of computing version numbers, however, the team kept a deterministic script, since self-review did not reliably catch numbering errors.