AMPO: Automatic Multi-Branched Prompt Optimization
Sheng Yang, Yurong Wu, Yan Gao, Zineng Zhou, Bin Benjamin Zhu, Xiaodi Sun, Jian-Guang Lou, Zhiming Ding
Abstract
Prompt engineering is very important to enhance the performance of large language models (LLMs). When dealing with complex issues, prompt engineers tend to distill multiple patterns from examples and inject relevant solutions to optimize the prompts, achieving satisfying results. However, existing automatic prompt optimization techniques are only limited to producing single flow instructions, struggling with handling diverse patterns. In this paper, we present AMPO, an automatic prompt optimization method that can iteratively develop a multi-branched prompt using failure cases as feedback. Our goal is to explore a novel way of structuring prompts with multi-branches to better handle multiple patterns in complex tasks, for which we introduce three modules: Pattern Recognition, Branch Adjustment, and Branch Pruning. In experiments across five tasks, AMPO consistently achieves the best results. Additionally, our approach demonstrates significant optimization efficiency due to our adoption of a minimal search strategy.
BibTeX
@inproceedings{yang-etal-2024-ampo,
title = "{AMPO}: Automatic Multi-Branched Prompt Optimization",
author = "Yang, Sheng and
Wu, Yurong and
Gao, Yan and
Zhou, Zineng and
Zhu, Bin Benjamin and
Sun, Xiaodi and
Lou, Jian-Guang and
Ding, Zhiming and
Hu, Anbang and
Fang, Yuan and
Li, Yunsong and
Chen, Junyan and
Yang, Linjun",
editor = "Al-Onaizan, Yaser and
Bansal, Mohit and
Chen, Yun-Nung",
booktitle = "Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing",
month = nov,
year = "2024",
address = "Miami, Florida, USA",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2024.emnlp-main.1130/",
doi = "10.18653/v1/2024.emnlp-main.1130",
pages = "20267--20279"
}