Customizing Language Model Responses with Contrastive In-Context Learning (2401.17390v2)
Abstract: LLMs are becoming increasingly important for machine learning applications. However, it can be challenging to align LLMs with our intent, particularly when we want to generate content that is preferable over others or when we want the LLM to respond in a certain style or tone that is hard to describe. To address this challenge, we propose an approach that uses contrastive examples to better describe our intent. This involves providing positive examples that illustrate the true intent, along with negative examples that show what characteristics we want LLMs to avoid. The negative examples can be retrieved from labeled data, written by a human, or generated by the LLM itself. Before generating an answer, we ask the model to analyze the examples to teach itself what to avoid. This reasoning step provides the model with the appropriate articulation of the user's need and guides it towards generting a better answer. We tested our approach on both synthesized and real-world datasets, including StackExchange and Reddit, and found that it significantly improves performance compared to standard few-shot prompting
- Flamingo: a visual language model for few-shot learning. Advances in Neural Information Processing Systems, 35: 23716–23736.
- On the opportunities and risks of foundation models. arXiv preprint arXiv:2108.07258.
- Language models are few-shot learners. Advances in neural information processing systems, 33: 1877–1901.
- Making pre-trained language models better few-shot learners. arXiv preprint arXiv:2012.15723.
- Dialogue response ranking training with large-scale human feedback data. arXiv preprint arXiv:2009.06978.
- Instruction induction: From few examples to natural language task descriptions. arXiv preprint arXiv:2205.10782.
- Gpteval: Nlg evaluation using gpt-4 with better human alignment. arXiv preprint arXiv:2303.16634.
- Coco-lm: Correcting and contrasting text sequences for language model pretraining. Advances in Neural Information Processing Systems, 34: 23102–23114.
- Learning transferable visual models from natural language supervision. In International conference on machine learning, 8748–8763. PMLR.
- Sentence-bert: Sentence embeddings using siamese bert-networks. arXiv preprint arXiv:1908.10084.
- Selective annotation makes language models better few-shot learners. arXiv preprint arXiv:2209.01975.
- AutoHint: Automatic Prompt Optimization with Hint Generation. arXiv preprint arXiv:2307.07415.
- Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971.
- Chain-of-thought prompting elicits reasoning in large language models. Advances in Neural Information Processing Systems, 35: 24824–24837.
- Bertscore: Evaluating text generation with bert. arXiv preprint arXiv:1904.09675.
- Large language models are human-level prompt engineers. arXiv preprint arXiv:2211.01910.
Sponsor
Paper Prompts
Sign up for free to create and run prompts on this paper using GPT-5.
Top Community Prompts
Collections
Sign up for free to add this paper to one or more collections.