Reproduce “Customizing Language Model Responses with Contrastive In-Context Learning” on OpenResearch

Run Claude Code, Codex or any coding agent as a research agent: literature, hypotheses and experiments on your laptop, cluster or cloud GPUs.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Xiang Gao, Kamalika Das

Researchers at Intuit AI Research developed Contrastive In-Context Learning (C-ICL), a method that guides Large Language Models (LLMs) to generate responses aligned with nuanced user preferences by using both positive and negative examples within the prompt. This approach consistently achieved superior performance over standard few-shot learning, particularly demonstrating that LLM-generated negative examples are as effective as human-labeled ones.

Key insights

  • The inclusion of negative examples within in-context learning provides LLMs with a richer, more comprehensive understanding of user preferences, enabling more precise output alignment.
  • LLM-generated negative examples proved as effective as, or sometimes superior to, human-labeled low-rated examples, significantly enhancing the method's practicality and scalability by reducing reliance on scarce human data.
  • Combining explicit contrastive examples with an LLM's self-generated analytical instruction (derived from those examples) offers complementary benefits, leading to the most robust performance across tasks.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.