# Self-Refine: Iterative Refinement with Self-Feedback

Self-Refine lets one LLM critique and improve its own outputs

Aman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan, Luyu Gao, Sarah Wiegreffe and 10 more · arXiv · 2023-3-30

- **Problem** Single-pass LLM outputs often miss quality goals that are hard to define. Fixing this usually requires a refiner model trained on domain-specific data and costly annotations.
- **Method** Self-Refine has one LLM write a first draft, write feedback on it, and rewrite it in a loop. Unlike trained refiners, it needs no supervised data or extra training.
- **Results** Across seven tasks, Self-Refine outputs were preferred by humans and automatic metrics over one-pass outputs. On Code Optimization, GPT-4 optimized 36.0% of programs, up from 27.3%.

## Where single-pass outputs fall short

Large language models can produce a readable first draft and still miss what a task demands. The gap is widest when a task has several goals at once, such as a dialogue reply that must be engaging and show user understanding, or code that must be readable.

The usual fix is a refinement model trained on domain-specific data, and such models need large training sets or costly human annotations. That cost is the reason the authors look for a refinement method that works across tasks without extensive supervision.

## One model as writer, critic and editor

The key idea is to let one model play three roles: it writes the first draft, writes feedback on that draft, and rewrites the draft using the feedback. No second model, reward model or training step is involved.

The loop starts with an initial output y0, produced from the input x and a generation prompt. A FEEDBACK step then reads x and the current output and writes feedback, and a REFINE step rewrites the output from the input, the earlier outputs and the feedback.

The feedback is meant to be actionable and specific. Actionable means it names a concrete change, and specific means it points to the phrases in the output that should change. For example, the code case flags a brute-force loop and suggests a closed-form formula instead.

Every prompt is a few-shot prompt, even for models that follow instructions well, so the authors keep the comparison consistent across models. The loop stops when the stop condition is met or after at most 4 iterations, and the last refinement is returned as the output.

## Gains across tasks and base models

The authors ran the loop on seven tasks with GPT-3.5, ChatGPT and GPT-4, and compared each refined output with the same model's single-pass output. The largest preference gain is on Dialogue Response Generation, where GPT-4's preference rate rose from 25.4% to 74.6%.

Code Optimization shows a smaller gain. GPT-4 with SELF-REFINE optimized 36.0% of programs, up from 27.3%, an 8.7 point absolute gain over base GPT-4.

Math Reasoning is the exception, since the solve rate barely moved, from 92.9 to 93.1 for GPT-4. The authors attribute this to the difficulty of spotting an error inside a consistent-looking reasoning chain, and ChatGPT's feedback said 'everything looks good' in 94% of instances.

Oracle feedback changes that picture. When refinement runs only if the current answer is wrong, GPT-3.5 rises from 64.06 to 68.9 on Math Reasoning, and GPT-4 gains 0.7 points. That setup uses an external correctness signal, so it measures a different situation from self-feedback alone.

Statistical support is uneven across models. Nearly all GPT-4 gains are significant, while ChatGPT gains are significant on 4 of 7 datasets and GPT-3.5 gains on 3 of 7.

## Feedback specificity and the number of iterations

The authors swap the specific feedback for a vague goal, such as making the code more efficient, and also remove feedback altogether. On Code Optimization with ChatGPT, specific feedback gave 27.5, generic feedback 26.0 and no feedback 24.8.

The effect is larger on Sentiment Reversal. Its score falls from 43.2 with specific feedback to 31.2 with generic feedback, and the score is 0 without feedback.

Iterations also matter. Averaged over the three models, Code Optimization rises from 22.0 at the initial output to 28.8 after three iterations. The gains are largest in the first iterations and flatten later, so each extra round adds less.

Scores do not always rise, because Acronym Generation can gain on one aspect while losing on another. The total score moved 11, 17, 12 and 17 across four iterations, so the method keeps the highest-scoring output across iterations.

## Refinement versus simply drawing more samples

A reader might ask whether the gain comes from refinement or just from generating more drafts. The authors compare SELF-REFINE with ChatGPT drawing k = 4 samples without feedback, in a 1 vs. k evaluation on Acronym Generation.

Human raters still preferred the SELF-REFINE output over all four initial samples. The authors read this as evidence that feedback-guided refinement adds something that extra candidates do not.

## Limitations

The method depends on the base model having enough few-shot or instruction-following ability to critique and rewrite in context. The authors note that without that ability the approach would need supervised training, which it avoids.

All experiments use closed models, namely GPT-3.5, ChatGPT, GPT-4 and CODEX. Their pretraining corpus, model sizes and biases are not fully described, and using them for research requires funding.

All datasets are in English, so the gains in other languages are untested. The approach gives no explicit guard against prompts that steer a model toward toxic or harmful text.

## Paper info

