Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
41 tokens/sec
GPT-4o
59 tokens/sec
Gemini 2.5 Pro Pro
41 tokens/sec
o3 Pro
7 tokens/sec
GPT-4.1 Pro
50 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

Implicit In-context Learning (2405.14660v1)

Published 23 May 2024 in cs.LG, cs.AI, and cs.CL

Abstract: In-context Learning (ICL) empowers LLMs to adapt to unseen tasks during inference by prefixing a few demonstration examples prior to test queries. Despite its versatility, ICL incurs substantial computational and memory overheads compared to zero-shot learning and is susceptible to the selection and order of demonstration examples. In this work, we introduce Implicit In-context Learning (I2CL), an innovative paradigm that addresses the challenges associated with traditional ICL by absorbing demonstration examples within the activation space. I2CL first generates a condensed vector representation, namely a context vector, from the demonstration examples. It then integrates the context vector during inference by injecting a linear combination of the context vector and query activations into the model's residual streams. Empirical evaluation on nine real-world tasks across three model architectures demonstrates that I2CL achieves few-shot performance with zero-shot cost and exhibits robustness against the variation of demonstration examples. Furthermore, I2CL facilitates a novel representation of "task-ids", enhancing task similarity detection and enabling effective transfer learning. We provide a comprehensive analysis of I2CL, offering deeper insights into its mechanisms and broader implications for ICL. The source code is available at: https://github.com/LzVv123456/I2CL.

User Edit Pencil Streamline Icon: https://streamlinehq.com
Authors (8)
  1. Zhuowei Li (15 papers)
  2. Zihao Xu (18 papers)
  3. Ligong Han (39 papers)
  4. Yunhe Gao (19 papers)
  5. Song Wen (14 papers)
  6. Di Liu (107 papers)
  7. Hao Wang (1119 papers)
  8. Dimitris N. Metaxas (84 papers)
Github Logo Streamline Icon: https://streamlinehq.com

GitHub