paper-with-me

홈 › Papers

Function Vectors in Large Language Models

2023-10-23 · Eric Todd, Millicent L. Li, Arnab Sen Sharma, Aaron Mueller, Byron C. Wallace, David Bau

We report the presence of a simple neural mechanism that represents an input-output function as a vector within autoregressive transformer language models (LMs). Using causal mediation analysis on a diverse range of in-context-learning (ICL) tasks, we find that a small number attention heads transport a compact representation of the demonstrated task, which we call a function vector (FV). FVs are robust to changes in context, i.e., they trigger execution of the task on inputs such as zero-shot and natural text settings that do not resemble the ICL contexts from which they are collected. We test FVs across a range of tasks, models, and layers and find strong causal effects across settings in middle layers. We investigate the internal structure of FVs and find while that they often contain information that encodes the output space of the function, this information alone is not sufficient to reconstruct an FV. Finally, we test semantic vector composition in FVs, and find that to some extent they can be summed to create vectors that trigger new complex tasks. Our findings show that compact, causal internal vector representations of function abstractions can be explicitly extracted from LLMs. Our code and data are available at https://functions.baulab.info.

📄 PDF Abstract BibTeX arXiv:2310.15213

Code (1)

ericwtodd/function_vectors pytorch

Tasks

In-Context Learning

Similar Papers 제목 키워드 기반

Exploring Language-Agnosticity in Function Vectors: A Case Study in Machine Translation

2026-04-21 · Nurkhan Laiyk, Gerard I. Gállego, Javier Ferrando, Fajri Koto arxiv

Function vectors (FVs) are vector representations of tasks extracted from model activations during in-context learning. While prior work has shown that multilingual model representations can be language-agnostic, it rema…

Machine Translation

Relational Knowledge Distillation Using Fine-tuned Function Vectors

2026-01-13 · Andrea Kang, Yingnian Wu, Hongjing Lu arxiv

Representing relations between concepts is a core prerequisite for intelligent systems to make sense of the world. Recent work using causal mediation analysis has shown that a small set of attention heads encodes task re…

Knowledge Distillation

Functional Abstraction of Knowledge Recall in Large Language Models

2025-04-20 · Zijian Wang, Chang Xu

Pre-trained transformer large language models (LLMs) demonstrate strong knowledge recall capabilities. This paper investigates the knowledge recall mechanism in LLMs by abstracting it into a functional structure. We prop…

knowledge editing

Multimodal Function Vectors for Visual Relations

2025-10-02 · Shuhao Fu, Esther Goldberg, Ying Nian Wu, Hongjing Lu arxiv

Large Multimodal Models (LMMs) demonstrate impressive in-context learning abilities from few multimodal demonstrations, yet the internal mechanisms supporting such task learning remain opaque. Building on prior work of L…

Relational Reasoning

Revisiting the Systematicity in Negation in the Era of In-Context Learning

2026-06-15 · Hitomi Yanaka, Taisei Yamamoto arxiv

Understanding the meaning of negated sentences remains one of the challenges for language models, even in the era of large language models (LLMs). We analyze systematicity regarding LLM understanding of negation from two…