Lune

ICML2024顶会

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

Sheng Liu, Haotian Ye, Lei Xing, James Y. Zou

摘要

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 1 .

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 105 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Function Vectors in Large Language Models 引用了 Inference-Time Intervention: Eliciting Truthful Answers from a Language Model
  • Function Vectors in Large Language Models 引用了 Language Models are Few-Shot Learners
  • LoRA: Low-Rank Adaptation of Large Language Models 引用了 Language Models are Few-Shot Learners
  • Implicit In-context Learning 引用了 Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity
  • Implicit In-context Learning 引用了 Inference-Time Intervention: Eliciting Truthful Answers from a Language Model
  • Implicit In-context Learning 引用了 Language Models are Few-Shot Learners
  • Personalized Steering of Large Language Models: Versatile Steering Vectors Through Bi-directional Preference Optimization 引用了 LoRA: Low-Rank Adaptation of Large Language Models
  • Personalized Steering of Large Language Models: Versatile Steering Vectors Through Bi-directional Preference Optimization 引用了 Inference-Time Intervention: Eliciting Truthful Answers from a Language Model
  • Personalized Steering of Large Language Models: Versatile Steering Vectors Through Bi-directional Preference Optimization 引用了 Language Models are Few-Shot Learners
  • ReFT: Representation Finetuning for Language Models 引用了 LoRA: Low-Rank Adaptation of Large Language Models
  • ReFT: Representation Finetuning for Language Models 引用了 Inference-Time Intervention: Eliciting Truthful Answers from a Language Model
  • Kernel Language Entropy: Fine-grained Uncertainty Quantification for LLMs from Semantic Similarities 引用了 Inference-Time Intervention: Eliciting Truthful Answers from a Language Model
  • Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity 引用了 Language Models are Few-Shot Learners
  • Inference-Time Intervention: Eliciting Truthful Answers from a Language Model 引用了 LoRA: Low-Rank Adaptation of Large Language Models
  • Inference-Time Intervention: Eliciting Truthful Answers from a Language Model 引用了 Language Models are Few-Shot Learners
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper105

  1. Implicit In-context LearningZhuowei Li, Zihao Xu, Ligong Han, Yunhe Gao 等ICLR 2025 · 1,989 次引用
  2. ReFT: Representation Finetuning for Language ModelsZhengxuan Wu, Aryaman Arora, Zheng Wang, Atticus Geiger 等NeurIPS 2024 · 233 次引用
  3. Function Vectors in Large Language ModelsEric Todd, Millicent L. Li, Arnab Sen Sharma, Aaron Mueller 等ICLR 2024 · 229 次引用
  4. Kernel Language Entropy: Fine-grained Uncertainty Quantification for LLMs from Semantic SimilaritiesAlexander Nikitin, Jannik Kossen, Yarin Gal, Pekka MarttinenNeurIPS 2024 · 197 次引用
  5. Personalized Steering of Large Language Models: Versatile Steering Vectors Through Bi-directional Preference OptimizationYuanpu Cao, Tianrong Zhang, Bochuan Cao, Ziyi Yin 等NeurIPS 2024 · 135 次引用

它引用的 Paper40

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
  2. LoRA: Low-Rank Adaptation of Large Language ModelsEdward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu 等ICLR 2022 · 18,833 次引用
  3. BERTScore: Evaluating Text Generation with BERTTianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q. Weinberger 等ICLR 2020 · 8,443 次引用
  4. Inference-Time Intervention: Eliciting Truthful Answers from a Language ModelKenneth Li, Oam Patel, Fernanda B. Viégas, Hanspeter Pfister 等NeurIPS 2023 · 1,549 次引用
  5. Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order SensitivityYao Lu, Max Bartolo, Alastair Moore, Sebastian Riedel 等ACL 2022 · 1,494 次引用

相关 Paper

  1. Task Vectors, Learned Not Extracted: Performance Gains and Mechanistic InsightsHaolin Yang, Hakaze Cho, Kaize Ding, Naoya InoueICLR 2026
  2. Learning Task Representations from In-Context LearningBaturay Saglam, Xinyang Hu, Zhuoran Yang, Dionysis Kalogerias 等ACL Findings 2025 · 1 次引用
  3. LIVE: Learnable In-Context Vector for Visual Question AnsweringYingzhe Peng, Chenduo Hao, Xinting Hu, Jiawei Peng 等NeurIPS 2024
  4. What Do Language Models Learn in Context? The Structured Task HypothesisJiaoda Li, Yifan Hou, Mrinmaya Sachan, Ryan CotterellACL 2024 · 5 次引用
  5. Mimic In-Context Learning for Multimodal TasksYuchu Jiang, Jiale Fu, Chenduo Hao, Xinting Hu 等CVPR 2025
黄昏的海面,两侧是细线勾勒的悬崖