Prompt Optimization via Adversarial In-Context Learning

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Do, Xuan Long, Zhao, Yiran, Brown, Hannah, Xie, Yuxi, Zhao, James Xu, Chen, Nancy F., Kawaguchi, Kenji, Shieh, Michael, He, Junxian
Format: Preprint
Veröffentlicht: 2023
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866916296743976960
author Do, Xuan Long
Zhao, Yiran
Brown, Hannah
Xie, Yuxi
Zhao, James Xu
Chen, Nancy F.
Kawaguchi, Kenji
Shieh, Michael
He, Junxian
author_facet Do, Xuan Long
Zhao, Yiran
Brown, Hannah
Xie, Yuxi
Zhao, James Xu
Chen, Nancy F.
Kawaguchi, Kenji
Shieh, Michael
He, Junxian
contents We propose a new method, Adversarial In-Context Learning (adv-ICL), to optimize prompt for in-context learning (ICL) by employing one LLM as a generator, another as a discriminator, and a third as a prompt modifier. As in traditional adversarial learning, adv-ICL is implemented as a two-player game between the generator and discriminator, where the generator tries to generate realistic enough output to fool the discriminator. In each round, given an input prefixed by task instructions and several exemplars, the generator produces an output. The discriminator is then tasked with classifying the generator input-output pair as model-generated or real data. Based on the discriminator loss, the prompt modifier proposes possible edits to the generator and discriminator prompts, and the edits that most improve the adversarial loss are selected. We show that adv-ICL results in significant improvements over state-of-the-art prompt optimization techniques for both open and closed-source models on 11 generation and classification tasks including summarization, arithmetic reasoning, machine translation, data-to-text generation, and the MMLU and big-bench hard benchmarks. In addition, because our method uses pre-trained models and updates only prompts rather than model parameters, it is computationally efficient, easy to extend to any LLM and task, and effective in low-resource settings.
format Preprint
id arxiv_https___arxiv_org_abs_2312_02614
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle Prompt Optimization via Adversarial In-Context Learning
Do, Xuan Long
Zhao, Yiran
Brown, Hannah
Xie, Yuxi
Zhao, James Xu
Chen, Nancy F.
Kawaguchi, Kenji
Shieh, Michael
He, Junxian
Machine Learning
Computation and Language
We propose a new method, Adversarial In-Context Learning (adv-ICL), to optimize prompt for in-context learning (ICL) by employing one LLM as a generator, another as a discriminator, and a third as a prompt modifier. As in traditional adversarial learning, adv-ICL is implemented as a two-player game between the generator and discriminator, where the generator tries to generate realistic enough output to fool the discriminator. In each round, given an input prefixed by task instructions and several exemplars, the generator produces an output. The discriminator is then tasked with classifying the generator input-output pair as model-generated or real data. Based on the discriminator loss, the prompt modifier proposes possible edits to the generator and discriminator prompts, and the edits that most improve the adversarial loss are selected. We show that adv-ICL results in significant improvements over state-of-the-art prompt optimization techniques for both open and closed-source models on 11 generation and classification tasks including summarization, arithmetic reasoning, machine translation, data-to-text generation, and the MMLU and big-bench hard benchmarks. In addition, because our method uses pre-trained models and updates only prompts rather than model parameters, it is computationally efficient, easy to extend to any LLM and task, and effective in low-resource settings.
title Prompt Optimization via Adversarial In-Context Learning
topic Machine Learning
Computation and Language
url https://arxiv.org/abs/2312.02614