Learning from Contrastive Prompts: Automated Optimization and Adaptation
Mingqi Li, Karan Aggarwal, Yong Xie, Aitzaz Ahmad, Stephen Lau

TL;DR
The paper introduces Learning from Contrastive Prompts (LCP), a framework that improves prompt optimization and adaptation for large language models using contrastive learning, outperforming existing methods and enhancing cross-model and language robustness.
Contribution
LCP is a novel contrastive learning framework that automates prompt optimization and adaptation, addressing limitations of previous methods that rely only on incorrect samples.
Findings
LCP achieves over 76% win rate in prompt optimization on Big-Bench Hard.
LCP demonstrates strong adaptability across different model versions, families, and languages.
LCP reduces manual effort in prompt engineering for diverse LLM deployment.
Abstract
As LLMs evolve, significant effort is spent on manually crafting prompts. While existing prompt optimization methods automate this process, they rely solely on learning from incorrect samples, leading to a sub-optimal performance. Additionally, an unexplored challenge in the literature is prompts effective for prior models may not perform well on newer versions or different languages. We propose the Learning from Contrastive Prompts (LCP) framework to address these gaps, enhancing both prompt optimization and adaptation. LCP employs contrastive learning to generate effective prompts by analyzing patterns in good and bad prompt examples. Our evaluation on the Big-Bench Hard dataset shows that LCP has a win rate of over 76% over existing methods in prompt optimization and demonstrates strong adaptability across different model versions, families, and languages. LCP offers a systematic…
Peer Reviews
Decision·Submitted to ICLR 2025
- Adaptation across models and languages. Adaptability is a valuable property these days. They show the adaptation ability across different models and languages on challenging benchmarks. - Experiments. They conducted the experiments on the Big-Bench Hard dataset, a recognized benchmark for difficult tasks. Their method achieves strong performance on this benchmark.
- Limited theoretical Insight: The proposed method is primarily an engineering technique, and the paper does not provide substantial theoretical insight or lessons, limiting its contribution to deeper understanding in prompt tuning.
LCP is a fairly straightforward and intuitive prompt optimization. Using both good and bad prompts for prompt optimization is a quite natural idea and the prompting involved is fairly minimal. Empirical verification and ablation are thorough and convincing. Overall, I think LCP could be a useful automatic prompt engineering technique. Admittedly, it is hard to keep up with the literature on prompt engineering nowadays, but I don't believe this exact variation of prompt optimization has been prop
- The paper introduces a new task, prompt adaptation which aims to adapt existing prompts for one model to another model or to a different language. While this task is fairly reasonable, it is not clear to me from reading the paper whether LCP accomplishes the goal. It seems like the performance could vary widely between ``Last`` and ``Best`` performance and also between different transfer settings (Table 2). In Table 3, it seems like query translation is a better approach for cross-language app
- The paper addresses an important problem of automatic prompt optimization, which could potentially alleviate a lot of human cost in engineering the prompts. - The method is reasonable and straightforward to implement (e.g., it only requires different prompt designs and thus can be applied to any LLM with ease), and draws inspirations from well-known techniques such as contrastive learning. - The cross-model and cross-lingual setups are important and under-studied to my knowledge -- this work,
1. Presentation: I think the paper could be significantly improved with a better presentation, especially the methodology section. The way the paper is currently written essentially assumes previous knowledge about works like AutoHint and OPRO. For example, the proposed LCP generates prompts in a similar to AutoHint by summarizing and learning the error cases, and LCP adopts a similar iterative optimization framework like OPRO which treats an optimizer LLM as a black box to generate new, better
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsMachine Learning and Data Classification
MethodsContrastive Learning
