Function Vectors in Large Language Models
Eric ToddMillicent LiArnab Sen SharmaAaron MuellerByron C WallaceDavid Bau
Eric Todd
Millicent Li
Arnab Sen Sharma
Aaron Mueller
Byron C Wallace
David Bau
+6
This paper shows that autoregressive transformer language models encode input-output functions as compact vectors, termed function vectors (FVs), within a small number of attention heads during in-context learning. Using causal mediation analysis across varied tasks, the authors find that FVs trigger task execution even in zero-shot or natural-text settings, are most effective in middle layers, and can be summed to compose new tasks. FVs often encode output space information, but this alone is insufficient to reconstruct them, demonstrating that explicit, causally active vector representations of functions can be extracted from LLMs.

OpenReview ·
· September 15, 2023