mlsanityData to 14 Oct 2026

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

arXiv 2311.06668 ↗First posted 11 Nov 2023cs.LG cs.AI cs.CLcited by 245

Not on the map. Why?

Cited by 67 in Mechanistic interpretability, but placed by its own abstract, which didn’t fit.

Abstract (arXiv)

Large language models (LLMs) demonstrate emergent in-context learning capabilities, where they adapt to new tasks based on example demonstrations. However, in-context learning has seen limited effectiveness in many settings, is difficult to quantitatively control and takes up context window space. To overcome these limitations, we propose an alternative approach that recasts in-context learning as in-context vectors (ICV). Using ICV has two steps. We first use a forward pass on demonstration examples to create the in-context vector from the latent embedding of the LLM. This vector captures essential information about the intended task. On a new query, instead of adding demonstrations to the prompt, we shift the latent states of the LLM using the ICV. The ICV approach has several benefits: 1) it enables the LLM to more effectively follow the demonstration examples; 2) it's easy to control by adjusting the magnitude of the ICV; 3) it reduces the length of the prompt by removing the in-context demonstrations; 4) ICV is computationally much more efficient than fine-tuning. We demonstrate that ICV achieves better performance compared to standard in-context learning and fine-tuning on diverse tasks including safety, style transfer, role-playing and formatting. Moreover, we show that we can flexibly teach LLM to simultaneously follow different types of instructions by simple vector arithmetics on the corresponding ICVs.

Key facts. Cited by 245 papers in the map (data through 14 Oct 2026). Builds on 56 of its 70 references that are in the map. First posted on arXiv 11 Nov 2023.

Builds on

56 of 70 references.

References · 56

  1. 2017Attention Is All You Needcited by 60,361
  2. 2020Language Models are Few-Shot Learnerscited by 32,419
  3. 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
  4. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
  5. 2023Judging LLM-as-a-Judge with MT-Bench and Chatbot Arenacited by 8,626
  6. 2019BERTScore: Evaluating Text Generation with BERTcited by 5,512
  7. 2019Unsupervised Cross-lingual Representation Learning at Scalecited by 3,935
  8. 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 3,104
  9. 2015Character-level Convolutional Networks for Text Classificationcited by 2,330
  10. 2020Don't Stop Pretraining: Adapt Language Models to Domains and Taskscited by 1,565
  11. 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,434
  12. 2023Representation Engineering: A Top-Down Approach to AI Transparencycited by 1,336
38 more
  1. 2016Man is to Computer Programmer as Woman is to Homemaker? Debiasing Word Embeddingscited by 1,312
  2. 2023Inference-Time Intervention: Eliciting Truthful Answers from a Language Modelcited by 1,302
  3. 2020RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language Modelscited by 1,255
  4. 2021What Makes Good In-Context Examples for GPT-3?cited by 1,195
  5. 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,135
  6. 2022Editing Models with Task Arithmeticcited by 1,120
  7. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
  8. 2023Steering Language Models With Activation Engineeringcited by 922
  9. 2022Discovering Latent Knowledge in Language Models Without Supervisioncited by 767
  10. 2023The RefinedWeb Dataset for Falcon LLM: Outperforming Curated Corpora with Web Data, and Web Data Onlycited by 763
  11. 2022Transformers learn in-context by gradient descentcited by 732
  12. 2022GPT-NeoX-20B: An Open-Source Autoregressive Language Modelcited by 713
  13. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
  14. 2021Learning To Retrieve Prompts for In-Context Learningcited by 648
  15. 2022Emergent World Representations: Exploring a Sequence Model Trained on a Synthetic Taskcited by 431
  16. 2023Larger language models do in-context learning differentlycited by 394
  17. 2023Safety-Tuned LLaMAs: Lessons From Improving the Safety of Large Language Models that Follow Instructionscited by 387
  18. 2021Self-Diagnosis and Self-Debiasing: A Proposal for Reducing Corpus-Based Bias in NLPcited by 337
  19. 2023Hard Prompts Made Easy: Gradient-Based Discrete Optimization for Prompt Tuning and Discoverycited by 336
  20. 2023In-Context Learning Creates Task Vectorscited by 312
  21. 2021Surface Form Competition: Why the Highest Probability Answer Isn't Always Rightcited by 263
  22. 2017Style Transfer from Non-Parallel Text by Cross-Alignmentcited by 248
  23. 2022Quark: Controllable Text Generation with Reinforced Unlearningcited by 237
  24. 2021Gradient-based Adversarial Attacks against Text Transformerscited by 234
  25. 2018Dear Sir or Madam, May I introduce the GYAFC Dataset: Corpus, Benchmarks and Metrics for Formality Style Transfercited by 211
  26. 2016Ex Machina: Personal Attacks Seen at Scalecited by 210
  27. 2021Noisy Channel Language Model Prompting for Few-Shot Text Classificationcited by 165
  28. 2021A Recipe For Arbitrary Text Style Transfer with Large Language Modelscited by 107
  29. 2022Robust Training under Label Noise by Over-parameterizationcited by 93
  30. 2022On the Effect of Pretraining Corpora on In-context Learning by a Large-scale Language Modelcited by 81
  31. 2022Exploring the Limits of Domain-Adaptive Training for Detoxifying Large-Scale Language Modelscited by 68
  32. 2023Better Zero-Shot Reasoning with Self-Adaptive Promptingcited by 52
  33. 2023kNN Prompting: Beyond-Context Learning with Calibration-Free Nearest Neighbor Inferencecited by 47
  34. 2023Self-Detoxifying Language Models via Toxification Reversalcited by 46
  35. 2023Using In-Context Learning to Improve Dialogue Safetycited by 42
  36. 2023Did You Read the Instructions? Rethinking the Effectiveness of Task Definitions in Instruction Learningcited by 41
  37. 2020TextSETTR: Few-Shot Text Style Extraction and Tunable Targeted Restylingcited by 40
  38. 2022Guess the Instruction! Flipped Learning Makes Language Models Stronger Zero-Shot Learnerscited by 22

