Finding Visual Task Vectors
Alberto Hojel, Yutong Bai, Trevor Darrell, Amir Globerson, Amir Bar
TL;DR
This work probes how visual in-context learning operates in vision models by identifying Visual Task Vectors—task-encoding activations that can be patched into transformer attention heads. It builds a pipeline to discover these vectors by computing mean activations per task, scoring activations for task relevance, and using REINFORCE to select patch positions that maximize task performance in MAE-VQGAN. Empirically, patched Task Vectors enable solving downstream image-to-image tasks without input-output demonstrations, often outperforming the original one-shot prompts while reducing forward computation. The study also provides ablations, qualitative analyses, and cross-domain explorations (e.g., Llama2-7B and x-ray data), highlighting the distributed encoder-decoder nature of visual task representations and showing vector arithmetic can yield composable tasks.
Abstract
Visual Prompting is a technique for teaching models to perform a visual task via in-context examples, without any additional training. In this work, we analyze the activations of MAE-VQGAN, a recent Visual Prompting model, and find task vectors, activations that encode task-specific information. Equipped with this insight, we demonstrate that it is possible to identify the task vectors and use them to guide the network towards performing different tasks without providing any input-output examples. To find task vectors, we compute the average intermediate activations per task and use the REINFORCE algorithm to search for the subset of task vectors. The resulting task vectors guide the model towards performing a task better than the original model without the need for input-output examples.
