Customizing Language Model Responses with Contrastive In-Context Learning
Not on the map. Why?
Abstract (arXiv)
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
Key facts. Cited by 19 papers in the map (data through 14 Oct 2026). Builds on 13 of its 15 references that are in the map. First posted on arXiv 30 Jan 2024.
Builds on
13 of 15 references.
References · 13
- 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,744
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,170
- 2019BERTScore: Evaluating Text Generation with BERTcited by 5,512
- 2021On the Opportunities and Risks of Foundation Modelscited by 4,033
- 2020Making Pre-trained Language Models Better Few-shot Learnerscited by 1,256
- 2022Large Language Models Are Human-Level Prompt Engineerscited by 1,045
- 2022Selective Annotation Makes Language Models Better Few-Shot Learnerscited by 243
- 2022Instruction Induction: From Few Examples to Natural Language Task Descriptionscited by 152
- 2021COCO-LM: Correcting and Contrasting Text Sequences for Language Model Pretrainingcited by 126
- 2020Dialogue Response Ranking Training with Large-Scale Human Feedback Datacited by 68
1 more
- 2023AutoHint: Automatic Prompt Optimization with Hint Generationcited by 30
Built on by
Citing papers per year: 2024: 3; 2025: 10; 2026: 6.
19 papers.
Sort:
By area:
- 2025Measuring What Makes You Unique: Difference-Aware User Modeling for Enhancing LLM Personalizationcited by 45
- 2024Q-Adapter: Customizing Pre-trained LLMs to New Preferences with Forgetting Mitigationcited by 7
- 2024Does Few-Shot Learning Help LLM Performance in Code Synthesis?cited by 6
- 2025PANDAS: Improving Many-shot Jailbreaking via Positive Affirmation, Negative Demonstration, and Adaptive Samplingcited by 6
- 2025LLM-Meta-SR: In-Context Learning for Evolving Selection Operators in Symbolic Regressioncited by 6
- 2025Network-Level Prompt and Trait Leakage in Local Research Agentscited by 5
- 2025Learning to Search Effective Example Sequences for In-Context Learningcited by 2
- 2025CG-TTRL: Context-Guided Test-Time Reinforcement Learning for On-Device Large Language Modelscited by 2
- 2025RIMRULE: Improving Tool-Using Language Agents via MDL-Guided Rule Learningcited by 2
- 2025A Survey of the State-of-the-Art in Conversational Question Answering Systemscited by 1
- 2025LLM For Loop Invariant Generation and Fixing: How Far Are We?cited by 1
- 2024Seeing the Undefined: Chain-of-Action for Generative Semantic Labelscited by 0
7 more
- 2025Comparative Personalization for Multi-document Summarizationcited by 0
- 2026Empathy Applicability Modeling for General Health Queriescited by 0
- 2026A Training-Free Regeneration Paradigm: Contrastive Reflection Memory Guided Self-Verification and Self-Improvementcited by 0
- 2026Supplement Generation Training for Enhancing Agentic Task Performancecited by 0
- 2026ProjAgent: Procedural Similarity Retrieval for Repository-Level Code Generationcited by 0
- 2026Smarter by the Moment: Environment-Driven Dynamic Policies for Continual LLM Improvementcited by 0
- 2026The Architect, the Adversary, and the Judge: Closed-Loop Generation of Standards-Aligned Assessment Items at Scalecited by 0
- 2026Smarter by the Moment: Environment-Driven Dynamic Policies for Continual LLM Improvement15 Sep 2026
- 2026The Architect, the Adversary, and the Judge: Closed-Loop Generation of Standards-Aligned Assessment Items at Scale26 Aug 2026
- 2026ProjAgent: Procedural Similarity Retrieval for Repository-Level Code Generation9 Jul 2026
- 2026Supplement Generation Training for Enhancing Agentic Task Performance22 Apr 2026
- 2026A Training-Free Regeneration Paradigm: Contrastive Reflection Memory Guided Self-Verification and Self-Improvement20 Mar 2026
- 2026Empathy Applicability Modeling for General Health Queries14 Jan 2026
- 2025RIMRULE: Improving Tool-Using Language Agents via MDL-Guided Rule Learning31 Dec 2025
- 2025LLM For Loop Invariant Generation and Fixing: How Far Are We?9 Nov 2025
- 2025CG-TTRL: Context-Guided Test-Time Reinforcement Learning for On-Device Large Language Models9 Nov 2025
- 2025Comparative Personalization for Multi-document Summarization25 Sep 2025
- 2025A Survey of the State-of-the-Art in Conversational Question Answering Systems6 Sep 2025
- 2025Network-Level Prompt and Trait Leakage in Local Research Agents27 Aug 2025
7 more
- 2025LLM-Meta-SR: In-Context Learning for Evolving Selection Operators in Symbolic Regression24 May 2025
- 2025Learning to Search Effective Example Sequences for In-Context Learning11 Mar 2025
- 2025Measuring What Makes You Unique: Difference-Aware User Modeling for Enhancing LLM Personalization4 Mar 2025
- 2025PANDAS: Improving Many-shot Jailbreaking via Positive Affirmation, Negative Demonstration, and Adaptive Sampling4 Feb 2025
- 2024Does Few-Shot Learning Help LLM Performance in Code Synthesis?3 Dec 2024
- 2024Seeing the Undefined: Chain-of-Action for Generative Semantic Labels26 Nov 2024
- 2024Q-Adapter: Customizing Pre-trained LLMs to New Preferences with Forgetting Mitigation4 Jul 2024
- 2025Measuring What Makes You Unique: Difference-Aware User Modeling for Enhancing LLM Personalizationcited by 45
- 2025LLM-Meta-SR: In-Context Learning for Evolving Selection Operators in Symbolic Regressioncited by 6
- 2025Learning to Search Effective Example Sequences for In-Context Learningcited by 2
- 2025CG-TTRL: Context-Guided Test-Time Reinforcement Learning for On-Device Large Language Modelscited by 2
- 2025A Survey of the State-of-the-Art in Conversational Question Answering Systemscited by 1
- 2025LLM For Loop Invariant Generation and Fixing: How Far Are We?cited by 1
- 2025Comparative Personalization for Multi-document Summarizationcited by 0
- 2026Empathy Applicability Modeling for General Health Queriescited by 0
- 2026ProjAgent: Procedural Similarity Retrieval for Repository-Level Code Generationcited by 0
- 2026Smarter by the Moment: Environment-Driven Dynamic Policies for Continual LLM Improvementcited by 0
- 2026The Architect, the Adversary, and the Judge: Closed-Loop Generation of Standards-Aligned Assessment Items at Scalecited by 0
- 2026Smarter by the Moment: Environment-Driven Dynamic Policies for Continual LLM Improvement15 Sep 2026
- 2026The Architect, the Adversary, and the Judge: Closed-Loop Generation of Standards-Aligned Assessment Items at Scale26 Aug 2026
- 2026ProjAgent: Procedural Similarity Retrieval for Repository-Level Code Generation9 Jul 2026
- 2026Empathy Applicability Modeling for General Health Queries14 Jan 2026
- 2025LLM For Loop Invariant Generation and Fixing: How Far Are We?9 Nov 2025
- 2025CG-TTRL: Context-Guided Test-Time Reinforcement Learning for On-Device Large Language Models9 Nov 2025
- 2025Comparative Personalization for Multi-document Summarization25 Sep 2025
- 2025A Survey of the State-of-the-Art in Conversational Question Answering Systems6 Sep 2025
- 2025LLM-Meta-SR: In-Context Learning for Evolving Selection Operators in Symbolic Regression24 May 2025
- 2025Learning to Search Effective Example Sequences for In-Context Learning11 Mar 2025
- 2025Measuring What Makes You Unique: Difference-Aware User Modeling for Enhancing LLM Personalization4 Mar 2025
Similar, not cited
Close in wording, no citation either way
- 2024Large Language Models are Contrastive Reasoners
- 2025How much do LLMs learn from negative examples?
- 2026Not the Example, but the Process: How Self-Generated Examples Enhance LLM Reasoning
- 2024Efficient LLM Context Distillation
- 2024Large Language Models Know What Makes Exemplary Contexts
- 2025Efficient Response Generation Strategy Selection for Fine-Tuning Large Language Models Through Self-Aligned Perplexity
- 2023Large Language Model Programs
- 2024In-Context Learning with Reinforcement Learning for Incomplete Utterance Rewriting