Reproduce “Automatic Prompt Optimization with "Gradient Descent" and Beam Search” 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

Reid Pryzant, Dan Iter, Jerry Li, Yin Tat Lee, Chenguang Zhu, Michael Zeng

ProTeGi introduces a non-parametric method for automatically optimizing natural language prompts for black-box Large Language Models, simulating gradient descent with "textual gradients" and employing a bandit-guided beam search. The framework consistently improves LLM task performance, achieving up to a 31% gain over initial prompts and outperforming other automatic prompt learning baselines.

Key insights

  • It is possible to mirror numerical gradient descent in a natural language Socratic dialogue to perform semantically directed optimization in discrete prompt spaces.
  • Leveraging black-box Large Language Model (LLM) APIs for both error critique and prompt editing enables practical automatic prompt optimization without requiring internal model access.
  • Combining textual gradient-based prompt generation with bandit-guided beam search offers an efficient and interpretable way to explore and optimize natural language prompts.

Summary by alphaXiv.

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