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.
Exploring Context Window of Large Language Models via Decomposed Positional Vectors
Gaoling School of Artificial Intelligence, Renmin University of China(中国人民大学高瓴人工智能学院);Baichuan Inc.(百川公司);School of Information, Renmin University of China(中国人民大学信息学院);Department of Computer Science, National University of Singapore(新加坡国立大学计算机科学系)
Personality Vector: Modulating Personality of Large Language Models by Model Merging
Department of Human-Artificial Intelligence Interaction, Sungkyunkwan University(人类-人工智能交互系,成均馆大学);Department of Immersive Media Engineering, Sungkyunkwan University(沉浸式媒体工程系,成均馆大学)
When Large Language Models Meet Vector Databases: A Survey
Carnegie Mellon University(卡内基梅隆大学);Purdue University(普渡大学);University of Michigan(密歇根大学);Harbin Institute of Technology (Shenzhen)(哈尔滨工业大学(深圳));National Science Library (Chengdu), Chinese Academy of Sciences(中国科学院成都科学图书馆);Shandong University of Technology(山东科技大学)
Internal Value Alignment in Large Language Models through Controlled Value Vector Activation
University of Science and Technology of China(中国科学技术大学);State Key Laboratory of Cognitive Intelligence(认知智能国家重点实验室);Gaoling School of Artificial Intelligence(光明人工智能学院);Renmin University of China(中国人民大学);Beijing Key Laboratory of Research on Large Models and Intelligent Governance(北京大型模型与智能治理重点实验室);Engineering Research Center of Next-Generation Intelligent Search and Recommendation, MOE(下一代智能搜索与推荐工程技术研究中心);Tsinghua University(清华大学);Huawei Technologies Co. Ltd(华为技术有限公司)
Controlling Large Language Models Through Concept Activation Vectors
Key Lab of Intelligent Information Processing of Chinese Academy of Sciences(中国科学院智能信息处理重点实验室);Key Lab of AI Safety of Chinese Academy of Sciences(中国科学院人工智能安全重点实验室);University of Chinese Academy of Sciences(中国科学院大学);Gaoling School of Artificial Intelligence, Renmin University of China(中国人民大学高瓴人工智能学院)
BILLY: Steering Large Language Models via Merging Persona Vectors for Creative Generation
Department of Electrical Engineering, National Taiwan University(国立台湾大学电子工程系);Department of Computer Science & Information Engineering, National Taiwan University(国立台湾大学计算机科学与信息工程系);Graduate Institute of Communication Engineering, National Taiwan University(国立台湾大学通信工程研究所);CSAIL, Massachusetts Institute of Technology(麻省理工学院计算机科学与人工智能实验室)
MEUV: Achieving Fine-Grained Capability Activation in Large Language Models via Mutually Exclusive Unlock Vectors
Xin Tong School of Information and Cyber Security People’s Public Security University of China(信息与网络安全学院 中国人民公安大学);Zhi Lin School of Safety Science Tsinghua University(安全科学学院 清华大学);Jingya Wang School of Information and Cyber Security People’s Public Security University of China(信息与网络安全学院 中国人民公安大学);Meng Han Intelligent Fusion Research Center Zhejiang University(智能融合研究中心 浙江大学);Bo Jin* The Third Research Institute of the Ministry of Public Security of China(中华人民共和国公安部第三研究所)
On the Limitations of Steering in Language Model Alignment
Birla Institute of Technology and Science Pilani(比拉理工科学与 Pilani 学院);National University of Singapore(新加坡国立大学);Institute for Data Science, National University of Singapore(新加坡国立大学数据科学研究院)
Patches of Nonlinearity: Instruction Vectors in Large Language Models
Ubiquitous Knowledge Processing Lab (UKP Lab)(通用知识处理实验室);Department of Computer Science, Technical University of Darmstadt and National Research Center for Applied Cybersecurity ATHENE, Germany(计算机科学系,达姆施塔特技术大学和应用网络安全国家研究中心ATHENE,德国)