NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Self-Refine: Iterative Refinement with Self-Feedback

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

TL;DR

Large language models (LLMs) often produce suboptimal outputs on their first try. This paper introduces Self-Refine, a novel approach that enables LLMs to iteratively improve their own outputs by generating feedback and then refining based on that feedback. This method significantly boosts performance across various tasks without requiring additional training data or specialized models.

What Problem Does This Paper Address?

Even the most advanced LLMs, like GPT-4, can struggle to generate perfect outputs on the first attempt, especially for complex tasks requiring nuanced understanding, creativity, or precise reasoning. Traditional methods for improving LLM outputs often involve extensive supervised training data, reinforcement learning, or domain-specific models, which can be costly and time-consuming. This paper addresses the need for a more accessible and generalizable method to enhance LLM performance by leveraging the model's own capabilities for self-improvement.

Methods

The core of Self-Refine is an iterative process involving three key steps, all performed by the same LLM:

  1. Generate Initial Output: The LLM produces an initial response to a given input.
  2. Generate Feedback: The LLM then analyzes its own initial output and generates specific, actionable feedback on how to improve it. This feedback is designed to be "pin-pointed," identifying specific issues and suggesting concrete improvements.
  3. Refine Output: Using the generated feedback, the LLM refines its previous output to create a better version.

This FEEDBACK-REFINE loop can be repeated multiple times (up to 4 iterations in their experiments) until a stopping condition is met. The entire process is guided by few-shot prompts, meaning the LLM learns how to generate feedback and refine outputs by observing a few examples, rather than requiring explicit training.

Datasets

The authors evaluated Self-Refine across seven diverse tasks, utilizing existing datasets:

  • Dialogue Response Generation: FED dataset
  • Code Optimization: A dataset of 1000 programs (Madaan et al., 2023)
  • Code Readability Improvement: A dataset of 300 programs (Puri et al., 2021)
  • Math Reasoning: GSM-8k dataset (Cobbe et al., 2021)
  • Sentiment Reversal: A dataset of 1000 review passages (Zhang et al., 2015)
  • Acronym Generation: A newly curated dataset of 250 acronyms.
  • Constrained Generation: A newly introduced, more challenging variant of the CommonGen dataset ("CommonGen-Hard") requiring sentences to incorporate 20-30 concepts.

Key Insights and Ideas

  • LLMs as Self-Improvers: The most striking insight is that LLMs can effectively critique and improve their own outputs without external supervision or specialized training. This suggests a powerful emergent capability for self-correction.
  • The Power of Specific Feedback: The paper strongly emphasizes that actionable and specific feedback is crucial. Generic feedback leads to significantly worse results than detailed, targeted critiques. This mirrors human learning processes where constructive criticism is more effective.
  • Iterative Refinement Pays Off: The iterative nature of Self-Refine consistently leads to better outputs. Even state-of-the-art models like GPT-4 benefit from multiple rounds of feedback and refinement.
  • Simplicity and Generality: The Self-Refine framework is remarkably simple, requiring only a single LLM and carefully crafted prompts. Its effectiveness across diverse tasks (dialogue, code, math, text generation) highlights its generalizability.

Key Results

Self-Refine consistently outperformed direct generation from the same LLMs across all evaluated tasks.

  • Human Preference: Outputs generated with Self-Refine were preferred by humans and automatic metrics, showing an average improvement of ~20% absolute in task performance.
  • Specific Task Improvements:
    • Dialogue Response Generation: GPT-4 + Self-Refine showed a 49.2% preference gain over base GPT-4.
  • Sentiment Reversal: GPT-4 + Self-Refine showed an 8.7% absolute improvement in Code Optimization.
  • Math Reasoning: Self-Refine improved the solve rate from 22.1% to 59.0% in an instruction-only setting.
  • Model Agnostic: The approach showed significant gains when applied to GPT-3.5, ChatGPT, GPT-4, and even CODEX.

Limitations and Future Work

  • LLM Capability Dependency: The effectiveness of Self-Refine relies on the base LLM's ability to generate good feedback and perform refinement. Weaker models (like Vicuna-13B) struggled with the process.
  • Prompt Engineering: While effective, achieving optimal performance in instruction-only settings requires extensive prompt engineering.
  • Language Specificity: The current experiments are primarily in English. Applicability to other languages is not explored.
  • Potential for Misuse: Like any powerful LLM technique, there's a risk of misuse for generating harmful content.
  • Future Work: The authors suggest exploring the refiner's robustness to feedback errors, applying Self-Refine to more complex and creative tasks (like website generation), and investigating its use in simulated environments. They also highlight the potential for mixed-refinement approaches, where a smaller model initializes and a larger one refines.

Summary updated

BibTeX
@inproceedings{madaan2023self,
  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},
  title = {{Self-Refine: Iterative Refinement with Self-Feedback}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=43rnkOcpI1},
}
Figure