Reproduce “Fine-Tuning and Prompt Optimization: Two Great Steps that Work Better Together” on OpenResearch

Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Dilara Soylu, Christopher Potts, Omar Khattab

This Stanford University research presents a method for jointly optimizing both prompt templates and language model weights within modular LM pipelines. The 'BetterTogether' algorithm, integrated into the DSPy framework, achieves performance gains of up to 60% over weight-only methods and 6% over prompt-only methods by alternating these two optimization steps and bootstrapping data from successful program executions.

Key insights

  • Prompt optimization and weight fine-tuning are highly complementary strategies for improving LM program performance when applied in an alternating fashion.
  • LMs can effectively 'teach themselves' by bootstrapping high-quality module-level training data from successful end-to-end program runs, reducing reliance on manual intermediate labels.
  • A reasonably performing initial prompting strategy is often necessary to generate sufficient high-quality self-supervised data for effective fine-tuning, especially with small training sets.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.