atlas

Research map / Large language models / Language, safety and interpretability

Customizing Language Model Responses with Contrastive In-Context Learning

AAAI 2024 · Large language models › Language, safety and interpretability · approach: LLM unlearning and benchmarks · 6 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes contrastive in-context learning, pairing positive and negative demonstrations and prompting the LLM to analyze their differences before answering, to better align LLM outputs with user preferences.

Problem

Aligning LLM outputs with user intent when desired style, tone, or preference is hard to describe in instructions or measure with automatic metrics.

Approach

Use contrastive few-shot examples (a positive and a negative response per demonstration), with negatives taken from low-rated human answers, from zero-shot LLM outputs, or from an automated evaluator, and add a reasoning step where the model analyzes the contrast before generating its answer.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use combined contrastive examples and an analysis instruction instead of standard few-shot examplesGPT-4 · StackExchangeGPT Score: 0.582 -> 0.607Helped
Use combined contrastive examples and an analysis instruction instead of standard few-shot examplesGPT-4 · RedditGPT Score: 0.590 -> 0.670Helped
Use combined contrastive examples and an analysis instruction instead of standard few-shot examplesGPT-4 · Constrained Gen.Success rate: 0.900 -> 0.943Helped
Use combined contrastive examples and an analysis instruction instead of standard few-shot examplesGPT-4 · Concise vs. DetailedBERT Score: 0.880 -> 0.917Helped
Add an analysis instruction to contrastive examples (ablation)GPT-4 contrastive prompting · StackExchangeGPT Score: 0.590 -> 0.607Helped
Add contrastive examples to the analysis instruction (ablation)GPT-4 contrastive prompting · StackExchangeGPT Score: 0.591 -> 0.607Helped
Add an analysis instruction to contrastive examples (ablation)GPT-4 contrastive prompting · RedditGPT Score: 0.671 -> 0.670No clear effect
Add contrastive examples to the analysis instruction (ablation)GPT-4 contrastive prompting · RedditGPT Score: 0.672 -> 0.670Hurt
Replace human-written negative examples with generated negative examples (ablation)GPT-4 combined contrastive prompting · RedditGPT Score: 0.665 -> 0.670Helped
Replace human-written negative examples with generated negative examples (ablation)GPT-4 combined contrastive prompting · StackExchangeBERT Score: 0.847 -> 0.845Hurt
Use contrastive examples and an analysis instruction instead of standard few-shot examplesGPT-4 · Funny vs. SeriousEmb. Similarity: 0.624 -> 0.616 (human); 0.624 -> 0.630 (generated)Mixed
Use contrastive examples and an analysis instruction instead of standard few-shot examplesGPT-4 · British vs. AmericanBERT Score: 0.868 -> 0.886 (human); 0.868 -> 0.884 (generated)Helped

Surprising findings

Limitations

Experimental setup

Datasets: StackExchange (cooking.stackexchange.com) Reddit NoStupidQuestions StackExchange questions for constrained generation

Benchmarks: StackExchange cooking preference dataset Reddit NoStupidQuestions Synthetic stylistic datasets (funny vs. serious, concise vs. detailed, British vs. American) Constrained generation (seed words)

Metrics: BERT Score Emb. Similarity DialogRPT score GPT Score Success rate

Baselines: zero-shot prompting standard few-shot prompting

Builds on: chain-of-thought prompting few-shot prompting Sentence-BERT DialogRPT

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy