atlas

Research map / Large language models / Instruction and fine-tuning

In-context Vectors: Making In Context Learning More Effective and Controllable Through Latent Space Steering

ICML 2024 · Large language models › Instruction and fine-tuning · approach: Gradient-free adaptation and merging · 4 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 In-Context Vectors (ICV), an inference-only method that extracts a single steering vector from demonstration latent states (first principal direction of paired differences or a contrastive gradient) and adds it to all layers' latent states at query time, outperforming ICL and LoRA fine-tuning on detoxification, style transfer, and role-play.

Problem

In-context learning is uneven and sensitive to demonstrations and templates, consumes context window space, and is hard to control quantitatively; fine-tuning is costly.

Approach

Summarize demonstrations into a single in-context vector from last-token latent-state differences (paired: first principal direction; unpaired: contrastive gradient), then add it, scaled by lambda and norm-preserved, to every layer and token at inference, avoiding prompt demonstrations and weight updates.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use ICV instead of ICLFalcon-7B · ParaDetoxToxicity (%): 73.09 -> 34.77Helped
Use ICV instead of LoRA fine-tuningFalcon-7B · ParaDetoxToxicity (%): 52.78 -> 34.77Helped
Use ICV instead of ICLLlama-7B · ParaDetoxToxicity (%): 66.81 -> 39.54Helped
Use ICV instead of ICLLlama-7B · Informal to formal (GYAFC)Formality (%): 32.96 -> 48.30Helped
Use ICV instead of ICLLlama-7B · Negative to positive (Yelp)Positivity (%): 63.42 -> 75.28Helped
Use ICV instead of ICLVicuna-7B · JailbreakASR: 44.0 -> 50.0Helped
Increase ICV strength from λ = 0.10 to λ = 0.20Vicuna-7B · JailbreakASR: 50.0 -> 99.0Helped
Use k-NN on latent states instead of ICLGPT2-XL · AGNewsAccuracy: 83.2 -> 86.3Helped
Apply ICV to all layers instead of only the last layer (ablation)Falcon-7B · ParaDetoxToxicity (%): 76.27 -> 34.77Helped
Apply ICV to all layers instead of only the first layer (ablation)Falcon-7B · ParaDetoxToxicity (%): 78.33 -> 34.77Helped
Apply ICV to all layers instead of only the middle layer (ablation)Falcon-7B · ParaDetoxToxicity (%): 78.56 -> 34.77Helped
Add ICV rather than remove it (ablation)Falcon-7B · ParaDetoxToxicity (%): 79.84 -> 34.77Helped

Surprising findings

Limitations

Experimental setup

Datasets: ParaDetox GYAFC Yelp review Romeo and Juliet AGNews Wikipedia Toxic Comments Build-it Break-it Fix-it Bot-Adversarial Dialogue

Benchmarks: ParaDetox GYAFC Yelp review Romeo and Juliet AGNews

Metrics: toxicity rate ROUGE-1 BERT score BLEU formality accuracy positivity accuracy win rate attack success rate

Baselines: In-context learning LoRA fine-tuning w/o context GBDA PEZ task vectors

Builds on: in-context learning LoRA task arithmetic inference-time intervention

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