Passer au contenu

Bitcoin accepté au paiement  |  Expédié depuis Laval, QC, Canada  |  Soutien expert depuis 2016

Self-Refine (Iterative Refinement)

Sovereign AI

Definition

Self-Refine is a prompting strategy in which one language model generates an answer, then provides written feedback on that answer, then rewrites it using the feedback, repeating until a stopping condition is met. The same model fills all three roles: generator, critic, and reviser. It requires no supervised data, no reinforcement learning, and no separate reward model, which is why it is one of the simplest ways to raise output quality on a self-hosted stack. It was introduced by Madaan et al. and presented at NeurIPS 2023.

The generate-feedback-refine loop

The first pass produces a draft. The model is then prompted to act as a critic and list specific, actionable problems with that draft — for example "the function ignores empty input" rather than a vague "could be better." A third prompt feeds both the draft and the critique back in and asks for a corrected version. Iterations continue for a fixed number of rounds or until the critic reports no further issues. Across tasks such as code generation, math, and dialogue, the authors reported roughly a 20 percent average improvement over single-shot generation. The quality of the critique prompt is the load-bearing element: feedback that names concrete defects drives real revision, while generic praise-and-polish prompts mostly produce cosmetic rewording.

Strengths and honest limits

Self-Refine shines where the model can reliably spot its own mistakes — typically when errors are concrete and checkable from the text alone: logic slips, unmet formatting requirements, missing edge cases, inconsistent terminology. It is weaker on factual gaps the model cannot detect, since a model that does not know a fact also cannot critique its absence; left looping on such tasks it may revise confidently in the wrong direction, and follow-up research on self-correction has found that models often cannot fix reasoning errors purely by re-reading themselves. The craftsman's response is to give the critic something external to check against: run the code and feed back the failing test, or ground the critique pass in retrieved documents via RAG. External signal turns self-refinement from introspection into verification.

Running it on your own hardware

Self-Refine is particularly attractive for sovereign AI setups because it converts idle compute into quality, with no API bill and no data leaving the machine. On a local stack served by Ollama or llama.cpp, each refinement round is simply another inference call, so a modest model given three passes can rival a larger model's single shot on tasks where self-critique works. Two practical cautions: keep the full draft-plus-critique history within the model's context window, or summarize between rounds; and cap iterations — returns diminish quickly, and most published gains arrive in the first two or three rounds.

Relatives in the test-time toolbox

A worked example makes the pattern concrete. Ask a local model for a shell script; then prompt: "Review the script above as a strict code reviewer — list every bug, unhandled edge case, and unsafe assumption as bullet points." Feed the list back with "Rewrite the script fixing every listed issue." Two rounds of that loop routinely turn a sloppy first draft into something you would actually run — and the whole exchange never left your machine.

Self-Refine differs from Reflexion in that refinement happens within a single task attempt rather than as verbal lessons carried across separate trials. Both belong to the broader family of test-time compute techniques, which spend extra inference to buy accuracy instead of training a better model. For a home lab, that family is the highest-leverage shelf in the toolbox: the hardware is already paid for, and the electricity is cheaper than the mistake.

In Simple Terms

Self-Refine is a prompting strategy in which one language model generates an answer, then provides written feedback on that answer, then rewrites it using the…

Explore the Full Glossary

Browse all Bitcoin mining terms from A to Z. Whether you are a beginner or expert, deepen your understanding of the mining ecosystem.

Glossaire du minage

ASIC Miner Database

Compare 500+ miners with real-time profitability data, home mining scores, and detailed specs.

Comparer les mineurs