Dspy Refine

Iterative self-improvement with dspy.Refine -- wraps any module, scores each attempt with a reward function, generates feedback on failures, and retries until a quality threshold is met. Use when you want outputs to improve through self-critique, need iterative revision of drafts, or want the LM to learn from its own mistakes within a single request. Also used for self-critique and revise, iterative improvement loop, generate then evaluate then fix, AI self-editing, multi-draft generation, revise until good enough, critique-driven refinement, when first draft is not good enough.

lebsral 5fe37c6 5 files · 23.9 KB Updated

File contents

lebsral/DSPy-Programming-not-prompting-LMs-skills/tree/main/skills/dspy-refine commit 5fe37c6da8

Frequently asked questions

npx skillmds@latest add lebsral/dspy-refine