mlsanityData to 14 Oct 2026

Customizing Language Model Responses with Contrastive In-Context Learning

arXiv 2401.17390 ↗First posted 30 Jan 2024cs.CL cs.AIcited by 19

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

  1. 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,744
  2. 2020Language Models are Few-Shot Learnerscited by 32,419
  3. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
  4. 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,170
  5. 2019BERTScore: Evaluating Text Generation with BERTcited by 5,512
  6. 2021On the Opportunities and Risks of Foundation Modelscited by 4,033
  7. 2020Making Pre-trained Language Models Better Few-shot Learnerscited by 1,256
  8. 2022Large Language Models Are Human-Level Prompt Engineerscited by 1,045
  9. 2022Selective Annotation Makes Language Models Better Few-Shot Learnerscited by 243
  10. 2022Instruction Induction: From Few Examples to Natural Language Task Descriptionscited by 152
  11. 2021COCO-LM: Correcting and Contrasting Text Sequences for Language Model Pretrainingcited by 126
  12. 2020Dialogue Response Ranking Training with Large-Scale Human Feedback Datacited by 68
1 more
  1. 2023AutoHint: Automatic Prompt Optimization with Hint Generationcited by 30

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2024: 3; 2025: 10; 2026: 6.

19 papers.

Sort:

By area:

  1. 2025Measuring What Makes You Unique: Difference-Aware User Modeling for Enhancing LLM Personalizationcited by 45
  2. 2024Q-Adapter: Customizing Pre-trained LLMs to New Preferences with Forgetting Mitigationcited by 7
  3. 2024Does Few-Shot Learning Help LLM Performance in Code Synthesis?cited by 6
  4. 2025PANDAS: Improving Many-shot Jailbreaking via Positive Affirmation, Negative Demonstration, and Adaptive Samplingcited by 6
  5. 2025LLM-Meta-SR: In-Context Learning for Evolving Selection Operators in Symbolic Regressioncited by 6
  6. 2025Network-Level Prompt and Trait Leakage in Local Research Agentscited by 5
  7. 2025Learning to Search Effective Example Sequences for In-Context Learningcited by 2
  8. 2025CG-TTRL: Context-Guided Test-Time Reinforcement Learning for On-Device Large Language Modelscited by 2
  9. 2025RIMRULE: Improving Tool-Using Language Agents via MDL-Guided Rule Learningcited by 2
  10. 2025A Survey of the State-of-the-Art in Conversational Question Answering Systemscited by 1
  11. 2025LLM For Loop Invariant Generation and Fixing: How Far Are We?cited by 1
  12. 2024Seeing the Undefined: Chain-of-Action for Generative Semantic Labelscited by 0
7 more
  1. 2025Comparative Personalization for Multi-document Summarizationcited by 0
  2. 2026Empathy Applicability Modeling for General Health Queriescited by 0
  3. 2026A Training-Free Regeneration Paradigm: Contrastive Reflection Memory Guided Self-Verification and Self-Improvementcited by 0
  4. 2026Supplement Generation Training for Enhancing Agentic Task Performancecited by 0
  5. 2026ProjAgent: Procedural Similarity Retrieval for Repository-Level Code Generationcited by 0
  6. 2026Smarter by the Moment: Environment-Driven Dynamic Policies for Continual LLM Improvementcited by 0
  7. 2026The Architect, the Adversary, and the Judge: Closed-Loop Generation of Standards-Aligned Assessment Items at Scalecited by 0

Similar, not cited

Close in wording, no citation either way

  1. 2024Large Language Models are Contrastive Reasoners
  2. 2025How much do LLMs learn from negative examples?
  3. 2026Not the Example, but the Process: How Self-Generated Examples Enhance LLM Reasoning
  4. 2024Efficient LLM Context Distillation
  5. 2024Large Language Models Know What Makes Exemplary Contexts
  6. 2025Efficient Response Generation Strategy Selection for Fine-Tuning Large Language Models Through Self-Aligned Perplexity
  7. 2023Large Language Model Programs
  8. 2024In-Context Learning with Reinforcement Learning for Incomplete Utterance Rewriting