Two Vectors Replace In-Context Demos: Structured Task Adaptation via Embeddings
Abstract
In-context learning (ICL) adapts frozen large multimodal models (LMMs) to new tasks from a few demonstrations (demos), but re-encodes them at every query, where each demo image adds up to hundreds of visual tokens. Demo-free methods remove this cost with a compact task state. However, they add it at locations searched per task or at every decoder layer, where task parameters grow with depth. Moreover, inserted tokens or keys cannot change how the original prompt divides its attention within a layer. To address these issues, we propose Structured Task Adaptation via Embeddings (STAVE), which replaces demos with two task-specific vectors added to existing input embeddings. Specifically, a readout vector updates the answer-producing tokens and a context vector updates the other structural token groups. Both are trained with answer labels on prompts with and without demos. We justify these design choices theoretically using a first-order analysis of the loss and a margin bound. Extensive experiments on six LMMs and five large language models show that STAVE matches or outperforms state-of-the-art methods on multimodal tasks with far fewer task parameters and surpasses 15-shot ICL and prior task vectors on 18 text tasks, all at zero-shot inference cost.
Create a lesson
Metadata
- Categories
- cs.CL, cs.CV, cs.LG
- Comments
- Technical report
Related papers
Failure Broadens, Success Sharpens: Continual Adaptation of Tool-Use Agents Across Diverse Tasks with Dual-Polarity Memory
Shared title terminologycs.CLTianmai M. Zhang, Hoda Shajari, Amr Hendy et al.
Itgan at NADI 2026 shared task: Parameter-Efficient Whisper Adaptation for Robust, Mixed-Dialect and Code-Switched Arabic ASR
Shared title terminologycs.CLIbrahim Almajai
Decoupling Logic from Persona: Structural Immunity of Edge LLM Agents to Context Pollution
Shared title terminologycs.CLMasaaki Nakatsu, Reno Wang
MINE: A Training-Free Defense against Indirect Prompt Injection via Mutual Information and Embedding Variance
Shared title terminologycs.CLTruong Phan, Ngoc-Quan Pham, Dat Quoc Nguyen
Lightweight Reasoning Transfer via Chain-of-Thought Vector Projection
Shared title terminologycs.CLYulin Qi, Shuo Xu, Shuxia Lin et al.
NORMCRAFT: Cultural Norm Generation for Context-Aware Language Model Alignment
Shared title terminologycs.CLTangyuan Zhang, Zhuang Li, Fatemeh Shiri et al.