Prompt Optimization via Adversarial In-Context Learning
Xuan Long Do, Yiran Zhao, Hannah Brown, Yuxi Xie, James Xu Zhao, Nancy, F. Chen, Kenji Kawaguchi, Michael Shieh, Junxian He

TL;DR
This paper introduces adv-ICL, an adversarial prompt optimization method using multiple LLMs to improve in-context learning performance across various tasks, with efficiency and broad applicability.
Contribution
Adv-ICL is a novel adversarial framework that optimizes prompts by employing multiple LLMs, significantly enhancing ICL performance without updating model weights.
Findings
Outperforms state-of-the-art prompt optimization methods on 11 tasks.
Effective across open and closed-source models.
Computationally efficient and suitable for low-resource settings.
Abstract
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…
Peer Reviews
Decision·Submitted to ICLR 2024
- Since there are no updates to the model parameters and only the prompts change, adv-ICL is computationally efficient and effective in low-resource settings. Moreover, adv-ICL only needs a few iterations and training samples in order to achieve high performance. - There is a thorough analysis of the quantitative and qualitative aspects of their method.
- Some more RL-based prompt optimization baselines (e.g., Mingkai Deng, Jianyu Wang, Cheng-Ping Hsieh, Yihan Wang, Han Guo, Tianmin Shu, Meng Song, Eric P. Xing, & Zhiting Hu. (2022). RLPrompt: Optimizing Discrete Text Prompts with Reinforcement Learning.) could be used in the evaluation section to provide more insight.
S1. The idea of applying generative adversarial networks to imporve in-context learning is plausible. S2. According to the experimental results shown by the authors, Adv-ICL outperforms the baselines in some settings.
W1. The convergence of the proposed approach. It seem that the prompts are modified by chance rather than gradient signals. This poses a serious concerns on the convergence and efficiency of the proposed approach. Yet the paper does not discuss this aspect in details. W2. Unconvencing Experiments: W2-a. Disregarded Prompts: During the iterative training process, when a new prompt is introduced to optimize the loss function, the model (either the generator or the discriminator) engages in in-co
1. The experimental results show clear improvements over the baselines. 2. Using adversarial optimization for prompt optimization is a novel idea. 3. The implementation and experimentation details are relatively adequate.
1. The novelty is limited: - The resampling method (as the prompt modifier) is already proposed in APE (Zhou et al., 2023). The prompt used to modify instructions in this work is very similar to the prompt used in APE but without proper citation. - For problems where the discriminator is trivial (e.g. for multiple-choice problems), the method is very similar to APE except that the demonstrations are also resampled. - The idea of adversarial optimization comes from GAN. 2. The present
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsMultimodal Machine Learning Applications · Domain Adaptation and Few-Shot Learning · Adversarial Robustness in Machine Learning
