MultiPrompter: Cooperative Prompt Optimization with Multi-Agent Reinforcement Learning

Dong-Ki Kim, Sungryull Sohn, Lajanugen Logeswaran, Dongsub Shim, Honglak LeearXiv 2023 · DOI

Introduction: The Complexity of Prompting

Prompting is the primary interface for foundation models, yet finding the optimal prompt remains a significant challenge. While Reinforcement Learning (RL) offers a path toward automation, it frequently falls victim to the curse of dimensionality. In a standard text-to-image task, the search space—defined by every possible combination of words in a vocabulary—is astronomically large. For a single RL agent attempting to generate a sequence of 70+ tokens, the task is akin to finding a needle in a galaxy-sized haystack, often resulting in suboptimal convergence where the model settles for "good enough" rather than truly high-quality outputs.

MultiPrompter: A Cooperative Framework

To address this, the authors propose MultiPrompter, a framework that reframes prompt optimization as a cooperative multi-agent game. Instead of a single agent bearing the entire burden of generation, the task is decomposed into sequential sub-tasks handled by $n$ agents.

MultiPrompter vs. Single-Agent RL: Multiple agents sequentially optimize a prompt, leading to higher quality image generation.

The core innovation lies in Problem Size Reduction. By splitting a prompt of length $L$ among multiple agents, the exponential complexity of the search space $|V|^L$ is reduced to a sum of significantly smaller spaces $\sum |V|^{L_i}$. This makes the optimization problem far more tractable.

Key Methodological Components:

  1. Sequential Turn-Taking: Agents take turns adding tokens to the prompt, effectively "passing the baton" until the sequence is complete.
  2. Centralized Critic: During training, a centralized critic evaluates the collective trajectory. This ensures that early agents make choices that facilitate the success of subsequent agents, rather than acting greedily.
  3. Cooperation Reward: An entropy-based reward mechanism encourages a balanced distribution of work across the team, preventing a single agent from dominating the generation process.

Experimental Evaluation

The researchers evaluated MultiPrompter on text-to-image generation tasks using the COCO Dataset for initial prompts and Stable Diffusion as the generative backbone. Performance was compared against human-engineered "manual" prompts from Lexica and the single-agent RL baseline, Promptist.

The "Sweet Spot" for Team Size

A critical finding of the study is the relationship between the number of agents and performance. As shown in the figure below, performance improves as agents are added, but reaches a point of diminishing returns.

Test reward as a function of the number of prompters, showing a peak performance at $n=3$.

In these experiments, $n=3$ was identified as the optimal team size. Beyond this point, the increased complexity of coordinating between many agents begins to outweigh the benefits of the reduced search space per agent.

Results and Insights

MultiPrompter demonstrated superior performance across both quantitative and qualitative metrics:

  • Quantitative Success: MultiPrompter achieved a test reward of 0.76, significantly outperforming the single-agent baseline (0.28) and even surpassing high-quality manual prompts (0.68).
  • Prompt Characteristics: The cooperative approach naturally led to longer, more descriptive prompts (averaging ~69 tokens) compared to single-agent outputs (~57 tokens).
  • Interpretability: Unlike "soft prompting" methods that operate in latent vector spaces, MultiPrompter generates discrete text. This allows users to observe the optimization process as agents add modifiers like "8k resolution," "cinematic lighting," or "hyperrealistic" to refine the final image.

Conclusion and Future Directions

MultiPrompter proves that decomposing the prompt optimization task into a cooperative multi-agent problem effectively bypasses the limitations of single-agent RL. While the current implementation relies on specific reward functions like CLIP, future work could explore more robust Multi-Agent RL (MARL) algorithms to handle even larger teams or more complex domains, such as multi-step reasoning and code generation. By leveraging "teamwork," MultiPrompter sets a new standard for automated prompt engineering.

Summary updated

BibTeX
@misc{kim2023multiprompter,
  author = {Dong-Ki Kim and Sungryull Sohn and Lajanugen Logeswaran and Dongsub Shim and Honglak Lee},
  title = {{MultiPrompter: Cooperative Prompt Optimization with Multi-Agent Reinforcement Learning}},
  year = {2023},
  eprint = {2310.16730},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.16730},
}
Figure