将模型激活分解为可解释组件是机制可解释性中的一个关键开放问题。稀疏自编码器(SAEs)是一种流行的方法,用于将训练好的transformers的内部激活分解为稀疏的、可解释的特征,并已应用于MLP层和残差流。在这项工作中,我们在注意力层输出上训练SAEs,并表明在此处SAEs同样能找到稀疏的、可解释的分解。我们在来自多个模型家族且参数量高达2B的transformers上对此进行了演示。\n我们对注意力层计算的特征进行了定性研究,并发现了多个特征家族:长程上下文、短程上下文和归纳特征。我们对GPT-2 Small中每个头的作用进行了定性研究,并估计至少90%的头是多语义的,即具有多个不相关的角色。\n此外,我们表明稀疏自编码器是一种有用的工具,使研究人员能够比先前的工作更详细地解释模型行为。例如,我们探讨了为什么模型有如此多看似冗余的归纳头的谜团,使用SAEs提出了某些是长前缀而另一些是短前缀的假设,并通过更严格的分析证实了这一点。我们使用SAEs分析了间接对象识别电路(Wang et al.)执行的计算,验证了SAEs能找到具有因果意义的中介变量,并加深了我们对电路语义的理解。我们开源了训练好的SAEs以及一个通过注意力输出SAEs视角探索任意提示的工具。
英文摘要:
Decomposing model activations into interpretable components is a key open problem in mechanistic interpretability. Sparse autoencoders (SAEs) are a popular method for decomposing the internal activations of trained transformers into sparse, interpretable features, and have been applied to MLP layers and the residual stream. In this work we train SAEs on attention layer outputs and show that also here SAEs find a sparse, interpretable decomposition. We demonstrate this on transformers from several model families and up to 2B parameters.
We perform a qualitative study of the features computed by attention layers, and find multiple families: long-range context, short-range context and induction features. We qualitatively study the role of every head in GPT-2 Small, and estimate that at least 90% of the heads are polysemantic, i.e. have multiple unrelated roles.
Further, we show that Sparse Autoencoders are a useful tool that enable researchers to explain model behavior in greater detail than prior work. For example, we explore the mystery of why models have so many seemingly redundant induction heads, use SAEs to motivate the hypothesis that some are long-prefix whereas others are short-prefix, and confirm this with more rigorous analysis. We use our SAEs to analyze the computation performed by the Indirect Object Identification circuit (Wang et al.), validating that the SAEs find causally meaningful intermediate variables, and deepening our understanding of the semantics of the circuit. We open-source the trained SAEs and a tool for exploring arbitrary prompts through the lens of Attention Output SAEs.
What Does a Sparse Autoencoder Feature Do? A Weight-Based Account
State Key Laboratory of General Artificial Intelligence, School of Intelligence Science and Technology, Peking University(通用人工智能国家重点实验室,智能科学与技术学院,北京大学)
Disentangling Dense Embeddings with Sparse Autoencoders
The Australian National University(澳大利亚国立大学);Stanford University(斯坦福大学);Columbia University(哥伦比亚大学);Space Telescope Science Institute(空间望远镜科学研究所);Johns Hopkins University(约翰斯·霍普金斯大学)
From Black Box to Biomarker: Sparse Autoencoders for Interpreting Speech Models of Parkinson's Disease
McGill University(麦吉尔大学);Centre for Research on Brain, Language, and Music(大脑、语言和音乐研究中心);Mila - Quebec AI Institute(魁北克人工智能研究所);Douglas Research Centre(道格拉斯研究中心);Concordia University(Concordia大学)
SAE-FD: Sparse Autoencoder Feature Distillation for Continual Learning of Large Language Models
The Hong Kong University of Science and Technology (Guangzhou)(香港科技大学(广州));Nanjing University of Aeronautics and Astronautics(南京航空航天大学);The 63rd Research Institute, National University of Defense Technology, Nanjing(国防科技大学第六十三研究所,南京)
Evaluating Sparse Autoencoders: From Shallow Design to Matching Pursuit
Harvard University(哈佛大学);Kempner Institute(凯姆纳研究所);Department of Electrical and Computer Engineering, University of Alberta(阿尔伯塔大学电气与计算机工程系);CBS-NTT Program in Physics of Intelligence, Harvard University(哈佛大学物理智能项目);Alberta Machine Intelligence Institute (Amii)(阿尔伯塔机器智能研究所);Neuroscience and Mental Health Institute, University of Alberta(阿尔伯塔大学神经科学与心理健康研究所)
Fully Bayesian Autoencoders with Latent Sparse Gaussian Processes
EURECOM(欧洲通信研究院);University of California, Irvine(加州大学欧文分校)
自动编码器及其变体是表示学习和生成建模中使用最广泛的模型之一。然而,基于自动编码器的模型通常假设学习的表示是i.i.d.。并且不能捕获数据样本之间的相关性。为了解决这个问题,我们提出了一种新的稀疏高斯过程贝叶斯自动编码器(SGPAE)模型,在该模型中,我们对贝叶斯自动编码器的潜在空间施加完全贝叶斯稀疏高斯过程先验。我们通过随机梯度Hamilton Monte Carlo对该模型进行后验估计。我们在广泛的表示学习和生成建模任务上定性和定量地评估了我们的方法,并表明我们的方法始终优于依赖于变分自编码器的多个替代方案。
Can sparse autoencoders make sense of gene expression latent variable models?
Eric and Wendy Schmidt Center, Broad Institute of MIT and Harvard(埃里克和文迪斯中心,哈佛-麻省理工Broad研究所);Department of Computer Science, University of Copenhagen(哥本哈根大学计算机科学系)
Adaptive sampling using variational autoencoder and reinforcement learning
Department of Engineering Cybernetics, Norwegian University of Science and Technology(工程 cybernetics 系,挪威科学与技术大学);Department of Engineering Sciences, University of Agder(工程科学系,阿格德大学)
On the Limits of Sparse Autoencoders: A Theoretical Framework and Reweighted Remedy
State Key Lab of General AI, School of Intelligence Science and Technology, Peking University(1 人工智能通用基础研究实验室,智能科学与技术学院,北京大学);Amazon AGI SF Lab(2 亚马逊人工智能实验室);Institute for Artificial Intelligence, Peking University(3 人工智能研究院,北京大学)