Skip to main content
QUICK REVIEW

[Paper Review] GFlowPO: Generative Flow Network as a Language Model Prompt Optimizer

Junmo Cho, Suhan Kim|arXiv (Cornell University)|Feb 3, 2026
Topic ModelingComputer Science0 citations
TL;DR

GFlowPO formulates prompt optimization as posterior inference and uses off-policy GFlowNet training plus a dynamic memory update to efficiently discover high-reward prompts for various LMs and tasks.

ABSTRACT

Finding effective prompts for language models (LMs) is critical yet notoriously difficult: the prompt space is combinatorially large, rewards are sparse due to expensive target-LM evaluation. Yet, existing RL-based prompt optimizers often rely on on-policy updates and a meta-prompt sampled from a fixed distribution, leading to poor sample efficiency. We propose GFlowPO, a probabilistic prompt optimization framework that casts prompt search as a posterior inference problem over latent prompts regularized by a meta-prompted reference-LM prior. In the first step, we fine-tune a lightweight prompt-LM with an off-policy Generative Flow Network (GFlowNet) objective, using a replay-based training policy that reuses past prompt evaluations to enable sample-efficient exploration. In the second step, we introduce Dynamic Memory Update (DMU), a training-free mechanism that updates the meta-prompt by injecting both (i) diverse prompts from a replay buffer and (ii) top-performing prompts from a small priority queue, thereby progressively concentrating the search process on high-reward regions. Across few-shot text classification, instruction induction benchmarks, and question answering tasks, GFlowPO consistently outperforms recent discrete prompt optimization baselines.

Motivation & Objective

  • Motivate automatic prompt optimization due to combinatorial prompt space and sparse rewards.
  • Formulate prompt search as posterior inference regularized by a meta-prompt prior.
  • Develop a sample-efficient off-policy GFlowNet training regime for prompting.
  • Introduce Dynamic Memory Update (DMU) to adaptively concentrate search on high-reward regions.
  • Demonstrate robustness across diverse tasks and LM pairs.

Proposed method

  • Define a posterior over prompts p(z|D,M) proportional to p(D|z) p_ref(z|M).
  • Fine-tune a lightweight prompt-LM with an off-policy GFlowNet objective using a replay-based policy.
  • Use VarGrad-based global path consistency loss for GFlowNet training with replay buffer sampling.
  • Replace likelihood with training accuracy A_D(z) to better correlate with test performance.
  • Update the meta-prompt M via Dynamic Memory Update by mixing prompts from a replay buffer and a small high-reward buffer.
  • Evaluate across text classification, instruction induction, and question answering with multiple prompt-LM/target-LM pairs.
Figure 1 : Concepts. Blue contour indicates high performing prompt regions. (a) Existing on-policy RL frameworks fail to explore the huge combinatorial search space with poor sample efficiency. (b) Our GFlowPO that can sample efficiently explore the search space by gradually annealing the posterior
Figure 1 : Concepts. Blue contour indicates high performing prompt regions. (a) Existing on-policy RL frameworks fail to explore the huge combinatorial search space with poor sample efficiency. (b) Our GFlowPO that can sample efficiently explore the search space by gradually annealing the posterior

Experimental results

Research questions

  • RQ1Can prompt search be effectively cast as posterior inference over prompts with a meta-prompt prior?
  • RQ2Does off-policy GFlowNet training improve sample efficiency in discovering high-reward prompts compared to on-policy RL methods?
  • RQ3Does a training-free Dynamic Memory Update (DMU) effectively focus search on high-reward regions over iterations?
  • RQ4How does GFlowPO perform across diverse tasks and LM pairings in few-shot and instruction induction settings?

Key findings

  • GFlowPO achieves highest average accuracy across six few-shot text classification datasets in the reportedTABLE 1 comparison.
  • GFlowPO outperforms baselines on SST-2, RTE, and SNLI, and is competitive or best on QNLI and SNLI across task/LM pairs.
  • Across Instruction Induction and BBII tasks, GFlowPO consistently outperforms baselines in average accuracy, including text generation tasks requiring exact token matches.
  • In QA tasks (MMLU and OpenBookQA), GFlowPO achieves the best OpenBookQA score and competitive MMLU results.
  • Ablation shows both off-policy training and DMU contribute additively, with DMU delivering substantial gains when combined with off-policy learning.
  • Training accuracy curves indicate GFlowPO discovers higher-reward prompts more efficiently than StablePrompt.
Figure 2 : GFlowPO pipeline. The optimizer prompt-LM samples prompts conditioned on meta-prompt $M$ , the target LLM provides rewards, and off-policy GFlowNet training plus Dynamic Memory Update (DMU) iteratively improves exploration and prompt quality.
Figure 2 : GFlowPO pipeline. The optimizer prompt-LM samples prompts conditioned on meta-prompt $M$ , the target LLM provides rewards, and off-policy GFlowNet training plus Dynamic Memory Update (DMU) iteratively improves exploration and prompt quality.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.