Customizing Language Model Responses with Contrastive In-Context Learning
Xiang Gao, Kamalika Das
摘要
Large language models (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.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper9
- Learning from Mistakes: Negative Reasoning Samples Enhance Out-of-Domain GeneralizationTian Xueyun, Minghua Ma, Bingbing Xu, Nuoyan Lyu 等ACL 2026 · 被引用 3 次
- RIMRULE: Improving Tool-Using Language Agents via MDL-Guided Rule LearningXiang Gao, Yuguang Yao, Qi Zhang, Kaiwen Dong 等ACL 2026 · 被引用 2 次
- Q-Adapter: Customizing Pre-trained LLMs to New Preferences with Forgetting MitigationYi-Chen Li, Fuxiang Zhang, Wenjie Qiu, Lei Yuan 等ICLR 2025 · 被引用 1 次
- Network-Level Prompt and Trait Leakage in Local Research AgentsHyejun Jeong, Mohammadreza Teymoorianfard, Abhinav Kumar, Amir Houmansadr 等USENIX Security 2026 · 被引用 1 次
- PANDAS: Improving Many-shot Jailbreaking via Positive Affirmation, Negative Demonstration, and Adaptive SamplingAvery Ma, Yangchen Pan, Amir-massoud FarahmandICML 2025
它引用的顶会 Paper9
- Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh 等ICML 2021 · 被引用 47,906 次
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma 等NeurIPS 2022 · 被引用 22,562 次
- BERTScore: Evaluating Text Generation with BERTTianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q. Weinberger 等ICLR 2020 · 被引用 8,443 次
- Flamingo: a Visual Language Model for Few-Shot LearningJean-Baptiste Alayrac, Jeff Donahue, Pauline Luc, Antoine Miech 等NeurIPS 2022 · 被引用 6,707 次
- Large Language Models are Human-Level Prompt EngineersYongchao Zhou, Andrei Ioan Muresanu, Ziwen Han, Keiran Paster 等ICLR 2023 · 被引用 297 次
相关 Paper
- Co-Evolving LLMs and Embedding Models via Density-Guided Preference Optimization for Text ClusteringZetong Li, Qinliang Su, Minhua Huang, Yin YangEMNLP 2025
- Generating Diverse Training Samples for Relation Extraction with Large Language ModelsZexuan Li, Hongliang Dai, Piji LiACL 2025
- AvaTaR: Optimizing LLM Agents for Tool Usage via Contrastive ReasoningShirley Wu, Shiyu Zhao, Qian Huang, Kexin Huang 等NeurIPS 2024 · 被引用 95 次
- Interpreting Language Reward Models via Contrastive ExplanationsJunqi Jiang, Tom Bewley, Saumitra Mishra, Freddy Lécué 等ICLR 2025
- What Matters in Data for DPO?Yu Pan, Zhongze Cai, Huaiyang Zhong, Guanting Chen 等NeurIPS 2025 · 被引用 13 次
