Finding Visual Task Vectors

Alberto Hojel*, Yutong Bai, Trevor Darrell, Amir Globerson, Amir Bar* ;

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 having to provide any in-context input-output examples. To find Task Vectors, we compute the mean activations of the attention heads in the model per task and use the REINFORCE [?] algorithm to patch into a subset of them with a new query image. The resulting Task Vectors guide the model towards performing the task better than the original model.1 1 For code and models see www.github.com/alhojel/visual_task_vectors"

Related Material


[pdf] [supplementary material] [DOI]