Problem
First drafts are rarely perfect. You want the LLM to generate content, critically evaluate it, and produce an improved version based on feedback.Solution
The self-refinement loop uses a three-stage process:- Generate: Create an initial draft
- Critique: Analyze weaknesses and areas for improvement
- Improve: Produce a refined version incorporating the feedback
Example
Refine a cover letter:How It Works
wrk ... | xargs flwsubmits a job and immediately waits for the result- Each stage uses the previous output as context
- The critique stage provides specific, actionable feedback
- The improvement stage has both the original and the critique
Variations
Multiple iterations:Use Cases
- Writing: Essays, documentation, cover letters
- Code review: Generate code, critique, refactor
- Design: Create designs, evaluate, iterate
- Strategy: Draft plans, identify gaps, revise