- **Authors**: Aman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan, Luyu Gao, Sarah Wiegreffe, Uri Alon, Nouha Dziri, Shrimai Prabhumoye, Yiming Yang, Shashank Gupta, Bodhisattwa Prasad Majumder, Katherine Hermann, Sean Welleck, Amir Yazdanbakhsh, Peter Clark
- **Venue**: arXiv · Preprint
- **First published**: 2023-3-30
- **Added**: 2026-11-12
- **Updated**: 2023-5-25
- **Version**: v2
- **arXiv**: 2303.17651
- **Category**: cs.CL · cs.AI · cs.LG
- **Original paper terms**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/2303.17651v2) · [PDF ↗](https://arxiv.org/pdf/2303.17651v2)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Aman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan, Luyu Gao, Sarah Wiegreffe, Uri Alon, Nouha Dziri, Shrimai Prabhumoye, Yiming Yang, Shashank Gupta, Bodhisattwa Prasad Majumder, Katherine Hermann, Sean Welleck, Amir Yazdanbakhsh, Peter Clark (2023). Self-Refine: Iterative Refinement with Self-Feedback. arXiv:2303.17651v2. https://arxiv.org/abs/2303.17651v2

**BibTeX**

```
@misc{madaan2023self,
  title = {{Self-Refine: Iterative Refinement with Self-Feedback}},
  author = {Aman Madaan and Niket Tandon and Prakhar Gupta and Skyler Hallinan and Luyu Gao and Sarah Wiegreffe and Uri Alon and Nouha Dziri and Shrimai Prabhumoye and Yiming Yang and Shashank Gupta and Bodhisattwa Prasad Majumder and Katherine Hermann and Sean Welleck and Amir Yazdanbakhsh and Peter Clark},
  year = {2023},
  eprint = {2303.17651},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2303.17651v2}
}
```

## Other paper commentary

- [Qwen2.5-Coder Technical Report](https://refivu.com/en/papers/8282ea88-f013-4a5f-832a-687a740c2ff3-qwen2-5-coder-technical-report.md)
- [Language Models (Mostly) Know What They Know](https://refivu.com/en/papers/ffe245df-5662-4bfb-8c0b-899a38b87412-language-models-mostly-know-what-they-know.md)
- [Fine-Tuning Language Models from Human Preferences](https://refivu.com/en/papers/34e4ce82-039f-4763-a09e-5d0786987b71-fine-tuning-language-models-from-human-preferences.md)
- [Don't Stop Pretraining: Adapt Language Models to Domains and Tasks](https://refivu.com/en/papers/0864e409-68d0-4d61-98fd-5ab02360285a-don-t-stop-pretraining-adapt-language-models-to.md)
- [A Comprehensive Overview of Large Language Models](https://refivu.com/en/papers/4e2425c0-8669-49f7-80be-dd35ce0a70b2-a-comprehensive-overview-of-large-language-models.md)
- [The Curious Case of Neural Text Degeneration](https://refivu.com/en/papers/71a193c3-9d38-4eb3-b0de-39d943c746b0-the-curious-case-of-neural-text-degeneration.md)
- [LIO-SAM: Tightly-coupled Lidar Inertial Odometry via Smoothing and Mapping](https://refivu.com/en/papers/8fa3265c-e57e-4469-8761-2a9bfc47279e-lio-sam-tightly-coupled-lidar-inertial-odometry-via.md)
- [Soft-NMS -- Improving Object Detection With One Line of Code](https://refivu.com/en/papers/d6a13a67-cb33-4ee3-8420-05da2f2b5960-soft-nms-improving-object-detection-with-one-line.md)
- [Identifying the Best Machine Learning Algorithms for Brain Tumor Segmentation, Progression Assessment, and Overall Survival Prediction in the BRATS Challenge](https://refivu.com/en/papers/a75a6487-afcf-4dd0-8b85-09a24d21da45-identifying-the-best-machine-learning-algorithms-for-brain.md)
- [SeqGAN: Sequence Generative Adversarial Nets with Policy Gradient](https://refivu.com/en/papers/29153239-a1df-4102-9df1-abd1ba2a9c96-seqgan-sequence-generative-adversarial-nets-with-policy.md)
- [Deep Learning for Person Re-identification: A Survey and Outlook](https://refivu.com/en/papers/d4bdc05a-ddac-43ad-93f5-95986e1858a4-deep-learning-for-person-re-identification-a-survey.md)
- [Generating Sentences from a Continuous Space](https://refivu.com/en/papers/921b1922-5f2e-49a8-80cd-9df917da7fe7-generating-sentences-from-a-continuous-space.md)

## Terms in this paper

- [GPT-4](https://refivu.com/en/terms/1e2d0d2cdc44-gpt-4)
- [ChatGPT](https://refivu.com/en/terms/96047648490a-chatgpt)
- [Codex](https://refivu.com/en/terms/1afc2735b086-codex)
- [few-shot prompting](https://refivu.com/en/terms/92ad53fb3cd1-few-shot-prompting)
- [GPT-3.5](https://refivu.com/en/terms/30414fb33dba-gpt-3-5)
- [solve rate](https://refivu.com/en/terms/e910f14dced7-solve-rate)
- [FEEDBACK](https://refivu.com/en/terms/ebed427516c0-feedback)
- [math reasoning](https://refivu.com/en/terms/87ac59ae703d-math-reasoning)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/f8f8d11b-268b-4988-84b8-c616a701e2ba-self-refine-iterative-refinement-with-self-feedback)