50 most cited of 56 All 56 (JSON)

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2024: 49; 2025: 114; 2026: 82.

245 papers.

Sort:

By area:

  1. 2025CODI: Compressing Chain-of-Thought into Continuous Space via Self-Distillationcited by 225
  2. 2025AxBench: Steering LLMs? Even Simple Baselines Outperform Sparse Autoencoderscited by 218
  3. 2024ReFT: Representation Finetuning for Language Modelscited by 197
  4. 2024Improving Instruction-Following in Language Models through Activation Steeringcited by 160
  5. 2024Kernel Language Entropy: Fine-grained Uncertainty Quantification for LLMs from Semantic Similaritiescited by 159
  6. 2025MemOS: A Memory OS for AI Systemcited by 138
  7. 2024AI Agents Under Threat: A Survey of Key Security Challenges and Future Pathwayscited by 127
  8. 2024Personalized Steering of Large Language Models: Versatile Steering Vectors Through Bi-directional Preference Optimizationcited by 118
  9. 2024Steering Language Model Refusal with Sparse Autoencoderscited by 95
  10. 2025More Thinking, Less Seeing? Assessing Amplified Hallucination in Multimodal Reasoning Modelscited by 86
  11. 2025SAEs Are Good for Steering -- If You Select the Right Featurescited by 78
  12. 2024Inference Scaling for Long-Context Retrieval Augmented Generationcited by 65
38 more
  1. 2024Aligning Large Language Models with Representation Editing: A Control Perspectivecited by 64
  2. 2024Semantics-Adaptive Activation Intervention for LLMs via Dynamic Steering Vectorscited by 63
  3. 2024Steering Knowledge Selection Behaviours in LLMs via SAE-Based Representation Engineeringcited by 63
  4. 2024Reducing Hallucinations in Vision-Language Models via Latent Space Steeringcited by 59
  5. 2024From Words to Numbers: Your Large Language Model Is Secretly A Capable Regressor When Given In-Context Examplescited by 57
  6. 2024Spectral Editing of Activations for Large Language Model Alignmentcited by 56
  7. 2024SCANS: Mitigating the Exaggerated Safety for LLMs via Safety-Conscious Activation Steeringcited by 50
  8. 2025A Unified Understanding and Evaluation of Steering Methodscited by 46
  9. 2025Multi-Attribute Steering of Language Models via Targeted Interventioncited by 46
  10. 2025Learning without training: The implicit dynamics of in-context learningcited by 43
  11. 2024Who's asking? User personas and the mechanics of latent misalignmentcited by 40
  12. 2025A Survey of Test-Time Compute: From Intuitive Inference to Deliberate Reasoningcited by 40
  13. 2024Multi-property Steering of Large Language Models with Dynamic Activation Compositioncited by 39
  14. 2025When is Task Vector Provably Effective for Model Editing? A Generalization Analysis of Nonlinear Transformerscited by 38
  15. 2025M2IV: Towards Efficient and Fine-grained Multimodal In-Context Learning via Representation Engineeringcited by 35
  16. 2025A Survey on Mechanistic Interpretability for Multi-Modal Foundation Modelscited by 34
  17. 2025Personalized Text Generation with Contrastive Activation Steeringcited by 34
  18. 2025Evaluating and Steering Modality Preferences in Multimodal Large Language Modelcited by 33
  19. 2024Safety Arithmetic: A Framework for Test-time Safety Alignment of Language Models by Steering Parameters and Activationscited by 32
  20. 2024Data Augmentation using Large Language Models: Data Perspectives, Learning Paradigms and Challengescited by 30
  21. 2025Representation Bending for Large Language Model Safetycited by 30
  22. 2025One-shot Optimized Steering Vectors Mediate Safety-relevant Behaviors in LLMscited by 29
  23. 2024Tradeoffs Between Alignment and Helpfulness in Language Models with Steering Methodscited by 28
  24. 2025ICL-Router: In-Context Learned Model Representations for LLM Routingcited by 28
  25. 2024Beyond Single Concept Vector: Modeling Concept Subspace in LLMs with Gaussian Distributioncited by 27
  26. 2024Finding Visual Task Vectorscited by 24
  27. 2024Jailbreak Antidote: Runtime Safety-Utility Balance via Sparse Representation Adjustment in Large Language Modelscited by 23
  28. 2025Improving Reasoning Performance in Large Language Models via Representation Engineeringcited by 23
  29. 2024Configurable Foundation Models: Building LLMs from a Modular Perspectivecited by 22
  30. 2024Data Poisoning for In-context Learningcited by 21
  31. 2025Representation Engineering for Large-Language Models: Survey and Research Challengescited by 21
  32. 2025Improved Representation Steering for Language Modelscited by 21
  33. 2026Spherical Steering: Geometry-Aware Activation Rotation for Language Modelscited by 21
  34. 2024PaCE: Parsimonious Concept Engineering for Large Language Modelscited by 19
  35. 2024Can sparse autoencoders be used to decompose and interpret steering vectors?cited by 19
  36. 2025Towards High Data Efficiency in Reinforcement Learning with Verifiable Rewardcited by 19
  37. 2024Towards Tracing Trustworthiness Dynamics: Revisiting Pre-training Period of Large Language Modelscited by 18
  38. 2024Towards Inference-time Category-wise Safety Steering for Large Language Modelscited by 18

50 most cited of 245 All 245 (JSON)