self-refine  by madaan

Self-Refine: LLM research paper for iterative output refinement

created 2 years ago
719 stars

Top 48.8% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

This repository provides a framework for iterative self-refinement in Large Language Models (LLMs), enabling them to generate feedback on their own outputs and use that feedback to improve subsequent results. It's designed for researchers and developers exploring LLM capabilities in tasks requiring iterative improvement and self-correction.

How It Works

The core approach involves a generator LLM producing an initial output. This output is then critiqued by one or more "critic" LLMs, generating feedback. This feedback, along with the original output, is fed back to a "refiner" LLM, which produces an improved version. This cycle repeats until a stopping criterion is met, allowing for progressive enhancement of the output.

Quick Start & Requirements

  • Install prompt-lib by cloning the repository and running pip install prompt-lib/.
  • Set PYTHONPATH to include the cloned prompt-lib directory.
  • Tasks require specific data files (e.g., codenet-python-train.jsonl.zip for code readability).
  • Example commands are provided for various tasks like acronym generation, dialogue response generation, code readability, commonsense generation, GSM-8k, Yelp sentiment transfer, and PIE.

Highlighted Details

  • Demonstrates self-refinement across diverse tasks: acronym generation, dialogue response, code readability, commonsense generation, GSM-8k, Yelp sentiment transfer, and PIE.
  • Includes specific scripts for initializing, critiquing, and iterating on outputs for each task.
  • Offers evaluation scripts for tasks like GSM-8k to analyze generated feedback and refined outputs.
  • Visual examples and Colab notebooks for self-refine are available.

Maintenance & Community

The project is associated with authors from various institutions, as indicated by the citation. Further community or maintenance details are not explicitly provided in the README.

Licensing & Compatibility

The repository does not explicitly state a license. The citation lists the paper as arXiv:2303.17651. Users should verify licensing for commercial or closed-source use.

Limitations & Caveats

The setup requires manual cloning and configuration of prompt-lib and potentially setting PYTHONPATH. Some tasks require downloading or unzipping specific datasets before execution. The README does not specify the LLM models used or their API requirements.

Health Check
Last commit

10 months ago

Responsiveness

1+ week

Pull Requests (30d)
0
Issues (30d)
0
Star History
39 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.