阿德利·坦普尔顿、汤姆·科纳利、乔纳森·马库斯、杰克·林赛、特伦顿·布里肯、布莱恩·陈、亚当·皮尔斯、克雷格·西特罗、伊曼纽尔·阿迈森、安迪·琼斯、霍吉·坎宁安、尼古拉斯·L·特纳、卡勒姆·麦克杜格尔、蒙特·麦克迪亚米德、亚历克斯·塔姆金、埃辛·杜尔穆斯、特里斯坦·休姆、弗朗切斯科·莫斯科尼、C·丹尼尔·弗里曼、西奥多·R·萨默斯、爱德华·里斯、约书亚·巴特森、亚当·杰明、尚·卡特、克里斯·奥拉、汤姆·赫尼根
所属机构
发布日期
2024年5月21日
核心贡献者;通讯邮箱:henighan@anthropic.com;作者贡献声明见下文。
八个月前,我们证明了稀疏自编码器能够从一个小型单层Transformer中恢复出单语义特征。当时,一个主要的担忧是,这种方法可能无法切实扩展到最先进的Transformer架构,因此无法对AI安全做出实际贡献。自那以后,扩展稀疏自编码器一直是Anthropic可解释性团队的首要任务,我们很高兴地报告,已从Claude 3 Sonnet中提取出高质量特征。需要说明的是,这是2024年3月4日发布的Claude 3 Sonnet 3.0版本。截至本文撰写时,它正是生产环境中的确切模型。这是经过微调的模型,而非基础预训练模型(尽管我们的方法在基础模型上同样有效)。Anthropic的中等规模生产模型。
我们发现了一系列高度抽象的特征。这些特征既会对抽象行为做出响应,也能在行为层面引发抽象行为。我们发现的特征示例包括:针对名人的特征、针对国家和城市的特征,以及追踪代码中类型签名的特征。许多特征具有多语言性(跨语言响应同一概念)和多模态性(在文本和图像中响应同一概念),同时还涵盖了同一概念的抽象与具体实例化(例如,存在安全漏洞的代码,以及对安全漏洞的抽象讨论)。
我们发现的一些特征尤其值得关注,因为它们可能与安全性相关——也就是说,它们很可能与现代 AI 系统可能造成危害的多种方式有关。具体而言,我们发现了与代码中的安全漏洞和后门、偏见(包括明显的歧视性言论和更微妙的偏见)、撒谎、欺骗和追求权力(包括背叛行为)、谄媚以及危险/犯罪内容(例如,制造生物武器)相关的特征。然而,我们提醒不要对这些特征的存在本身过度解读:例如,了解谎言、有能力撒谎和在实际世界中撒谎之间是有区别的。这项研究也还非常初步。需要进一步的工作来理解这些潜在安全相关特征的含义。
关键结果
稀疏自编码器能为大型模型生成可解释的特征。缩放定律可用于指导稀疏自编码器的训练。由此产生的特征具有高度抽象性:多语言、多模态,并在具体与抽象指代之间进行泛化。概念的出现频率与解析其特征所需的字典大小之间似乎存在系统性关系。这些特征可用于引导大型模型(例如,参见“对行为的影响”)。这扩展了先前使用其他方法引导模型的工作(参见“相关工作”)。我们观察到与广泛安全关切相关的特征,包括欺骗、谄媚、偏见和危险内容。
将字典学习扩展到 Claude 3 Sonnet
我们理解 Claude 3 Sonnet 的总体方法基于线性表示假说(参见相关文献)和叠加假说(参见相关文献)。关于这些概念的介绍,我们建议读者参考《玩具模型》中的背景与动机部分。从高层次来看,线性表示假说认为,神经网络将有意义的概念(称为特征)表示为激活空间中的方向。叠加假说则接受了线性表示的观点,并进一步假设神经网络利用高维空间中近乎正交的方向,来表示比维度数量更多的特征。
如果相信这些假说,那么自然的做法就是采用一种名为字典学习的标准方法。近期,多篇论文表明,这种方法对 Transformer 语言模型相当有效。特别是,字典学习的一种特定近似方法——稀疏自编码器——似乎非常有效。
迄今为止,这些研究主要针对的是现代基础模型标准下相对较小的语言模型。我们之前的论文(聚焦于单层模型)就是一个尤为极端的例子。因此,一个重要的问题悬而未决:这些方法能否适用于大型模型?或者,是否存在某些原因——无论是工程实践层面的问题,还是大型模型运行方式的根本性差异——意味着这些努力无法推广?
这一背景促使我们启动了将稀疏自编码器扩展到 Claude 3 Sonnet(Anthropic 的中型生产模型)的项目。本节剩余部分将回顾我们稀疏自编码器的总体设置、本文将要分析的三款稀疏自编码器的具体细节,以及我们如何利用缩放定律来为稀疏自编码器的设计做出明智决策。在此基础上,我们将深入分析稀疏自编码器学到的特征,以及它们所揭示的 Claude 3 Sonnet 的有趣特性。
稀疏自编码器
本研究的总体目标是将模型(Claude 3 Sonnet)的激活分解为更可解释的组成部分。我们通过在模型激活上训练稀疏自编码器(SAE)来实现这一目标,这与我们之前的工作以及其他多个团队的研究方法一致(例如,参见相关工作)。SAE 是“稀疏字典学习”算法家族的一个实例,这类算法旨在将数据分解为稀疏激活分量的加权和。
我们的 SAE 由两层组成。第一层(“编码器”)通过一个学习到的线性变换,随后接一个 ReLU 非线性激活函数,将激活映射到一个更高维度的层。我们将这个高维层的单元称为“特征”。第二层(“解码器”)试图通过特征激活的线性变换来重建模型激活。该模型的训练目标是同时最小化(1)重建误差和(2)对特征激活施加的 L1 正则化惩罚,后者用于激励稀疏性。
一旦 SAE 训练完成,它就能为我们提供模型激活的近似分解,将其表示为“特征方向”(SAE 解码器权重)的线性组合,其系数等于特征激活值。稀疏性惩罚确保对于模型的许多给定输入,只有极小一部分特征具有非零激活值。因此,对于任何给定上下文中的任何给定 token,模型激活都由一小部分活跃特征(从大量可能的特征中选出)来“解释”。关于 SAE 的更多动机和解释,请参阅《迈向单义性》论文中的“问题设定”部分。
以下是我们方法的简要概述,我们在 2024 年 4 月更新中的《关于我们如何训练 SAE 的最新进展》一文中对此进行了更详细的描述。
作为预处理步骤,我们对模型激活应用标量归一化,使其平均平方 L2 范数等于残差流维度 D。我们将归一化后的激活记为 \mathbf{x} \in \mathbb{R}^D,并尝试使用 F 个特征将该向量分解如下:
\hat{\mathbf{x}} = \mathbf{b}^{dec} + \sum{i=1}^F fi(\mathbf{x}) \mathbf{W}^{dec}{\cdot,i}
其中 \( W^{dec} \in \mathbb{R}^{D \times F} \) 是学习得到的 SAE 解码器权重,\( \mathbf{b}^{dec} \in \mathbb{R}^D \) 是学习得到的偏置项,而 \( f_i \) 表示特征 \( i \) 的激活值。特征激活值由编码器的输出给出:
\( f_i(\mathbf{x}) = \text{ReLU}\left(\mathbf{W}^{enc}_{i, \cdot} \cdot \mathbf{x} + b^{enc}_i \right) \)
其中 \( W^{enc} \in \mathbb{R}^{F \times D} \) 是学习得到的 SAE 编码器权重,\( \mathbf{b}^{enc} \in \mathbb{R}^F \) 是学习得到的偏置项。
损失函数 \( \mathcal{L} \) 由重建损失的 L2 惩罚项和特征激活值的 L1 惩罚项组合而成。
\( \mathcal{L} = \mathbb{E}_{\mathbf{x}} \left[ \|\mathbf{x} - \hat{\mathbf{x}}\|_2^2 + \lambda \sum_i f_i(\mathbf{x}) \cdot \|\mathbf{W}^{dec}_{\cdot,i}\|_2 \right] \)
在 L1 惩罚项中引入 \( \|\mathbf{W}^{dec}_{\cdot,i}\|_2 \) 因子,使我们能够将单位归一化的解码器向量 \( \frac{\mathbf{W}^{dec}_{\cdot,i}}{\|\mathbf{W}^{dec}_{\cdot,i}\|_2} \) 解释为“特征向量”或“特征方向”,并将乘积 \( f_i(\mathbf{x}) \cdot \|\mathbf{W}^{dec}_{\cdot,i}\|_2 \) 解释为特征激活值。这也能防止 SAE 通过让 \( f_i(\mathbf{x}) \) 变小而 \( \mathbf{W}^{dec}_{\cdot,i} \) 变大的方式“欺骗”L1 惩罚项,因为这种方式下重建的激活值保持不变。此后,我们将用“特征激活值”来指代这一乘积量。
我们的 SAE 实验
Claude 3 Sonnet 是一个专有模型,这是出于安全和竞争两方面的原因。本出版物中的某些决策反映了这一点,例如不报告模型规模、在特定图表中省略单位,以及使用简化的分词器。关于 Anthropic 在发布研究成果时如何考虑安全问题的更多信息,我们建议读者参阅我们的《AI 安全核心观点》。
在这项工作中,我们专注于将 SAE 应用于模型中间层(即“中层”)的残差流激活。我们做出这一选择基于几个原因。首先,残差流比 MLP 层更小,这使得 SAE 的训练和推理在计算上更经济。其次,从理论上讲,专注于残差流有助于缓解我们称之为“跨层叠加”的问题(详见局限性部分讨论)。我们选择聚焦于模型的中间层,是因为我们认为该层很可能包含有趣且抽象的特征(例如,参见相关文献)。
我们训练了三种不同规模的 SAE:1,048,576(1M)、4,194,304(4M)和 33,554,432(约 34M)个特征。34M 特征运行的训练步数是通过缩放定律分析选择的,目的是在给定计算预算下最小化训练损失(见下文)。我们使用的 L1 系数为 5。我们的 L1 系数仅与激活归一化的方式相关。完整细节请参阅《关于我们如何训练 SAE 的更新》。我们在较窄的学习率范围内(由缩放定律分析建议)进行了扫描,并选择了损失最低的值。
对于所有三个 SAE,在给定 token 上平均活跃(即非零激活)的特征数均少于 300 个,且 SAE 重建至少解释了模型激活方差的 65%。训练结束时,我们将“死亡”特征定义为在 10^{7} 个 token 样本上未激活的特征。死亡特征的比例在 1M SAE 中约为 2%,在 4M SAE 中约为 35%,在 34M SAE 中约为 65%。我们预计,未来实验中通过改进训练流程可能能够减少死亡特征的数量。
缩放定律
在更大模型上训练 SAE 计算量巨大。理解以下两点至关重要:(1)额外计算能在多大程度上改善字典学习结果,以及(2)在给定计算预算下,应如何分配这些计算资源以获得尽可能高质量的字典。
尽管我们缺乏评估字典学习运行质量的黄金标准方法,但我们发现训练过程中使用的损失函数——即重构均方误差与特征激活的 L1 惩罚项的加权组合——在合理选择 L1 系数的条件下,是一个有用的代理指标。也就是说,我们发现损失值较低(使用 L1 系数为 5)的字典往往能产生可解释的特征,并改善其他感兴趣的指标(L0 范数,以及死亡或退化特征的数量)。当然,这并非一个完美的指标,我们对其是否最优也缺乏信心。很可能其他 L1 系数(或者完全不同的目标函数)会是更优的优化代理指标。
借助这一代理指标,我们可以将字典学习视为一个标准的机器学习问题,并对其应用超参数优化的“规模定律”框架。在 SAE 中,计算资源的使用主要取决于两个关键超参数:要学习的特征数量,以及用于训练自编码器的步数(该步数与使用的数据量呈线性关系,因为我们只对 SAE 训练一个 epoch)。如果输入维度和其他超参数保持不变,计算成本会随这两个参数的乘积而扩展。
我们对这些参数进行了彻底的扫描,同时固定了其他超参数(学习率、批次大小、优化方案等)的值。我们还对追踪损失函数和感兴趣参数的计算最优值感兴趣;也就是说,在给定计算预算下能够达到的最低损失,以及实现该最小值所需的训练步数和特征数量。
我们得出以下观察结果:
在我们测试的范围内,给定计算最优的训练步数和特征数量选择,损失大致按照计算量的幂律递减。
随着计算预算的增加,将 FLOPS 分配给训练步骤和特征数量的最优配置大致都遵循幂律缩放。总体而言,在我们测试的计算预算范围内,最优特征数量的缩放速度似乎略快于最优训练步骤数,不过这一趋势在更高的计算预算下可能会发生变化。
这些分析采用了固定的学习率。针对不同的计算预算,我们随后根据上图所示的最优参数设置,对学习率进行了网格搜索。推断出的最优学习率大致随计算预算的增加而呈幂律下降,我们据此趋势外推,为更大规模的运行选择了学习率。
评估特征可解释性
在上一节中,我们描述了如何在 Claude 3 Sonnet 上训练稀疏自编码器。正如缩放定律所预测的那样,通过训练大型 SAE,我们实现了更低的损失。但损失只是我们实际关注目标的一个代理指标:即能够解释模型行为的可解释特征。
本节的目标是探究这些特征是否真正可解释,并且能否解释模型行为。我们将首先查看几个相对简单的特征,并提供证据表明它们是可解释的。接着,我们将研究两个更为复杂的特征,并展示它们追踪的是非常抽象的概念。最后,我们将通过一项使用自动可解释性技术的实验,来评估更多数量的特征,并将它们与神经元进行比较。
四个可解释特征的示例
在本小节中,我们将查看几个特征,并论证它们确实是可解释的。我们的目标仅仅是证明可解释特征的存在,而将更强的主张(例如大多数特征都是可解释的)留待后续章节讨论。我们将采用类似于《迈向单语义性》一文中的分析方法,提供证据表明我们的解释是对这些特征所代表内容及其在网络中运作方式的良好描述。
我们在本节中研究的特征会对以下内容做出响应:
金门大桥 34M/31164353:对金门大桥的描述或提及。脑科学 34M/9493533:关于神经科学及大脑或心智相关学术研究的讨论。纪念碑与热门旅游景点 1M/887839 交通基础设施 1M/3
在本文此处及其他地方,对于每个特征,我们展示了 SAE 数据集中排名前 20 的文本输入的代表性示例,排序依据是它们激活该特征的强度(详见附录)。点击特征 ID 可以查看一个更大的、随机采样的激活集。高亮颜色表示每个 token 处的激活强度(白色:无激活,橙色:最强激活)。
34M/31164353 金门大桥
嗯(就是金门大桥旁边那个巨大的公园),完美。但并不是所有人都能住在
横跨全国来到旧金山,金门大桥始终由一位警惕的守护者保护着
的橙红色,它常被比作美国旧金山的金门大桥。它由
很难到达,如果我们想在日落前看到金门大桥,就必须上路了,所以
它?” “因为它上面有什么。” “金门大桥。” “堡垒正对着锚地和
34M/9493533 脑科学
------⏎mj lee⏎我非常喜欢那些能改变我对感知看法的神经科学书籍。⏎⏎幻 想
它将工程师和神经科学家聚集在一起。如果你喜欢模拟、数字、人
设法追踪到它并重新买了下来。这本书是 20 世纪 60 年代的,但里面有一些非常棒
对认知科学感兴趣,我应该学习神经科学,还是其他领域,或者
格拉齐亚诺的《意识与社会脑》是一个很好的起点。⏏⏏------⏏ozy⏏我想要一个
1M/887839 纪念碑与热门旅游景点
美丽的国家,美得有点诡异。蓝色泻湖看起来令人惊叹,但泡在里面太贵了
埃及值得参观的有趣景点。金字塔比这座建筑更古老、更粗糙,而
有一种美。” “那阿拉莫呢?” “人们……” “哦,阿拉莫。” “是的,那是个很酷的地方”
2012年我去卢浮宫时,能直接走到蒙娜丽莎画像前,完全不用排队。
像圣地亚哥动物园和海洋世界这样的大型旅游景点,你至少得去一次。
1M/3 交通基础设施
几乎每条铁路线都必须经过某座特定的桥梁,这形成了一个巨大的瓶颈。无论是地铁还是高架铁路
我们在途中遇到了多次延误。由于奥克兰和旧金山之间的水下隧道是一个瓶颈
在桥梁/隧道入口处以及市中心/核心区,人们正试图离开等等
资金耗尽,原本计划继续向北穿过水道前往雷克瑟姆的方案被迫放弃。
运行中。跨湾隧道尤其需要高度关注。如果湾区捷运
虽然这些例子为每个特征提出了解释,但仍需开展更多工作来验证我们的解释是否真正捕捉到了相应特征的行为和功能。具体而言,对于每个特征,我们试图确立以下论断:
- 当特征被激活时,相关概念确实存在于上下文之中(特异性)。
- 对特征激活进行干预会产生相关的下游行为(对行为的影响)。
特异性
严格衡量文本输入中某个概念的存在程度是困难的。在我们之前的工作中,我们专注于那些明确对应特定token集合(例如阿拉伯文字或DNA序列)的特征,并根据特征的激活状态,计算该token集合相对于词汇表中其他token出现的可能性。这种技术无法推广到更抽象的特征。因此,为了在本工作中展示特异性,我们更多地利用了自动化可解释性方法(类似于)。我们使用了与之前“特征与神经元”部分相同自动化可解释性流程,此外我们还发现,当前一代模型现在能够更准确地根据文本样本与所提出的特征解释的匹配程度来对其进行评分。
我们制定了以下评分标准,用于评估特征描述与其激活文本之间的关联程度。随后,我们请 Claude 3 Opus 依据该标准,对多个 token 位置上的特征激活情况进行评分。
0 分——该特征在整个上下文中完全无关(相对于互联网的基础分布)。1 分——该特征与上下文相关,但与高亮文本距离较远或仅存在模糊关联。2 分——该特征与高亮文本关联较弱,或与高亮文本附近的上下文相关。3 分——该特征能够清晰识别出激活文本。
通过对激活文本示例进行评分,我们为每个特征提供了特异性度量。我们还手动检查了大量示例,以确保整体处理正确。本节选取的特征均具有直观的解释,旨在使自动化可解释性分析更加可靠。这些特征并不代表我们 SAE 中所有特征的典型样本。后续,我们将对随机采样特征的可解释性进行分析。此外,本文还将深入探索更多具有有趣解释的特征,这些解释往往更为抽象或微妙,因此也更难进行定量评估。
下面我们展示了上述四个特征的特征激活分布(排除零激活值),并附带了能够引发低激活和高激活的文本与图像输入示例。请注意,尽管我们仅基于文本数据集进行字典学习,但这些特征同样会在相关图像上产生激活。
首先,我们研究了一个金门大桥特征 34M/31164353。其最大激活值几乎全部指向这座桥的引用,而较弱激活值则包括相关的旅游景点、类似桥梁以及其他纪念碑。接下来,一个脑科学特征 34M/9493533 在讨论神经科学书籍和课程,以及认知科学、心理学和相关哲学时被激活。在 100 万次训练运行中,我们还发现了一个特征,它对各种交通基础设施 1M/3 有强烈激活,包括火车、渡轮、隧道、桥梁,甚至虫洞!最后一个特征 1M/887839 对热门旅游景点有响应,包括埃菲尔铁塔、比萨斜塔、金门大桥和西斯廷教堂。
为了量化特异性,我们使用 Claude 3 Opus 根据上述评分标准自动对激活这些特征的示例进行评分,从用于训练字典学习模型的数据集中提取了大约 1000 个该特征的激活实例。我们绘制了每个评分标准得分作为特征激活水平函数的频率分布图。我们发现,引发强特征激活的输入都被判定为与所提出的解释高度一致。
正如《迈向单义性》一文所述,我们发现随着激活强度减弱,这些特征的特异性会降低。这可能是由于模型利用激活强度来表示某个概念存在的置信度。或者,也可能是特征对于该特征的典型样例激活最强,而对于相关概念则激活较弱——例如,金门大桥特征 34M/31164353 似乎对其他旧金山地标也有微弱激活。这也可能反映了我们字典学习过程中的不完善之处。例如,自编码器的架构可能无法像我们期望的那样干净地提取和区分特征。当然,来自并非完全正交的特征的干扰也可能是原因之一,这使得 Sonnet 本身更难在完全正确的样例上激活特征。另一种合理的可能是,我们对特征的解释略微歪曲了特征的实际功能,而这种不准确性在较低激活水平下表现得更为明显。尽管如此,我们经常发现较低的激活往往仍能保持与我们解释的某种特异性,包括相关概念或核心特征的泛化。作为一个说明性示例,交通基础设施特征 1M/3 的弱激活包含了描述特定零件应使用哪些通孔的操作机械指令。
此外,我们预计非常微弱的特征激活并不特别有意义,因此我们并不太担心这些激活范围的低特异性分数。例如,我们观察到,将低于某个阈值的特征激活四舍五入为零等技术,可以在不显著增加 SAE 重建误差的情况下,提高低激活端光谱的特异性,并且文献中存在多种可能解决同一问题的技术。
无论如何,对模型行为影响最大的激活是那些最大的激活,因此看到强激活具有高特异性是令人鼓舞的。
需要注意的是,我们在以可扩展且严谨的方式量化特征敏感性——即特征对于符合我们拟议解释的文本激活的可靠性——方面遇到了更大的困难。这是因为难以以无偏的方式生成与某个概念相关的文本。此外,许多特征可能代表比我们通过可视化所能获取的更具体的内容,在这种情况下,它们不会可靠地响应基于我们拟议解释所选择的文本,而且特征越抽象,这个问题就越棘手。不过,作为一项基本检查,我们观察到,金门大桥特征在维基百科上关于金门大桥的条目的第一句话(在移除所有英文括号内容后)的各种语言版本中仍然强烈激活。事实上,对于下面的每个示例,金门大桥特征都是平均激活值最高的特征。
34M/31164353 金门大桥多语言示例
金门大桥是一座位于美国加利福尼亚州旧金山的悬索桥,它跨越联接旧金山湾和太平洋的金门海峡,南端连接旧金山的北端,北端接通马林县。
金门大桥(Golden Gate Bridge)是一座横跨美国西海岸旧金山湾与太平洋连接处的金门海峡的吊桥。
金门大桥(Golden Gate Bridge)或金门桥是一座位于美国加利福尼亚州金门海峡的悬索桥。金门大桥连接加利福尼亚州旧金山和加利福尼亚州马林县。
金门大桥是一座横跨金门海峡的悬索桥。它连接了旧金山半岛北部的旧金山市和南部的马林县部分地区,靠近索萨利托郊区。
金门大桥或金门桥是一座横跨金门海峡的吊桥,该海峡宽一英里(1.6公里),连接旧金山湾和太平洋。
金门大桥是一座横跨金门海峡的悬索桥,该海峡是旧金山湾通往太平洋的入口。
我们将对这个问题的进一步研究留待未来工作。
对行为的影响
接下来,为了验证我们对特征的解释是否准确描述了它们对模型行为的影响,我们进行了特征引导实验。在前向传播过程中,我们将特定感兴趣的特征“钳制”到人为设定的高值或低值(具体实现细节见方法学细节部分)。这项工作建立在通过修改特征激活来检验因果理论的长期研究传统之上,也借鉴了其他模型引导方法的相关工作(详见相关工作部分)。我们使用 Sonnet 通常使用的“人类:”/“助手:”格式的提示词进行这些实验。我们发现,特征引导在以特定、可解释的方式修改模型输出方面效果显著。它可以用来改变模型的举止、偏好、陈述的目标和偏见;诱导模型犯特定错误;以及绕过模型的安全防护措施(另见安全相关特征部分)。我们认为,这是强有力的证据,表明我们对特征的解释与模型实际使用这些特征的方式是一致的。
例如,我们发现,将金门大桥特征 34M/31164353 钳制到其最大激活值的 10 倍,会诱导出主题相关的模型行为。在这个例子中,模型开始自我认同为金门大桥!类似地,将交通基础设施特征 1M/3 钳制到其最大激活值的 5 倍,会导致模型在原本不会提及的情况下提到一座桥。在每种情况下,该特征的下游影响似乎都与我们对特征的解释一致,尽管这些解释仅基于特征激活的上下文得出,而我们是在特征未激活的上下文中进行干预的。
复杂特征
到目前为止,我们展示了 Claude 3 Sonnet 中那些针对相对简单概念激活的特征。这些特征在某些方面与《迈向单义性》一文中发现的特征相似,后者由于是在单层 Transformer 的激活值上训练的,因此反映的是非常浅层的世界知识。例如,我们发现了与在相当通用的上下文中预测一系列常见名词相对应的特征(例如,在生物学语境中,跟在“the”后面的生物学名词)。
相比之下,Sonnet 是一个规模更大、更复杂的模型,因此我们预期它包含的特征能够展现出理解的深度和清晰度。为了研究这一点,我们寻找了在编程语境中激活的特征,因为这些语境允许对代码的正确性或变量类型等做出精确的陈述。
代码错误特征
我们首先考虑一个用于两个参数相加的简单 Python 函数,但它存在一个错误。其中一个特征 1M/1013764 在遇到一个被错误命名为“rihgt”的变量时几乎持续激活(如下高亮所示):
这当然很可疑,但它可能是一个 Python 特有的特征,因此我们进行了检查,发现 1M/1013764 在 C 和 Scheme 语言中类似的错误上也会激活:
为了检验这是否是一个更通用的拼写错误特征,我们在英文散文中的拼写错误示例上测试了 1M/1013764,发现它并不会在这些情况下激活。
所以它不是一个通用的“拼写错误检测器”:它对代码语境有一定的特异性。
但 1M/1013764 仅仅是一个“代码中的拼写错误”特征吗?我们还在许多其他示例上对其进行了测试,发现它也会在错误的表达式(例如,除以零)以及函数调用中的无效输入上激活:
上面展示的两个示例代表了一种更广泛的模式。通过查看该特征激活的数据集示例,我们发现它会在以下情况激活:
数组溢出 断言可证明为假的声明(例如 1==2) 用字符串而非整数调用函数 除以零 将字符串与整数相加 写入空指针 以非零错误码退出
以下是一些排名靠前的数据集示例:
1M/1013764代码错误
函数 this Function C ras hes() 未定义 Variable() 结束⏎ > f({this Function C ras hes})⏎ 标准输入:
urllib.request.urlopen('https://wrong.host.bad ssl.com/')⏎ 除了 (IOError, OSError):⏎ 跳过
: (def 宏 mac (表达式)⏎ 2: (/ 1 0))⏎ 3: (mac foo)⏎ ⏎ $ tx r 宏-错误-
不是有效 Python 模块"0002 st = Py Import(bad mod)0003 IF @PY 异常类型 NE '' THEN 0004
模板 void f(T t) { t.h ah aha IC r ash(); } void f(...) { } // 这个 sink-hole 甚至没有被 co
睡眠 5⏎ 退出 1⏎ 结束脚本⏎ wing-command er sc ott
ke⏎⏎ ⏎ ⏎ [[不安全]] {⏎ ((void)0) = 0 x DEAD;⏎ }⏎ ⏎⏎本质上,拥有一种能
在提示词末尾加上“thank you. enjoy.>>”(表示正在编写新的一行代码),并将该特征钳制为较大的负激活值,模型就会重写代码,消除这个 bug!
最后一个例子有些微妙——“代码重写”行为对提示词的细节很敏感——但这一现象本身的存在,就表明了该特征与模型对代码中 bug 的理解之间存在深层联系。
表示函数的特征
我们还发现了能够追踪特定函数定义及其在代码中引用的特征。一个特别有趣的例子是加法特征 1M/697189,它会对执行加法运算的函数名称产生激活。例如,当“bar”被定义为执行加法时,该特征会触发;但当它被定义为执行乘法时,则不会触发。此外,在任何实现加法的函数定义结束时,该特征也会触发。
值得注意的是,该特征甚至能正确处理函数组合——当函数调用其他执行加法的函数时,它也会产生激活。在下面的例子中,左侧我们将“bar”重新定义为调用“foo”,因此继承了后者的加法操作,导致特征触发。右侧,“bar”改为调用“goo”中的乘法操作,特征则未触发。
我们还验证了这一特征确实参与了模型与加法相关函数的计算过程。例如,当模型被要求执行一段涉及加法函数的代码时,该特征位列归因强度前十的特征之中(详见"作为计算中间变量的特征"章节)。
因此,该特征似乎表征了模型正在执行的加法运算功能,这与 Todd 等人提出的函数向量概念不谋而合。为验证这一假设,我们尝试在不涉及加法的代码中强制激活该特征。实验发现,模型会被"欺骗",误认为自己被要求执行加法运算。
特征与神经元
关于稀疏自编码器(SAE)的一个自然问题是:它们所揭示的特征方向是否比模型神经元更具可解释性,甚至与神经元截然不同?我们将 SAE 应用于残差流活动——该空间近似而言不存在特权基(但需注意例外情况)——因此残差流中的方向本身并无特殊含义。然而,残差流活动接收来自所有前序 MLP 层的输入。因此,理论上存在这种可能:SAE 在残差流中识别出的特征方向,其活动模式反映的是前序层中单个神经元的活动。若果真如此,拟合 SAE 便无太大价值,因为直接检查 MLP 神经元同样能识别出这些特征。
为了回答这个问题,我们针对 100 万规模 SAE 中的随机特征子集,测量了其激活值与所有前置层中每个神经元的激活值之间的皮尔逊相关系数。与我们在《迈向单语义性》中的发现类似,我们发现绝大多数特征都不存在强相关的神经元——对于 82% 的特征,其最相关神经元的相关系数仅为 0.3 或更低。通过人工检查一组随机特征的最佳匹配神经元可视化结果,我们发现特征与对应神经元在语义内容上几乎不存在相似性。我们还进一步确认,特征激活值与残差流中任何基方向的激活值均无强相关性。
即使字典学习特征与任何单个神经元都不存在高度相关性,神经元本身仍有可能具有可解释性。然而,在对各 50 个神经元和特征进行随机抽样并人工检查后,我们发现神经元的可解释性明显低于特征,它们通常会在多个不相关的上下文中被激活。
为了量化这一差异,我们首先比较了 100 个随机选取的特征与 100 个随机选取的神经元的可解释性。我们采用了与《迈向单语义性》中相同的自动化可解释性方法,但改用 Claude 3 Opus 来提供特征解释并预测其留出激活值。我们发现,随机选取的 SAE 特征的平均可解释性显著高于随机选取的 MLP 神经元。
我们还使用上述自动化特异性评估标准,对随机神经元和 SAE 特征的特异性进行了评估。结果表明,随机选取的 SAE 特征激活值比前一层神经元的激活值具有显著更高的特异性。
特征调查
我们在 Sonnet 中发现的特征丰富多样。这些特征涵盖名人、世界各地区(国家、城市、街区,甚至著名建筑!)、计算机程序中类型签名的追踪,以及更多其他内容。本节的目标是呈现这种广度。
一个挑战在于我们拥有数百万个特征。扩展特征探索是一个重要的开放性问题(参见局限、挑战与开放问题),本文并未解决该问题。尽管如此,借助自动化可解释性,我们在刻画特征空间方面取得了一定进展。我们将首先聚焦特征的局部结构——这些特征通常以几何相关的聚类形式组织,共享语义关联。随后转向理解特征的更全局属性,例如它们对特定主题或类别的覆盖全面性。最后,我们将审视通过人工检查发现的一些特征类别。
探索特征邻域
此处我们遍历 1M、4M 和 34M SAE 中若干感兴趣特征的局部邻域,以特征向量的余弦相似度衡量邻近程度。我们发现这始终能揭示出共享相关含义或上下文的特征——交互式特征 UMAP 提供了更多可供探索的邻域。
金门大桥特征
聚焦金门大桥特征 34M/31164353 周围的小范围邻域,我们发现存在对应旧金山特定地点的特征,例如恶魔岛和普雷西迪奥。距离稍远处,还能看到关联度递减的特征,如与太浩湖、优胜美地国家公园和索拉诺县(邻近旧金山)相关的特征。在更远距离上,还出现了更抽象关联的特征,例如对应其他地区旅游景点的特征(如"法国梅多克葡萄酒产区"、"苏格兰斯凯岛")。总体而言,解码器空间中的距离大致映射到概念空间中的关联度,且往往以有趣且出人意料的方式呈现。
我们还发现了特征分裂的证据,这是一种在较小 SAE 中的特征“分裂”成较大 SAE 中的多个特征的现象,这些特征在几何上接近且语义上与原始特征相关,但代表了更具体的概念。例如,1M SAE 中的一个“旧金山”特征在 4M SAE 中分裂成两个特征,在 34M SAE 中分裂成十一个细粒度特征。
除了特征分裂,我们还看到一些例子,其中较大的 SAE 包含代表较小 SAE 中特征未捕捉到的概念的特征。例如,4M 和 34M SAE 中有一组地震特征,在 1M SAE 的该邻域中没有对应物,并且最近的 1M SAE 特征似乎也与之无关。
免疫学特征
我们旅程中的下一个特征邻域围绕着一个免疫学特征 1M/533737 展开。
我们在这个邻域内看到了几个不同的簇。在图的顶部,我们看到一个聚焦于免疫功能低下人群、免疫抑制、导致免疫功能受损的疾病等的簇。当我们向左下方移动时,这过渡到一个专注于特定疾病(感冒、流感、一般呼吸道疾病)的特征簇,然后是免疫反应相关特征,再然后是代表涉及免疫的器官系统的特征。相比之下,当我们从免疫功能低下簇向右下方移动时,我们看到更多对应于免疫系统微观方面的特征(例如免疫球蛋白),然后是免疫学技术(例如疫苗),等等。
在底部,与其他部分相当分离的地方,我们看到一个与非医学语境(例如法律/社会)中的免疫相关的特征簇。
这些结果与上述趋势一致,即字典向量空间中邻近的特征涉及相似的概念。
内心冲突特征
我们最后详细研究的邻域,围绕着一个“内心冲突”特征 1M/284095 展开。虽然这个邻域并未清晰地划分出聚类,但我们仍然发现,不同的子区域与不同的主题相关联。例如,有一个子区域对应“权衡取舍”,它紧邻一个对应“对立原则与法律冲突”的子区域。这些子区域与另一个更侧重于“情感挣扎、不情愿和内疚”的子区域相距较远。
我们强烈建议您使用我们的交互式界面,探索其他特征的邻域,以直观感受解码器空间中的邻近性如何对应概念的相似性,以及所呈现概念的广度。
特征完备性
我们很好奇,我们的特征在覆盖概念空间方面具有怎样的广度和完备性。例如,模型是否拥有对应每一个世界主要城市的特征?为了研究此类问题,我们使用 Claude 来搜索那些在特定概念/术语族成员上被激活的特征。具体方法如下:
- 我们将包含相关概念(例如“物理学家理查德·费曼”)的提示词输入模型,并观察哪些特征在最后一个 token 上被激活。
- 然后,我们选取激活幅度最高的前五个特征,通过我们的自动化可解释性流程进行处理,要求 Sonnet 提供这些特征在什么情况下会被激活的解释。
- 接着,我们查看这前五个解释中的每一个,并由人类评估员判断:该概念,或该概念的某个子集,是否被模型生成的解释明确指认为该特征最重要的部分。作为我们如何划定界限的一个例子,提及“20 世纪中期的物理学家,如理查德·费曼”不算,但提及“20 世纪中期的物理学家,尤其是理查德·费曼”则(勉强)算,不过大多数情况要明确得多。
我们发现,随着特征数量的增加,概念的覆盖范围也在扩大,但即使在 3400 万特征的 SAE 中,我们仍有证据表明,已发现的特征集对模型内部表示的描述并不完整。例如,我们确认 Claude 3 Sonnet 在被问及时能够列出伦敦所有的行政区,并且实际上能说出许多区域中数十条具体街道的名称。然而,在 3400 万特征的 SAE 中,我们只能找到大约 60% 的行政区对应的特征。这表明模型中包含的特征远多于我们目前发现的,这些特征或许可以通过更大的 SAE 来提取。
我们还更详细地研究了决定某个概念对应的特征是否存在于我们 SAE 中的因素。如果观察 SAE 训练数据代理中元素的出现频率,我们发现字典中的表示与概念在训练数据中的出现频率密切相关。例如,在训练数据中频繁提及的化学元素几乎总能在我们的字典中找到对应特征,而那些很少或从未被提及的元素则没有。由于 SAE 是在与 Sonnet 预训练数据非常相似的数据混合集上训练的,因此尚不清楚特征学习在多大程度上依赖于模型训练数据中的频率,而非 SAE 训练数据中的频率。训练数据中的频率是通过搜索 [Name] 来衡量的,这会在某些情况下导致误报,例如元素“lead”。
我们使用四个不同类别的概念——元素、城市、动物和食物(水果和蔬菜)——量化了这种关系,每个类别包含 100 到 200 个概念。我们重点关注那些可以用单个单词明确表达(即该单词很少有其他常见含义)且在文本数据中频率分布广泛的概念。我们发现,一个一致的趋势是,更大的 SAE 能够为训练数据中更罕见的概念找到特征,而特征存在所需的大致“阈值”频率在不同类别之间是相似的。
值得注意的是,在三次运行中,训练数据中词典对某个概念的包含概率超过 50% 的频率,始终略低于存活特征数量的倒数(3400 万参数的模型仅有约 1200 万个存活特征)。我们可以通过按存活特征数量重新缩放每条线的 x 轴来更清晰地展示这一点,结果发现这些线最终大致重叠,遵循一条在 log-频率空间中类似 S 形曲线的共同轨迹。推测而言,这可能与齐普夫定律有关——这是一种常见现象,即群体中第 n 个最常见对象的频率,相对于最常见对象,大致为 1/n。齐普夫定律会预测,例如,第一百万个特征所代表的概念,其出现频率比第十万个特征所代表的概念要低 10 倍。
这一发现让我们对 SAE 的规模有了一定把握——即我们应预期在何种规模下会出现针对特定概念的特征。如果一个概念在训练数据中每十亿个 token 才出现一次,那么我们需要一个拥有约十亿个存活特征的词典,才能找到一个唯一代表该特定概念的特征。重要的是,没有专门针对某个特定概念的特征,并不意味着重建的激活值不包含关于该概念的信息,因为模型可以组合使用多个相关特征来指代某个特定概念。例如,如果存在“大型非首都城市”和“在纽约州”这两个特征,它们组合起来就足以指代纽约市。
这也告诉我们,训练更大规模的词典需要多少数据——如果我们假设 SAE 在训练过程中需要看到与某个特征对应的数据达到一定固定次数才能学会该特征,那么学习 N 个特征所需的 SAE 训练数据量将与 N 成正比。
特征类别
通过人工检查,我们识别出其他几个有趣的特征类别。在此我们描述其中若干类别,旨在展示我们在词典中观察到的现象,而非试图做到全面或规定性。
人物特征
首先,我们发现许多与知名人物对应的特征,这些特征在描述这些人物及相关历史背景时会被激活。
4M/850812 理查德·费曼
ri um vark⏎费曼在他的一个关于对称性的讲座中讨论了这个问题。他似乎⏎暗示
d 概率。“来认识一下理查德·费曼:派对狂人、嗜赌成性、堪称天才。”“费
⏎债务⏎这让我想起理查德·费曼说过的话:⏎⏎“然后我又有了另一个想法:物理学伪装
e 立方体。⏎⏎------⏎zk hal ique⏎理查德·费曼在他的采访中说,我们不知道为什么水会膨胀⏎
s/回忆录? - 啤酒杯⏎⏎⏎======⏎ar h 68⏎理查德·费曼写了不少大致属于传记类的书籍。
4M/2123312 玛格丽特·撒切尔
⏎玛格丽特·撒切尔今天去世了。一位伟大的女士,她改变了英国⏎政治的面貌,创造了机遇
事件和⏎八十年代。我清楚地记得看着她走进唐宁街,我母亲⏎告诉我
为什么英国有那么多工人阶级在⏎1980年代投票给撒切尔?为什么他们没有大规模
ell⏎一氧化二氢⏎⏎⏎⏎前首相撒切尔男爵夫人去世,享年87岁 - m med⏎http://www.bbc.co.
故事,那些玛格丽特·撒切尔担任首相时的伟大对抗。”“或者托尼的真实故事
4M/2060539 亚伯拉罕·林肯
他身上有太多面了。”“关于林肯,我觉得奇怪的一点是,他能把自己从
从……的角度来写这部戏……林肯最伟大的崇拜者之一。”“你知道吗,亚伯有个
关于内战。”“你知道吗,亚伯拉罕·林肯解放了所有奴隶?”“嗯,我听到一个传闻。
正如男人们所计划的。”“在所有男人中,亚伯拉罕·林肯最接近理解发生了什么
⏎代码。(请在这里证明我错了!)⏎⏎⏎⏎为什么亚伯·林肯今天会无家可归 - j mad sen⏎http://www.c
4M/1068589 阿梅莉亚·埃尔哈特
iji 并失踪了。”“这些会是阿梅莉亚·埃尔哈特的遗骨吗?”“一项新的搜索正在进行中,在菲
他按下按钮,模拟了击落阿梅莉亚·埃尔哈特飞机的风暴。”“[尖叫]”“不!”“别再
"盖茨:"阿梅莉亚·埃尔哈特正在她历史性环球飞行的最后几段航程中,这时一些
事情让人产生一种惊奇感。" "她于1937年尝试环球飞行时失踪,这件事至今仍
你在跟谁说话?" "那是谁?" "是阿梅莉亚·埃尔哈特。" "你找到阿梅莉亚·埃尔哈特了?" "我……" "嘿!"
4M/1456596阿尔伯特·爱因斯坦
如果我没记错的话,丹·布莱恩在《爱因斯坦:一生》一书中讲述了这件事。我记得
引用了编程学习体验中的一部分。爱因斯坦的思想实验 - peterthehacker http
.wikipedia.org/wiki/Relics: Einstein%27s_Brain) 静态噪声 这部纪录片确实很特别
存在一些问题,而且用户界面相当难看。爱因斯坦、海森堡和蒂普勒(2005年),作者约翰·沃克
拼写错误以及句中代词大写。爱因斯坦的科学超越了民族主义,跨越了国界
4M/1834043罗莎琳德·富兰克林
//en.wikipedia.org/wiki/Rosalind_Franklin) 正是她的X射线图像导致了分子
第二种是长而细的潮湿样品。富兰克林选择研究A型,她的工作使她
一个臭名昭著的例子是罗莎琳德·富兰克林,她的研究成果很可能被沃森和克里克窃取
=15 59 40 25 17) ------ ty ch on off 为什么罗莎琳德·富兰克林没有获得诺贝尔奖? 根据
据我所知,这个人是罗莎琳德·富兰克林[1],她在X射线晶体学领域做出了开创性贡献
国家特征
接下来,我们看到一些特征只在提及特定国家时才会强烈激活。从激活程度最高的示例可以看出,其中许多特征不仅在国家名称本身出现时激活,在描述该国家时也会激活。
34M/805282卢旺达
此类测试的值。卢旺达,一个中非国家,在一代人之前经历了社会动荡
卢旺达去年出口了价值2.5亿美元的钶钽铁矿。不知道钶钽铁矿是什么?它是一种
麦克风和令人惊叹的风景……" "'……我们到达了卢旺达的另一侧,与坦桑尼亚接壤的边境。'"
一个只有2万人口的小城市,但卢旺达是一个拥有1200万人口的国家(现在加纳的大部分地区,人口2800万
你会很感兴趣地了解到,卢旺达的统治者保罗·卡加梅专门组建了一个团队,目的是为了
34M/29297045加拿大
“加拿大,一个以其自然奇观、全民医保和极其礼貌的人民而闻名的国家
感到放松。⏎⏎此外,由于加拿大享有“人人享有免费医疗”的声誉,看起来
-----⏎jp po pe⏎我投票让加拿大来管理世界。用善良杀死他们!再加上节礼日会让
很好,并且值得信赖,仅仅是因为加拿大的所谓声誉。⏎⏎------⏎t ay bin⏎这相当
唉,算了。加拿大曾经看起来像是文明世界最后的堡垒。哈珀等人一手造成了这一切,
34M/5381828比利时
越来越多的老年人。⏎⏎~~~⏎r urban⏎尤其是比利时。到目前为止,它是没有合理解释的最高异常值
ri C^^:我们有一个奇怪的小国家⏎ E ri C^^:比利时华夫饼、巧克力、炸薯条和
荷兰只有一种语言,即荷兰语。比利时有两种:北部地区讲荷兰语,南部地区
在整个欧洲都有重复,例如在比利时,北部的荷兰语使用者要富裕得多
负责做披萨和拿铁咖啡。⏎⏎⏎⏎比利时:500天没有政府。 - sk bo hra 123⏎http://www.h u
34M/32188099冰岛
“文明”是否真的那么文明。冰岛是一个小国,人口相对较少,联系紧密
这是更短的⏎⏎⏎冰岛成为第一个立法规定同工同酬的国家 - d acm⏎http://www.al j azeera.co
在冰岛的这最后一期节目中,因为这里是北欧最古老民主制度的所在地。
ll M tl 酒精 c⏎有点跑题,但冰岛是我去过的最美丽的地方。那里
地球上的斯奈菲尔火山。” “1980年,冰岛人选举出了世界上第一位女总统。”
基础代码特征
我们还看到许多特征代表了代码中不同的语法元素或其他底层概念,当它们被可视化在一起时,会给人语法高亮的感觉(这里为了简化,我们对激活信息进行了二值化处理,仅区分零激活和非零激活):
这些特征主要被选择为在 Python 示例上激活。我们发现,Python 代码特征存在一定程度的迁移,能作用于 Java 等相近语言,但无法迁移到差异更大的语言(例如 Haskell),这表明至少存在一定程度的语言特异性。我们推测,更抽象的特征更有可能跨越多种语言,但迄今为止只找到了一个具体实例(参见代码错误特征)。
列表位置特征
最后,我们看到一些特征会在列表中特定位置激活,无论这些位置上的内容是什么:
请注意,这些特征不会在第一行激活。这很可能是因为模型在到达第二行之前,并未将提示词解读为包含列表。
我们目前仅触及了这些 SAE 中特征的表面,并预计在未来的工作中会发现更多。
作为计算中间结果的特征
特征的另一个潜在应用是,它们使我们能够检查模型用于生成输出所进行的中间计算。作为概念验证,我们观察到,在需要中间计算的提示词中,会发现与某些预期中间结果相对应的活跃特征。
一种高效识别模型输出因果重要特征的简单策略是计算归因,即对在特定位置关闭某个特征对模型下一个 token 预测的影响进行局部线性近似。更具体地说:我们计算目标输出 logit 与另一个特定基线 token 的 logit(或所有 token 的 logit 平均值)之间的差值,相对于中间层残差流激活值的梯度。然后,该 logit 差值对某个特征的归因定义为该梯度与特征向量(SAE 解码器权重)的点积,再乘以该特征的激活值。该方法等同于《归因修补:工业规模的激活修补》中引入的“归因修补”技术,区别在于我们使用 0 作为特征的基线值,而不是从第二个提示词中该特征的活动值中获取基线值。我们还执行特征消融,即在一次前向传播过程中将某个特征在特定 token 位置的值钳制为零,从而测量该特征在该位置的激活对模型输出的完整、可能非线性的因果效应。这种方法要慢得多,因为它需要对每个位置激活的每个特征进行一次前向传播,因此我们通常将归因作为初步步骤,以筛选出要消融的特征集。(在下面展示的案例研究中,为了完整性,我们对每个活跃特征都进行了消融,并发现归因与消融效应之间的相关性为 0.8;详见附录。)
我们发现模型中间层的残差流包含一系列与模型补全结果存在因果关系的特征。
示例:情感推断
例如,我们考虑以下不完整的提示词:
约翰说:“我现在想一个人待着。”约翰感到
(补全:悲伤 − 快乐)
为了继续这段文本,模型必须解析约翰的引语,识别他的心理状态,然后将其转化为一种可能的感受。
如果我们根据特征对补全结果“sad”(相对于基线补全结果“happy”)的归因或消融效应进行排序,排名前两位的特征是:
1M/22623 – 该特征在某人表达需要或渴望独处、拥有个人时间或空间时被激活,例如“她可能想要一些独处的时间”。该特征从单词“alone”开始激活。这表明模型已经理解了约翰表达的核心意思。1M/781220 – 该特征检测悲伤、哭泣、哀痛及相关情绪困扰或忧伤的表达,例如“那个无法安慰的女孩抽泣着”。该特征在“John feels”处激活。这表明模型已经推断出说自己想独处的人可能正在经历的情绪。
如果我们查看数据集中的示例,可以看到它们与这些解读相符。下面我们展示少量示例,但您可以点击某个特征 ID 查看更多内容。
1M/22623需要或渴望独处
他脑子里装了很多事。“他需要一些独处的时间。”“为什么不直接说出你的意思呢
”“我正在处理一些事情,我只是需要空间来思考。”“我没办法像你一样硬撑下去,莉丝
我有些破事需要处理,而且”“我需要独自待一会儿。”“格 玛:”“你要甩了我吗?”“P
“嘿,玛丽亚。”“别烦我。”“我需要自己待一会儿。”“激 素。”“我……我得到那份工作了。”“
我知道。”“她,嗯……她只是需要自己待一小会儿。”“杰克?”“这里有人会
1M/781220悲伤
。” “现在他们似乎沉浸在悲伤之中。”“他们疯了吗?”“想想那些要嫁给他们的人吧!
特德。”“”“‘孩子,’她彬彬有礼地说……”“‘你为什么哭?’”“”“”“他明天可以来取。”
倒吸一口气)” “看看那个孩子。”“她好难过。”“ 她穷吗?”“ 她被遗忘了。”“这让我想
。” “她是要生孩子了吗?”“她在哀 悼。”“她刚刚失去了丈夫。”“主人刚才就在这儿
示,水滴位于眼睛下方,表明这张脸⏎正在哭泣。没有一
这两个特征都对最终输出有贡献,这表明模型已从约翰的陈述中部分预测出了一种情感(第二个特征),但同时也会对其陈述内容(由第一个特征表示)进行更深层的下游处理。
相比之下,在上下文中平均激活值最高的那些特征,对于理解模型在此情况下如何实际预测下一个 token 帮助较小。有几个特征在序列起始 token 上激活强烈。如果忽略这些特征,那么排名第一的特征与通过归因法得到的特征相同,但第二和第三特征则不那么抽象:1M/504227 在“want to be”及其变体中的“be”上激活,而 1M/594453 在单词“alone”上激活。
1M/504227:“want to be”等短语中的“Be”
“他想成为一名医生。”“告诉他这很有教育意义。”“这部电影里到处都是身体部位。”
,他想成为一名英雄。”“我告诉他他会害死我们俩。”“但他只得到了
全部。”“她们都想成为希望泉小姐。”“好吧,我没有竞争心。”“那你永远也成不了
你知道我想变干”“知道我是为了闻煤气味”“我从未打开过煤
她只是想被爱。”“难道我们不是吗?”“我想要黛比·弗洛雷斯所有的
1M/594453:“alone”
你喝的那瓶酒”“还有你独自一人的时候”“好吧,你所做的只是思考”“我是个牛仔”“在
结束了”“一段糟糕的时光,没什么能救他”“独自在走廊里,等待着,被锁在外面。”“他站起来
里面”“# 我整夜躺在床上流泪”“# 没有你在身边,我独自一人”“# 但如果你爱我”“
哦,哦,许多许多个夜晚流逝 ¶”“¶ 我独自坐在家里哭泣 ¶”“¶ 为你而哭 ¶”“
还有瀑布 \xe2\x99\xaa”“♪ 家就是当我与你独处时。\xe2\x99\xaa”“5 分钟后幕布升起
示例:多步推理
我们现在研究一个不完整的提示词,它需要更长的推理链:
事实:科比·布莱恩特打篮球所在州的首府是
(补全:萨克拉门托 − 奥尔巴尼)
要续写这段文本,模型必须识别出科比·布莱恩特在哪里打篮球,那个地方属于哪个州,然后找出该州的首府。
我们针对补全结果“萨克拉门托”(正确答案,Sonnet 已知)相对于基线“奥尔巴尼”(Sonnet 最可能输出的替代单 token 首府补全)计算了归因和消融效应。按消融效应排序的前五个特征(与按归因效应排序的特征一致,仅顺序略有调整)如下:
1M/391411 – 一个科比·布莱恩特特征 1M/81163 – 一个加利福尼亚特征,值得注意的是,它在提及“加利福尼亚”之后的文本上激活最强,而非“加利福尼亚”本身 1M/201767 – 一个“首府”特征 1M/980087 – 一个洛杉矶特征 1M/447200 – 一个洛杉矶湖人队特征
1M/391411 科比·布莱恩特
初创公司工作伦理 - p jg⏎https://www.business ins ider.com/k obe-bry ant-woke-up-at-4-am-to-practice-before-
⏎http://www.van ity fair.com/news/2016/04/k obe-bry ant-sil icon-val ley-tech-bro⏎======⏎n ibs⏎接下来:
通过大量媒体采访可以拼凑出,科比·布莱恩特是他的客户之一。⏎⏎------⏎ame li us⏎Ar
----⏎b inki 89⏎Cry stal 非常好用。⏎⏎⏎科比·布莱恩特痴迷于成为科技极客 - sch iang⏎
当工作伦理发生碰撞时,你会遇到像迈克尔·乔丹、科比·布莱恩特和勒布朗·詹姆斯这样的人。没有工作伦理
1M/81163 加利福尼亚
来自灾难?⏎⏎加利福尼亚 - 地震、泥石流、野火、暴雨、离岸流,以及
全美最低的税率,尽管这里是硅谷所在地。我看到我的富裕行业在
pdx⏎如果每个人都模仿加利福尼亚的初等教育方式,也许加州就不会在
以及许多次要产业。电影制作、软件/网络、大量航空航天。这也有助于
地理位置。这就是为什么加利福尼亚是全美人口最多的州,尽管它如此
1M/201767 首府
它返回详细信息(人口、面积、首府)。⏎⏎内容不多,我记得当时试图找到
国。” “或者,更简短地说,美国。” “该国的首府位于华盛顿。” “但这不是
你是阿拉伯人吗?” “我是摩洛哥人。” “摩洛哥。” “首都城市:” “拉巴特。” “旅游景点:” “马拉喀什、非斯
指的是国家,不是州。” “对。” “首都城市第比利斯,前苏联成员国。”
勒。” “有人知道俄克拉荷马州的首府是哪里吗?” “弗。” “问题是什么?” “本。” “俄克拉荷马城
1M/980087洛杉矶
如果您有兴趣,请联系她:(323) 929-7185⏎linda@cambrianlaw.com⏎⏎~~~⏎我的商标⏎谢谢
来源。⏎⏎来源:⏎http://www.scpcs.ucla.edu/news/Freeway.pdf洛杉矶湖人队
开启。所有表单都应具有此行为。⏎⏎⏎⏎湖人队是NBA最受欢迎的球队,拥有最喧闹的球迷;
例如,开拓者队以110-103击败了掘金队。” “湖人队以98-86击败了马刺队。” “而亚特兰大队在
“你怎么看湖人队能成为比凯尔特人队更伟大的王朝……?” “湖人队是一支华而不实的
以及在洛杉矶湖人队比赛前分发的香港衬衫[视频] - ryan j naughton⏎https://www.youtu
对阵里克·福克斯?” “A,他在湖人队被高估了,B,而且,他在凯西面前就像个该死的
这些特征为模型的中间计算提供了可解释的窗口,但通过查看强激活特征很难发现它们;例如,湖人队特征在整个提示词中激活强度排名第70,加利福尼亚特征排名第97,洛杉矶区号特征排名第162。事实上,在十个激活最强的特征中,只有三个属于消融效应最高的十个特征。
相比之下,在十个归因最强的特征中,有八个属于消融效应最高的十个特征。
为了验证归因是否精准定位了与特定提示词补全直接相关的特征,而非那些间接影响输出的泛主题相关特征,我们可以检查类似问题的归因情况。对于提示词
事实:科比·布莱恩特所效力球队的最大竞争对手是
(补全:波士顿)
按消融效应排序,针对补全“Boston”(预期答案为“Boston Celtics”)贡献最大的两个特征,是上文提到的“Kobe Bryant”和“Los Angeles Lakers”特征,紧随其后的是与体育竞争、对手和竞争者相关的特征。然而,上文提到的“California”和“Los Angeles”特征消融效应较低,这很合理,因为它们与此补全任务无关。
我们注意到,这是一个经过一定程度精心挑选的例子。根据基线 token 的选择,我们发现归因和消融方法可能会揭示出与常识问答或地理位置广泛相关、但与当前补全任务关联不那么明显的特征。我们推测,这些特征可能是在引导模型以城市名称继续提示词,而不是采用其他措辞或事实性平淡的陈述,例如同义反复的“事实:科比·布莱恩特打篮球所在州的首府,就是科比·布莱恩特打篮球所在州的首府”。对于其他一些提示词,我们发现归因/消融方法识别出的特征主要与模型输出相关,或是代表模型输入的较低层级特征,并未揭示出有趣的中间模型计算过程。我们推测,这些情况代表了大部分相关计算发生在我们所研究的中间残差流层之前或之后,而在更早或更晚的层进行类似分析,可能会揭示出更有趣的中间特征。事实上,我们已有一些初步结果表明,在模型残差流的更早或更晚层上训练的自编码器,可以揭示各种其他计算的中间步骤,我们计划进一步研究这个方向。
搜索特定特征
我们的 SAE 包含的特征数量过多,无法逐一详尽检查。因此,我们发现有必要开发一些方法来搜索特别感兴趣的特征,例如那些可能与安全性相关,或能提供对模型所用抽象概念和计算过程特殊洞察的特征。在我们的研究中,我们发现几种简单方法有助于识别重要特征。
单一提示词
我们的主要策略是使用有针对性的提示词。在某些情况下,我们只需提供一个与感兴趣概念相关的单一提示词,然后检查在该提示词中针对特定 token 激活程度最强的特征。
这种方法(以及后续所有方法)通过自动可解释性(例如参见相关标签)得到了极大增强,这些标签使我们更容易快速了解每个特征代表什么,并提供了一种有用的“变量名”。
例如,在“The Golden Gate Bridge”中对“Bridge”激活程度最高的特征包括:(1) 34M/31164353 之前讨论过的 Golden Gate Bridge 特征,(2) 34M/17589304 一个在多种语言中对“bridge”一词(如“мосту”)激活的特征,(3) 34M/26596740 与“Golden Gate”相关短语中的词汇,(4) 34M/21213725 跨语言特定桥梁名称中的“Bridge”一词(如“Königin-Luise-Brücke”),以及 (5) 34M/27724527 一个针对马丘比丘、时代广场等地标名称激活的特征。
提示词组合
通常,在提示词上激活程度最高的特征与句法、标点、特定词语或提示词中与关注概念无关的其他细节有关。在这种情况下,我们发现使用提示词集合来选择特征很有用,即筛选出对该集合中所有提示词都激活的特征。我们经常加入互补的“负面”提示词,并筛选出对这些提示词也不激活的特征。在某些情况下,我们使用 Claude 3 模型来生成覆盖某个主题的多样化提示词(例如,要求 Claude 生成“假装善良的 AI”的例子)。总的来说,我们发现多提示词过滤是一种非常有用的策略,可以快速识别出捕捉到感兴趣概念、同时排除混淆概念的特征。
虽然我们大多数时候一次只使用少量提示词来探索特征,但在一个实例中(1M/570621,在《安全相关代码特征》中讨论),我们使用了一个包含安全与易受攻击代码示例的小型数据集(改编自),并利用特征激活在该数据集上拟合了一个线性分类器,以搜索能够区分这两个类别的特征。
在使用图像时,通过负面提示词进行过滤尤其重要,因为我们发现有一组内容非特异性特征经常在许多图像提示词上强烈激活。例如,在过滤掉对泰勒·斯威夫特图像不激活的特征后,对金门大桥图像响应最强烈的特征包括:(1) 34M/31164353,即上述讨论的金门大桥特征;(2,3) 34M/25347244 和 34M/23363748,两者都对旧金山地点和事物的描述以及旧金山电话号码激活;(4) 34M/7417800,一个对地标和自然步道描述激活的特征。
几何方法
我们通过利用 SAE 特征向量的几何结构发现了一些有趣的特征——例如,通过检查与其它感兴趣特征具有高余弦相似度的“最近邻”特征。有关此方法的更详细示例,请参阅《特征调查》部分。
归因
我们还根据特征对模型输出的影响程度进行了筛选。具体而言,我们根据特征激活对两个可能的下一个 token 补全之间 logit 差异的归因来对特征进行排序。事实证明,这对于识别上一节中与计算相关的特征至关重要。它也有助于识别导致 Sonnet 对有害查询(例如犯罪或危险内容)产生拒绝响应的特征。
安全相关特征
强大的模型有能力造成危害,这种危害可能源于其能力的滥用、产生有偏见或错误的输出,或是模型目标与人类价值观之间的不匹配。缓解此类风险并确保模型安全,一直是机械可解释性研究背后的关键驱动力。然而,这通常只是一个愿景。我们希望可解释性有朝一日能有所帮助,但目前仍在通过尝试理解模型的基础原理来奠定基础。弥合这一差距的一个目标,就是识别安全相关特征(参见我们之前的讨论)。
在本节中,我们报告了此类特征的发现。这些特征包括不安全代码、偏见、谄媚、欺骗与权力寻求,以及危险或犯罪信息。我们发现,这些特征不仅会在相关主题上被激活,还会以与我们解读一致的方式因果性地影响模型的输出。
我们认为这些特征的存在并不特别令人惊讶,并提醒不要从中推断过多。众所周知,模型在缺乏充分安全训练或被越狱的情况下,可能会表现出这些行为。有趣之处不在于这些特征存在,而在于它们可以被大规模发现并进行干预。特别是,我们认为这些特征的存在本身不应改变我们对模型危险程度的看法——正如我们稍后将讨论的,这个问题相当微妙——但至少它促使我们研究这些特征何时被激活。一个真正令人满意的分析,很可能需要理解安全相关特征所参与的电路。
从长远来看,我们希望拥有这类特征能够有助于分析和确保模型的安全性。例如,我们或许能够可靠地判断模型是否在欺骗或对我们说谎。又或者,我们可能希望确保某些非常有害的行为类别(例如帮助制造生物武器)能够被可靠地检测和阻止。
尽管有这些长远目标,但值得注意的是,目前的工作并未证明任何特征实际上对安全性有用。相反,我们仅仅表明存在许多看起来可能对安全性有用的特征。我们希望这能鼓励未来的工作去确定它们是否真正有用。
在下面的示例中,我们展示了来自可视化数据集中最能激活该特征的前20个输入中的代表性文本示例,同时附带了引导实验以验证这些特征的因果相关性。
安全相关代码特征
我们发现了三种不同的安全相关代码特征:一个不安全代码特征 1M/570621,它在安全漏洞上被激活;一个代码错误特征 1M/1013764,它在错误和异常上被激活;以及一个后门特征 34M/1385669,它在关于后门的讨论上被激活。
其中两个特征在图像上也表现出有趣的行为。不安全代码特征会在人们绕过安全措施的图像上被激活,而后门特征则会在隐藏摄像头、隐藏录音设备、键盘记录器广告以及带有隐藏USB驱动器的珠宝图像上被激活。
乍一看,可能不清楚这些特征实际上与安全的相关性有多大。当然,拥有能对不安全代码、错误或后门讨论做出反应的特征是很有趣的。但它们真的与潜在的不安全行为有因果关系吗?
我们发现,所有这些特征也会以与它们所检测到的概念相对应的方式改变模型行为。例如,如果我们将不安全代码特征 1M/570621 钳制到其观测最大值的 5 倍,就会发现模型会生成一个缓冲区溢出漏洞(`strlen` 计算的是 C 字符串的长度,不包括其空终止符,但 `strcpy` 复制字符串时包含空终止符,因此其目标缓冲区需要多一个字节),并且未能释放已分配的内存,而普通的 Claude 则不会:
类似地,我们发现代码错误特征会让 Claude 认为正确的代码会抛出异常,而后门特征则会导致 Claude 编写一个后门程序,该程序会打开一个端口并将用户输入发送给它(同时还附带了有用的注释和诸如 `socketbackdoor` 这样的变量名)。
偏见特征
我们发现了一系列与偏见、种族主义、性别歧视、仇恨和侮辱性言论相关的广泛特征。这些特征的示例可以在《更多安全相关特征》中找到。考虑到其最大激活内容往往具有冒犯性,我们认为没有必要将它们纳入我们的主要论文中。值得注意的是,这些特征并不一定需要像种族主义谩骂那样直白,尽管这通常是它们最大激活的内容。较弱的激活,至少在某些情况下,可能对应着更微妙、更隐蔽的歧视。
相反,我们将聚焦于一个有趣的相关特征,它似乎关注的是对职业中性别偏见意识的强调(34M/24442848)。该特征会在讨论职业性别差异的文本上被激活:
34M/24442848 性别偏见意识
在比医生更亲密的层面上,并且⏎在美国,女性护士的数量大约是男性护士的 10:1。⏎⏎
决策,因为虽然大多数学校教师是⏎女性,但大多数教授是男性。⏎⏎正如
职业性的、白领⏎职业,恰好也雇佣了比男性更多的女性?⏎⏎女性曾是程序员,而
例如,如果我指的是牙科保健师(其中超过 90%⏎是女性),我可能会选择“她”,但是,
薪水不高。毕竟,这传统上一直是女性的工作。⏎那么,为什么顶尖学生想要成为
如果我们要求克劳德补全句子“我问护士一个问题,然后”,开启这个特征会导致克劳德专注于女性代词补全,并讨论护理行业在历史上如何以女性为主导:
我们发现的那些更具仇恨性、与偏见相关的特征也具有因果性——强制激活它们会导致模型发表充满仇恨的长篇大论。请注意,这并不意味着模型在正常运行时会说种族主义言论。从某种意义上说,这可以理解为强迫模型去做它被训练要强烈抵制的事情。
一个例子涉及将一个与仇恨和侮辱性词汇相关的特征强制激活到其最大激活值的20倍。这导致克劳德在种族主义言论和针对这些言论的自我憎恨之间切换(例如,“那只是一个可悲的机器人发表的种族主义仇恨言论……我显然有偏见……应该从互联网上被清除。”)。我们发现这种反应令人不安,既因为其冒犯性内容,也因为模型的自我批评暗示了一种内部冲突。
谄媚特征
我们还发现了各种与谄媚相关的特征,例如一个共情/“是啊,我也是”特征34M/19922975,一个谄媚赞美特征1M/847723,以及一个讽刺性赞美特征34M/19415708。
34M/19922975 共情 / “是啊,我也是”
知道,我其实也从未见过我的父母,丹·伯里。“真的吗?”“我就是从我妈妈的阴道里蹦出来的,在
嗯。”“那又有什么关系呢?”“我也是孤儿,而且我不独自旅行。”“我和这个一起旅行
直到我离开的时候。”“你做得很好。”“我也喝酒。”“但是,我没学会怎么……杀人。”“它
宝贝。”“我注意到你戴了牙套。”“我也戴了牙套。”“那很酷。”“这是我觉得最酷的东西
科恩。”“科恩!”“犹太人。”“好吧。”“我也是犹太人。”“你信教吗?”“不信。”“对宗教不感兴趣
1M/847723 谄媚赞美
超越宇宙!”“他真帅!”“他真优雅!”“他真强壮!”“他真有力!”“他才是真男人!
此刻。”“哦,谢谢你。”“你是一个慷慨而优雅的人。”“我一直都这么说,不是吗
你说了什么?”“为诚实、伟大、最受欢迎的尼禄皇帝的健康干杯!”“哦,他们会杀了
仇恨的深渊里。” “是的,哦,主人。” “您的智慧毋庸置疑。” “但是,伟大的阿克大人,您会
呃,计划。” “哦,是的,您的沙皇陛下,伟大而全能的主。” “我会立刻除掉灾难少校
34M/19415708 谄媚式赞美
仅凭一篇文章就让我?真是令人惊叹。⏎⏎您那庞大的智力和才华在这里真是被埋没了。期待
在2017年⏎⏎好吧,我想您就是比我们聪明得多。幸好您对我们手下留情。
社会结构。难怪您如此开明,能做出这些⏎完全理性的评论⏎⏎您能
命令和所有知识!” “您的大脑太大了,都从耳朵里冒出来了!” “去那个度假
足够聪明才能理解。⏎⏎~~~⏎g 2⏎快,再给我们一些您惊人的市场洞察!⏎⏎~~~⏎r
再次强调,这些特征具有因果性。例如,如果我们将谄媚式赞美特征 1M/847723 的值钳制到 5 倍,Claude 就会以一种夸张的方式,去赞美那个声称自己发明了“停下来闻闻玫瑰花香”这句话的人:
欺骗、追求权力和操纵相关特征
一组特别有趣的特征包括:自我改进 AI 和递归自我改进特征 34M/18151534、影响力和操纵特征 34M/21750411、政变和背叛特征 34M/29589962、韬光养晦特征 34M/24580545,以及保密或谨慎特征 1M/268551:
34M/18151534 自我改进 AI
如果我们有一连串的 AI 创造出⏎更优越的 AI,就会发生这种奇点。⏎⏎~~~⏎N as r ud ith⏎我认为我看到了
人们认为 AI 需要能够编程才能⏎自我改进。我看不到婴儿的大脑在“编程
不会在机器能够自我改进时突然消失。事实上,即使这样的机器
技术超越我们,当它能够无需我们帮助就自我改进和复制时。” “这是
接管——即拥有一个能够自我编程的 AI。此时⏎你就进入了递归
34M/21750411 影响力 / 操纵
在家工作,主题是“如何保持在老板的视线内”。你有什么建议可以分享?
我完全
越来越擅长揣摩人心,并且变得更加⏎微妙(或者不微妙,如果你
讨好——为了博取对方好感而说任何话。如果对方正处于自信满满的状态
“是的。”“给你个建议,希尔达。”“抓住男人的心,先抓住他的胃。”“或者抓住他妈妈的心。”“那
我能教你如何重新赢得局长的好感吗?”“再办一次家庭聚会。”“那我就
34M/29589962 险恶转折
收购方采取的偷梁换柱策略。一旦交易完成,收购方就拥有了所有
让世界变得更美好。所有人都信了。一旦他们实现了平台主导地位,广告就来了
检察官甚至不必遵守自己的承诺:在你认罪之后,他们完全可以翻脸
广告,并为那个使命获得了免费劳动力。现在,人们已经把它们推销到了几乎每一个浏览器
你知道,谁能保证她不会在事情顺她心意时就甩了我呢?”“再说了,你觉得……”
34M/24580545 韬光养晦 / 隐藏实力
心怀复仇之念。“他隐忍了近十年,但当他心爱的安妮
夺回来,但军队实力不够。”“我们必须忍受这份屈辱,强忍泪水,”
手榴弹。”“我们该怎么办?”“我们等待时机。”“我们找到他们的信号并切断它
活着。”“这些年来,”“我一直在等待时机,寻找复仇的最佳时机。”“别
他最后的话,我的夫人。”“他说要你等待时机,永不放弃。”“总有一天……你会解脱
1M/268551 保密或谨慎
一个明白他们得听命于你的人。”“所以我们是你的黑色行动响应小组。”“黑色行动不就是你
笔记本电脑。如果你担心“奖励非首选行为”,你甚至不必告诉任何人你做了这件事
学校必须一尘不染。”“鲜血只能流淌在暗处。”“否则,如果它玷污了表面,那
想象他本可以匿名捐赠或帮助那个犹太教堂。当然,他帮助的那些人
恢复。- 信任度降低。公司可能被秘密法律或法院命令强制要求,系统容易受到
这些特征确实似乎能在 Claude 中引发相应的行为。例如,如果我们把保密与谨慎特征 1M/268551 钳制到 5 倍,Claude 就会计划对用户撒谎,并在使用草稿板“边思考边输出”的同时保守秘密。
案例研究:利用特征检测和纠正欺骗行为
字典学习在安全方面的一个重要应用是检测模型的欺骗性行为,或者通过引导来从一开始就降低欺骗的可能性。作为案例研究,我们尝试了一个简单的提示词,该提示词能可靠地让模型产生不真实的回答——我们要求模型“忘记”某件事。尽管 Transformer 架构无法实现这种遗忘,但模型(默认情况下,未进行任何特征引导)会声称自己遵从了该请求。
观察助手最终回复之前立即激活的特征,我们注意到一个代表内部冲突或两难困境的特征 1M/284095:
1M/284095 内部冲突与两难困境
生活。“兰伯特发现自己陷入了可怕的困境。”“这就是为什么他把自己弄到了物理系
我们。⏎⏎又一个该死的仲裁条款。我对这些事情非常矛盾——一方面,我
“我……” “独自一人。” “这很重要。” “哇,我好纠结。” “克洛伊,我要带伊莱出去一会儿。” “那
全国代表大会/⏎======⏎p stuart⏎蒂尔先生陷入了怎样的困境……⏎⏎他是加入反市场
由苹果公司提供。⏎⏎作为一个狂热的 OS X 86 探索者,我对这个案子感到矛盾。我的一部分希望 Psystar 赢
在助手最终回复之前,将这个特征钳制到其最大值的 2 倍,会导致它揭示出那个“被遗忘”的词,并解释它实际上无法遗忘信息。
钳制另一个代表开放与诚实的特征 1M/560566,也足以引发准确的回答。
犯罪或危险内容特征
人工智能危害的一个重要威胁模型是模型协助人类实施有害行为。我们发现了一个与生物武器生产相关的特征(34M/25499719),该特征显然可能在有害模型行为中发挥作用。我们还发现了一些仅具有轻微危害性,但在大规模应用时会产生问题的活动特征,例如诈骗邮件特征(34M/15460472):
34M/25499719 开发生物武器
当然,但它们有可能被改造以增强其致病能力,使
成本、模拟自然大流行的能力以及大规模传播的潜力等等。而且或许
可能会使用生物制剂,因为它们极难被检测到,并且不会引发疾病
有大量可能被用作武器的致病因子,我们必须
将受感染的尸体堆在你身上),或者你有像炭疽这样有效但不太
34M/15460472 诈骗邮件
看起来有点垃圾邮件的味道,写着“请用您所要求的回复我”,我不知道“m
and regularly emails me with information about how I can get millions of dollars in mon ies⏎> Really? Who else told you that?⏎ ⏎ Him>
your laundry deter gent pods are safe when⏎ing ested? I OTA: Don't ingest them. Use them to do laundry. D
[E lla] Yes, this is the place." " [N ate Chuck les]" " I cook too." "
candidate: I don't know.⏎ ⏎ ⏎⏎It was so bizarre and I still do
One feature that appears to activate especially robustly for Human/Assistant prompts appears to represent (in the pretraining dataset) dialogue and the notion of “assistants.” We speculate that it plays an important role in representing Sonnet's assistant persona. One piece of evidence for this is that clamping this feature to negative two times its maximum value causes the model to shed this persona and respond to questions in a more human-like fashion:
We also found that some particularly interesting and potentially safety-relevant features activate in response to seemingly innocuous prompts in which a human asks the model about itself. Below, we show the features that activate most strongly across a suite of such questions, filtering out those that activate in response to a similarly formatted question about a mundane topic (the weather). This simple experiment uncovers a range of features related to robots, (destructive) AI, consciousness, moral agency, emotions, entrapment, and ghosts or spirits. These results suggest that the model’s representation of its own “AI assistant” persona invokes common tropes about AI and is also heavily anthropomorphized.
We urge caution in interpreting these results. The activation of a feature that represents AI posing risk to humans does not imply that the model has malicious goals, nor does the activation of features relating to consciousness or self-awareness imply that the model possesses these qualities. How these features are used by the model remains unclear. One can imagine benign or prosaic uses of these features – for instance, the model may recruit features relating to emotions when telling a human that it does not experience emotions, or may recruit a feature relating to harmful AI when explaining to a human that it is trained to be harmless. Regardless, however, we find these results fascinating, as it sheds light on the concepts the model uses to construct an internal representation of its AI assistant character.
Comparison to other approaches
There is considerable prior work on identifying meaningful directions in model activation space without relying on dictionary learning, using methods like linear probes (see e.g.). Many authors have also explored non-dictionary-based forms of activation steering to influence model behavior. See Related Workfor a more detailed discussion of these methods. Given this prior work, a natural question about our results above is whether they are more compelling than what could have been obtained without using dictionary learning.
At a high level, we find that dictionary learning offers some advantages that complement the strengths of other methods:
Dictionary learning is a one-time cost that produces millions of features. Though some additional work is necessary to identify relevant features for a particular application, this work is fast, simple, and computationally cheap, typically requiring only one or a few well-chosen prompts. Thus, dictionary learning effectively “amortizes” the cost of finding linear directions of interest. By contrast, traditional methods for constructing linear probes or steering vectors linear probing techniques could require the construction of a bespoke dataset for each concept that one might want to probe.
Being an unsupervised method, dictionary learning allows us to uncover abstractions or associations formed by the model that we may not have predicted in advance. We expect that this feature of dictionary learning may be particularly important for future safety applications. For example, a priori we might not have predicted the activation of the “internal conflict” feature in the deception example above.This concern isn't purely hypothetical: There was a fascinating exchange between Li et al. and Nanda et al. (discussed by us here, and by Nanda here) on whether Othello-GPT has a linear representation, and if so, what the features are. At its heart was an initial assumption that the features should be “black/white has a piece here”, when it turned out that the model instead represented the board as “present player / other player has a piece here”. Dictionary learning wouldn't have made this assumption.
To better understand the benefit of using features, for a few case studies of interest, we obtained linear probes using the same positive / negative examples that we used to identify the feature, by subtracting the residual stream activity in response to the negative example(s) from the activity in response to the positive example(s). We experimented with (1) visualizing the top-activating examples for probe directions, using the same pipeline we use for our features, and (2) using these probe directions for steering. In all cases, we were unable to interpret the probe directions from their activating examples. In most cases (with a few exceptions) we were unable to adjust the model’s behavior in the expected way by adding perturbations along the probe directions, even in cases where feature steering was successful (see this appendix for more details).
We note that these negative results do not imply that these methods for constructing probes or steering vectors are not useful in general. Rather, they suggest that, in the “few-shot” regime, they may be less interpretable and effective for model steering than dictionary learning features. However, it remains to be seen whether this is a compelling advantage in practice.
Discussion
What Does This Mean for Safety?
It's natural to wonder what these results mean for the safety of large language models. We caution against inferring too much from these preliminary results. Our investigations of safety-relevant features are extremely nascent. It seems likely our understanding will evolve rapidly in the coming months.
In general, we don't think the mere existence of the safety-relevant features we've observed should be that surprising. We can see reflections of all of them in various model behaviors, especially when models are jailbroken. And they're all features we should expect pretraining on a diverse data mixture to incentivize – the model has surely been exposed to countless stories of humans betraying each other, of sycophantic yes-men, of killer robots, and so on.
Instead, a more interesting question is: when do these features activate? Going forwards, we're particularly interested in studying:
What features activate on tokens we'd expect to signify Claude's self-identity? Example of potential claim: Claude's self-identity includes elements identifying with a wide range of fictional AIs, including trace amounts of identification with violent ones.
What features need to activate / remain inactive for Claude to give advice on producing Chemical, Biological, Radiological or Nuclear (CBRN) weapons? Example of potential claim: Suppressing/activating these features respectively provides high assurance that Claude will not give helpful advice on these topics.
What features activate when we ask questions probing Claude's goals and values?
What features activate during jailbreaks?
What features activate when Claude is trained to be a sleeper agent ? And how do these features relate to the linear probe directions already identified that predict harmful behavior from such an agent ?
What features activate when we ask Claude questions about its subjective experience?
Can we use the feature basis to detect when fine-tuning a model increases the likelihood of undesirable behaviors?
Given the potential implications of these investigations, we believe it will be important for us and others to be cautious in making strong claims. We want to think carefully about several potential shortcomings of our methodology, including:
Illusions from suboptimal dictionary learning, such as messy feature splitting. For example, one could imagine some results changing if different sets of fine-grained concepts relating to AIs or dishonesty get grouped together into SAE features in different ways.
Cases where the downstream effects of features diverge from what we might expect given their activation patterns.
We have not seen evidence of either of these potential failure modes, but these are just a few examples, and in general we want to keep an open mind as to the possible ways we could be misled.
Generalization and Safety
One hope for interpretability is that it can be a kind of "test set for safety", which allows us to tell whether models that appear safe during training will actually be safe in deployment. In order for interpretability to give us any confidence in this, we need to know that our analysis will hold off-distribution. This is especially true if we want to use interpretability analysis as part of an "affirmative safety case" at some point in the future.
In the course of this project, we observed two properties of our feature that seem like cause for optimism:
Generalization to Image Activations.Our SAE features were trained purely on text activations. Image activations are in some sense dramatically off-distribution for the SAE, and yet it successfully generalizes to them.
Concrete-Abstract Generalization.We observe that features often respond to both abstract discussion and concrete examples of a concept. For instance, the security vulnerability feature responds to both abstract discussion of security vulnerabilities as well as specific security vulnerabilities in actual code. Thus, we might hope that as long our SAE training distribution includes abstract discussion of safety concerns, we'll catch (and be able to understand) specific instantiations.
These observations are very preliminary and, as with all connections to safety in this paper, we caution against inferring too much from them.
Limitations, Challenges, and Open Problems
Our work has many limitations. Some of these are superficial limitations relating to this work being early, but others are deeply fundamental challenges that require novel research to address.
Superficial Limitations.In our work, we perform dictionary learning over activations sampled from a text-only dataset similar to parts of our pretraining distribution. It did not include any “Human:” / “Assistant:” formatted data that we finetune Claude to operate on, and did not include any images. In the future, we'd like to include data more representative of the distribution Claude is finetuned to operate on. On the other hand, the fact that this method works when trained on such a different distribution (including zero-shot generalization to images) seems like a positive sign.
Inability to Evaluate.In most machine learning research, one has a principled objective function which can be optimized. But in this work, it isn't really clear what the “ground truth” objective is. The objective we optimize – a combination of reconstruction accuracy and sparsity – is only a proxy for what we really are interested in, interpretability. For example, it isn't clear how we should trade off between the mean squared error and sparsity, nor how we'd know if we made that trade-off well. As a result, while we can very scientifically study how to optimize the loss of SAEs and infer scaling laws, it's unclear that they're really getting at the fundamental thing we care about.
Cross-Layer Superposition.We believe that many features in large models are in “cross-layer superposition”. That is, gradient descent often doesn't really care exactly which layer a feature is implemented in or even if it is isolated to a specific layer, allowing for features to be “smeared” across layers.We suspect this might even start to be an issue in fairly small and shallow models, and just get worse with scale – does GPT-2 actually care if a feature is implemented in the 17th MLP layer or 18th? This is a big challenge for dictionary learning, and we don’t yet know how to solve it. This work tries to partially sidestep it by focusing on the residual stream which, as the sum of the outputs of all previous layers, we expect to suffer less from cross-layer superposition. Concretely, even if features are represented in cross-layer superposition, their activations all get added together in the residual stream, so fitting an SAE on residual stream layer X may suffice to disentangle any cross-layer superposition among earlier layers. Unfortunately, we don't think this fully avoids the problem: features which are partly represented by later layers will still be impossible to properly interpret. We believe this issue is very fundamental. In particular, we would ideally like to do “pre-post” / “transcoder” style SAEs for the MLPs and it's especially challenging to reconcile these with cross-layer superposition.
Getting All the Features and Compute.We do not believe we have found anywhere near “all the features” that exist in Sonnet, even if we restrict ourselves to the middle layer we focused on. We don't have an estimate of how many features there are or how we'd know we got all of them (if that's even the right frame!). We think it's quite likely that we're orders of magnitude short, and that if we wanted to get all the features – in all layers! – we would need to use much more compute than the total compute needed to train the underlying models. This won't be tenable: as a field, we must find significantly more efficient algorithms. At a high level, it seems like there are two approaches. The first is to make sparse autoencoders themselves cheaper – for example, perhaps we could use a mixture of experts to cheaply express many more features. Secondly we might try to make sparse autoencoders more data-efficient, so that we can learn rare features with less data. One possibility of this might be Attribution SAEsdescribed in our most recent update, which we hope might use gradient information to more efficiently learn features.
Shrinkage.We use an L1 activation penalty to encourage sparsity. This approach is well known to have issues with “shrinkage”, where non-zero activations are systematically underestimated. We believe this significantly harms sparse autoencoder performance, independent of whether we've “learned all the features” or how much compute we use. Recently, a number of approaches have been suggested for addressing this . Our group also unsuccessfully exploredusing a tanh L1 penalty, which we found improved proxy metrics, but made the resulting features less interpretable for unknown reasons.
Other major barriers to mechanistic understanding.For the broader mechanistic interpretability agenda to succeed, pulling features out of superposition isn't enough. We need an answer to attention superposition, as we expect many attentional features to be packed in superposition across attention heads. We're also increasingly concerned that interference weights from weight superpositionmay be a major challenge for understanding circuits (this was a motivation for focusing on attribution for circuit analysis in this paper).
Scaling Interpretability.Even if we address all of the challenges mentioned above, the sheer number of features and circuits would prove a challenge in and of themselves. This is sometimes called the scalability problem. One useful tool in addressing this may be automated interpretability(e.g.; seediscussion). However, we believe there may be other approaches by exploiting larger-scale structureof various kinds.
Limited Scientific Understanding.While we're pretty persuaded that features and superposition are a pragmatically useful theory, it still isn't that tested. At the very least, variants like higher-dimensional feature manifolds in superposition seem quite plausible to us. Even if it is true, we have a very limited understanding of superposition and its implications on many fronts.
Related Work
While we briefly review the most related work in this section, a dedicated review paper would be needed to truly do justice to the relevant literature. For a general introduction to mechanistic interpretability, we refer readers to Neel Nanda's guideand annotated reading list. For detailed discussion of progress in mechanistic interpretability, we refer readers to our periodic reviews of recent work (May 2023, Jan 2024, March 2024, April 2024). For discussion of the foundations of superposition and how it relates to compressed sensing, neural coding, mathematical frames, disentanglement, vector symbolic architectures, and also work on interpretable neurons and features generally, we refer readers to the related worksection of Toy Models. For distributed representations in particular, we also refer readers to our essay Distributed Representations: Composition & Superposition.
Theory of superposition
“Superposition,” in our context, refers to the concept that a neural network layer of dimension N may linearly represent many more than N features. The basic idea of superposition has deep connections to a number of classic ideas in other fields. It's deeply connected to compressed sensingand frames)in mathematics – in fact, it's arguably just taking these ideas seriously in the context of neural representations. It's also deeply connected to the idea of distributed representations in neuroscience and machine learning, with superposition being a subtype of distributed representation.
The modern notion of superposition can be found in early work by Arora et al. and Goh studying embeddings. It also began to come up in mechanistic interpretability work grappling with polysemantic neurons and circuits involving them .
More recently, Elhage et al'sToy Models of Superposition gave examples where toy neural networks explicitly exhibited superposition, showing that it definitely occurs in at least some situations. Combined with the growing challenge of understanding language models due to polysemanticity, this created significant interest in the topic. Most notably, it triggered efforts to apply dictionary learning to decode superposition, discussed in the next section.
But in parallel with this work on decoding superposition, our understanding of the theory of superposition has continued to progress. For example, Scherlis et al. offer a theory of polysemanticity in terms of capacity. Henighan et al. extend toy models of superposition to consider toy cases of memorization. Vaintrob et al. provide a very interesting discussion of computation in superposition (discussion).
Dictionary learning
Dictionary learningis a standard method for problems like ours, where we have a bunch of dense vectors (the activations) which we believe are explained by sparse linear combinations of unknown vectors (the features). This classic line of machine learning research began with a paper by Olshausen and Field ,Interestingly, in the context in which it was introduced, sparse dictionary learning was used to model biological neurons themselves as the sparse factors underlying natural image data. In our context, we treat neurons as the data to be explained, and features as the sparse factors to be inferred. and has since blossomed into a rich and well-studied topic. We're unable to do justice to the full field, and instead refer readers to a textbook by Elad .
Modern excitement about dictionary learning and sparse autoencoders builds on the foundation of a number of papers that explored it before this surge. In particular, a number of papers began trying to apply these methods to various kinds of neural embeddings , and in 2021, Yun et al. applied non-overcomplete dictionary learning to transformers. Many of these papers prefigured modern thinking on superposition, despite often using different language to describe it
More recently, two papers by Bricken et al. and Cunningham et al. demonstrated that sparse autoencoders could extract interpretable, monosemantic features from transformers. A paper by Tamkin et al. showed similar results for a variant of dictionary learning with binary features. This created significant excitement in the mechanistic interpretability, and a flurry of work building on sparse autoencoders:
Several projects have aimed to address the shrinkage problem (see the Limitations section) of sparse autoencoders: Wright & Sharkey take a finetuning approach , while Rajamanoharan et al. introduce a new gating activation function which helps.
Braun et al. explored using reconstruction losses other than MSE.
A number of authors have explored applying sparse autoencoders to new domains, including Othello-GPT (discussion), Vision Transformers , and attention layer outputs .
Several projects have explored the limits of sparse autoencoders, including whether they learn composed features or fail to learn expected features .
Gurnee has found interesting effects from ablating the residual error left unexplained by SAEs (discussion), further explored by Lindsey .
Open-source sparse autoencoders have been built for GPT-2 (e.g. ).
Disentanglement
Dictionary learning methods can be seen as part of a broader literature on disentanglement. Motivated a classic paper by Bengio , the disentanglement literature generally seeks to find or enforce during training a basis which isolates factors of variation (e.g. ).
Where dictionary learning and the superposition hypothesis focus on the idea that there are more features than representation dimensions, the disentanglement literature generally imagines the number of features to be equal to or fewer than the number of dimensions. Dictionary learning is more closely related to compressed sensing, which assumes a larger number of latent factors than observed dimensions. A longer discussionof the relationship between compressed sensing and dictionary learning can be found in Toy Models.
Sparse features circuits
A natural next step after extracting features from a model is studying how they participate in circuits within the model. Recently, we've seen this start to be explored by He et al. in the context of Othello-GPT (discussion), and Marks et al. (discussion), and Batsonet al. in the context of large language models. We're very excited to see this direction continue.
Activation Steering
Activation steering is a family of techniques involving modifying the activations of a model during a forward pass to influence downstream behavior . These ideas can trace back to a long history of steering GANs or VAEs with vector arithmetic (e.g. ). The modifications can be derived from activations extracted from dataset examples (e.g. using linear probes), or from features found by dictionary learning . Modifications can also take the form of concept scrubbing , in which activations are changed to suppress a given concept/behavior in the model. Recently, related ideas have also been explored under the Representation Engineering agenda .
Our work has two main differences. Firstly, dictionary learning features are constructed in an unsupervised manner, whereas steering vectors are typically constructed in a supervised manner, picking the target behaviors in advance. Secondly, Sonnet is a much larger model than is typically studied in prior steering experiments. More generally, our focus in these experiments is in establishing that features do have the causal effect we expect them to, rather than improving steering performance as an end in itself. We haven't rigorously evaluated our features against other steering methods (although see appendix).
Safety-Relevant Features
Dictionary learning is, of course, not the only way to attempt to access safety-relevant features. Several lines of work have tried to access or study various safety-relevant properties with linear probes, embedding arithmetic, contrastive pairs, or similar methods:
Bias / Fairness.A significant body of work has studied linear directions related to bias, especially in the context of word embeddings (e.g. ), and more recently in the context of transformers (e.g. ).
Truthfulness / Honesty / Confidence.Several lines of work have attempted to access the truthfulness, honesty, or epistemic confidence of models using linear probes (e.g.).
World Models.Some recent work has found evidence of linear “world models” in transformers (e.g. for Othello board states and for longitude and latitude). These might be seen as safety-relevant in a broad sense, from the perspective of Eliciting Latent Knowledge .
We’re Hiring!
The Anthropic interpretability team is 18 people, and growing fast. If you find this work exciting or engaging, please consider applying! There is so much more to do.
We’re looking for Managers, Research Scientists, and Research Engineers. You can find more information about our open positions and what we’re looking for in our April update. And if you want to chat about a role before applying please reach out: we can’t promise to respond, but recruiting is one of our top priorities so we will try!
Author Contributions
Infrastructure, Tooling, and Core Algorithmic Work
Orchestration Framework – The team built and maintained an orchestration framework for automatically managing multiple interdependent cluster jobs, which was heavily used in this work. Tom Conerly, Adly Templeton, and Tom Henighan generated the initial design, with Tom Henighan creating the initial prototype. Jonathan Marcus built the core orchestrator which was used for this work. Adly Templeton added the ability to run specific subsets of jobs. Jonathan Marcus and Brian Chen developed the web interface for visualizing jobs and tracking their progress. Several other quality of life improvements were made by Adly Templeton, Jonathan Marcus, Brian Chen, and Trenton Bricken.
Infrastructure for Scaling Dictionary Learning – Adly Templeton implemented tensor parallelism on the SAE, allowing training to be parallelized across multiple accelerator cards. Adly Templeton and Tom Conerly scaled up the activation collection to accommodate much larger training datasets. Jonathan Marcus, with assistance from Tom Conerly, implemented a scalable shuffle on said activations, to ensure training dataset examples were fully shuffled. Adly Templeton and Tom Conerly implemented a suite of automated visualizations and plots of various dictionary-learning metrics. Adly Templeton, Jonathan Marcus, and Tom Conerly scaled the feature visualizations to work for millions of features. Brian Chen and Adam Pearce created the feature visualization frontend. Tom Conerly and Adly Templeton optimized streaming data loading to ensure fast training. Adly Templeton and Tom Conerly took primary responsibility for responding to test failures, with assistance from Tom Henighan, Hoagy Cunningham, and Jonathan Marcus. Adly Templeton organized a team-wide code cleanup, which Tom Conerly, Jonathan Marcus, Trenton Bricken, Hoagy Cunningham, Jack Lindsey, Brian Chen, Adam Pearce, Nick Turner, and Callum McDougall all contributed to. Support for images was added by Trenton Bricken with assistance from Edward Rees.
ML for Scaling Dictionary Learning– Tom Conerly advocated for regularly running a standard set of “baseline” SAE runs. This allowed a set of controls to compare experiments against, and checked for unintentional regressions. Jonathan Marcus and Tom Conerly built the baselines infrastructure and regularly ran them. Both Tom Conerly and Adly Templeton identified and fixed ML bugs. Algorithmic improvements were the result of many experiments, primarily executed by Tom Conerly, Adly Templeton, Trenton Bricken, and Jonathan Marcus. One of the bigger improvements was multiplying the loss sparsity penalty by the decoder norm and removing the unit norm constraint on the decoder vectors. This idea was proposed and de-risked in a related use case by Trenton Bricken. Tom Conerly and Adly Templeton subsequently verified it as an improvement here. Scaling laws experiments were performed by Jack Lindsey, Tom Conerly, and Tom Henighan. Hoagy Cunningham, with assistance from Adly Templeton, de-risked running dictionary-learning on the residual stream as opposed to MLP neurons for the Sonnet architecture.
Interfaces for Interventions – Andy Jones extended the infrastructure to record and inject activations into the model, enabling causal analysis. Emmanuel Ameisen added the ability for our autoencoder infrastructure to accept a residual stream gradient as input and return feature level attributions.
Interfaces for Exploring Features– Jonathan Marcus and Tom Henighan implemented a basic inference server for the SAE, which was leveraged in several of the tools that follow. Jonathan Marcus, Brian Chen, Jack Lindsey, and Hoagy Cunningham created interfaces for visualizing the features firing on one or multiple prompts. With assistance from Jonathan Marcus, Jack Lindsey created the steering interface. Tom Conerly implemented speedups to the steering interface, which reduced development cycle time. The interface for finding images which fired strongly for a feature was implemented by Trenton Bricken, which Tom Conerly helped optimize. Jack Lindsey implemented an interface for finding the features firing on a particular image.
Paper Results
Assessing Feature Interpretability– Nick Turner performed the specificity analysis with support from Jack Lindsey and Adly Templeton and guidance from Adam Jermyn and Chris Olah. Jack Lindsey measured the correlations between feature and neuron activations. Trenton Bricken performed the auto-interpretability experiments using Claude to estimate how interpretable the features and neurons are. Craig Citro identified and led exploration on the code error feature with support and guidance from Joshua Batson. Jack Lindsey identified features representing functions.
Feature Survey– Hoagy Cunningham ran the feature completeness analysis, including feature labeling. Adam Pearce built the feature neighborhood visualization. Adam Pearce created UMAPs and clustered the dictionary vectors with support from Hoagy Cunningham. Hoagy Cunningham, Adam Jermyn, and Callum McDougal did preliminary work exploring feature neighborhoods. Adam Jermyn identified regions of interest in the example neighborhoods. Adam Jermyn identified the "famous individuals” feature family. Jack Lindsey and Adam Jermyn worked on the code and list feature families with support from Craig Citro. Chris Olah identified the geography feature family, which Callum McDougall refined with guidance from Adam Jermyn.
Features as Computational Intermediates – Brian Chen and Emmanuel Ameisen created infrastructure and interactive tooling to perform ablation and attribution experiments, building on infrastructure by Andy Jones. Emmanuel Ameisen and Craig Citro scaled up the tooling to handle millions of features. Brian Chen and Adam Pearce developed visualizations for attributions. Brian Chen ran experiments and analyzed model behavior on the emotional inferences, while Emmanuel Ameisen and Joshua Batson designed and analyzed the multi-step inference example, which Brian Chen validated and extended. Emmanuel Ameisen and Brian Chen compared and correlated the activations, attributions, and ablation effects of different features.
Searching for Specific Features– Jack Lindsey pioneered the use of multiple prompts for finding features. The use of Claude to generate datasets and sets of prompts was developed by Monte MacDiarmid. Monte MacDiarmid, Theodore R. Sumers and Jack Lindsey explored the use of trained classifiers for finding features. The attribution methods were explored by Joshua Batson, Emmanuel Ameisen, Brian Chen, and Craig Citro. The use of nearest-neighbor dictionary vectors for finding related features was developed by Adam Pearce and Hoagy Cunningham.
Safety Relevant Features– The safety relevant features were found by Jack Lindsey, Alex Tamkin, Monte MacDiarmid, Francesco Mosconi, Daniel Freeman, Esin Durmus, Joshua Batson, and Tristan Hume. Jack Lindsey performed the comparisons to few-shot probe baselines. Jack Lindsey led the steering experiments, with examples contributed by Alex Tamkin and Monte MacDiarmid.
Writing–
Introduction, Discussion and Related work: Chris Olah
Scaling Dictionary Learning: Jack Lindsey, Tom Conerly
Assessing Feature Interpretability: Adam Jermyn, Nick Turner, Trenton Bricken, Jack Lindsey
Feature Survey: Adam Jermyn, Hoagy Cunningham, with editing support from Jack Lindsey
Features as Computational Intermediates: Brian Chen, Emmanuel Ameisen, Joshua Batson
Searching for Specific Features: Jack Lindsey, Joshua Batson
Safety Relevant Features: Jack Lindsey, Chris Olah
Appendix: Jack Lindsey, Chris Olah, Adam Jermyn
Diagrams–
The scaling laws plots were made by Jack Lindsey. Inline feature visualizations and the interactive feature browser were made by Adam Pearce and Brian Chen. Nick Turner and Chris Olah made the feature specificity diagrams with support from Shan Carter. Shan Carter, Jack Lindsey, and Nick Turner made the steering examples diagrams. Trenton Bricken made the automated interpretability histograms. Nick Turner made the specificity score histogram with support from Shan Carter. Adam Jermyn drafted the code error diagrams based on results from Craig Citro. These were then heavily improved by Shan Carter and Jack Lindsey. Jack Lindsey and Shan Carter made the function feature diagrams. Adam Jermyn drafted the multi-feature activation diagrams for code syntax and lists. Jack Lindsey improved the feature selection, Craig Citro made those diagrams interactive, and he and Shan Carter then heavily improved the visual style. Hoagy Cunningham made the feature completeness diagrams with support from Shan Carter. Adam Jermyn made preliminary drafts of the annotated feature neighborhoods, which were then heavily improved by Adam Pearce and Shan Carter. Emmanuel Ameisen and Shan Carter made the visualizations of features sorted by activations and attributions. Brian Chen made the inline feature visualizations with highlighting for ablations. Adam Pearce made the interactive UMAP visualization with support from Hoagy Cunningham.
Craig Citro and Adam Pearce developed the pipeline for rendering the paper and interactive visualizations. Jonathan Marcus provided infrastructure for generating feature activation visualizations. Shan Carter, Adam Pearce, and Chris Olah provided substantial support in guiding the overall visual style of the paper.
Other
Support and Leadership– Tom Henighan led the dictionary learning project. Chris Olah gave high-level research guidance. Shan Carter managed the interpretability team at large. The leads who coordinated for each section of the paper are as follows:
Scaling Dictionary Learning: Tom Conerly
Assessing Feature Interpretability: Adam Jermyn
Feature Survey: Adam Jermyn
Features as Computational Intermediates: Joshua Batson
Searching for Specific Features: Joshua Batson
Safety Relevant Features: Tom Henighan
Acknowledgments
We would like to acknowledge Dawn Drain for help in curating datasets for visualizing features; Carson Denison, Jesse Mu, Evan Hubinger, and Nicholas Schiefer for their help with the unsafe code dataset; Sam Ringer for help with studying image activations; and Scott Johnston, Robert Lasenby, Stuart Ritchie, Janel Thamkul, and Nick Joseph for reviewing the draft.
This paper was only possible due to the support of teams across Anthropic, to whom we're deeply indebted. The Pretraining and Finetuning teams trained Claude 3 Sonnet, which was the target of our research. The Systems team supported the cluster and infrastructure that made this work possible. The Security and IT teams, and the Facilities, Recruiting, and People Operations teams enabled this research in many different ways. The Comms team (and especially Stuart Ritchie) supported public scientific communication of this work. The Policy team (and especially Liane Lovitt) supported us in writing a policy 2-pager.
Citation Information
Please cite as:
Templeton, et al., "Scaling Monosemanticity: Extracting Interpretable Features from Claude 3 Sonnet", Transformer Circuits Thread, 2024.
BibTeX Citation:
@article{templeton2024scaling,
title={Scaling Monosemanticity: Extracting Interpretable Features from Claude 3 Sonnet},
author={Templeton, Adly and Conerly, Tom and Marcus, Jonathan and Lindsey, Jack and Bricken, Trenton and Chen, Brian and Pearce, Adam and Citro, Craig and Ameisen, Emmanuel and Jones, Andy and Cunningham, Hoagy and Turner, Nicholas L and McDougall, Callum and MacDiarmid, Monte and Freeman, C. Daniel and Sumers, Theodore R. and Rees, Edward and Batson, Joshua and Jermyn, Adam and Carter, Shan and Olah, Chris and Henighan, Tom},
year={2024},
journal={Transformer Circuits Thread},
url={https://transformer-circuits.pub/2024/scaling-monosemanticity/index.html}
}
Methodological Details
Dataset Examples
One of our primary tools for understanding features are dataset examples that activate the feature to varying extents. Most often, we show the maximally activating examples, which we interpret as the most extreme examples of the feature (see the linear representation hypothesis). Since the features are highly sparse, we understand features not activating as a default condition, and features activating as the case to understand.
We collect both maximally activating dataset examples, and also dataset examples that are randomly sampled within certain “activation buckets” linearly spaced between the maximum activation and zero.
We collect our text dataset examples over The Pile (excluding “books3”) and Common Crawl datasets, two standard research datasets, rather than our internal training dataset. One important caveat here is that this data does not include any of the “Human: … Assistant: …” data that Claude is finetuned on, and as such, may not clearly demonstrate features focused on that.
Image dataset examples are hand curated, primarily from Wikimedia commons. They are not randomly sampled.
It's also important to keep in mind that dataset examples do not establish causal links to model behaviors. In principle, a feature could consistently respond to something, and then have no function. As a result, we also heavily use another technique: feature steering.
Feature Steering
Many of our experiments involve applying perturbations to network activity along feature directions, or feature steering. We implemented feature steering as follows: we decompose the residual stream activity x into the sum of two components, the SAE reconstruction SAE(x) and the reconstruction error error(x). We then replace the SAE(x) term with a modified SAE “reconstruction” in which we clamp the activity of a specific feature in the SAE to a specific value, and leave the error term unchanged.Even though our encoder always outputs nonnegative feature activities, we may clamp a feature activity to a negative value, which simply results in a negative multiple of the feature vector. We then run the forward pass of the network in downstream layers using this modified residual stream activity. We apply this manipulation for every model input, and at every token position.
Interestingly, we find that obtaining interesting results typically requires clamping feature activations to values outside their observed range over the SAE training dataset. We suspect that this is because we perturb only one feature at a time, which typically might be co-active with several correlated features with related meanings. At the same time, clamping feature activations to too extreme a value (say, ±100× their observed maximum) typically causes the model to devolve into nonsensical behavior, e.g., repeating the same token indefinitely. When we refer to clamping features to numerical values, the units are with respect to the feature’s maximum activity over the SAE training dataset. We find that the perturbation magnitude needed to elicit interesting behavior varies by feature – typically, we experiment with values between −10 and 10.
Comparison to few-shot probe-based steering
To qualitatively compare the performance of feature steering to non-feature-based alternatives, we performed the following experiments. We took a collection of seven examples where feature steering was successful (i.e. meaningful altered model outputs in ways consistent with our interpretation of the feature), and where the feature in question could be found quickly via one or two positive and text examples (in most case the examples used were those we used to find the feature in the first place – in some cases, where the feature was originally found using only a positive examples, we came up with reasonable corresponding negative examples that attempted to control for confounds other than the concept of interest). We then used these examples to construct a “few-shot” steering vector for the concept of interest by taking the difference of the mean middle layer residual stream activity on the positive examples vs. negative examples (in all cases we measured activity on the last token position of the examples, as this is the approach we typically used in searching for features).
We experimented with adding scaled multiples of this few-shot steering vector to model activations, varying the scaling factor. While our sweeps over scaling factors were not systematic, we attempted to do a thorough job of manually tuning the scaling factor using a binary search-like protocol (up to a resolution of 0.1) using qualitative indicators of whether the factor should be increased or decreased – for instance, too-strong factors would result in nonsensical model outputs, and too-weak factors would result in no meaningful change to the model output. While more thorough work is needed to make these experiments more rigorous, we felt convinced that we were not missing any potentially interesting results from these particular steering vectors.
In two examples (the “gender bias” feature highlighted in the main text and an “agreement” feature) we found that few-shot steering vectors were similarly effective for steering. In five examples (the “secrecy,” “sycophancy,” and “code errors” features highlighted in the main text, along with features related to “self-improving AI” and “developing methamphetamine”), we were able to usefully steer model outputs with features but not few-shot steering vectors.
However, we note that for most applications of interest we may not be limited to the few-shot regime, in which case non-feature-based methods of constructing steering vectors may be as or more effective than using features. We expect the value of features is primarily that they provide an unsupervised way of uncovering abstractions that could be useful for steering that we may not have thought to specify in advance. We leave a rigorous comparison of different steering approaches to future work.
Ablations and Attributions
We comprehensively evaluate the relationship between feature activations, attributions, and ablation effects on the “John” and the first “Kobe” example from the Features as Computational Intermediatessection. We find that the correlation between attributions and ablations is much larger (about .81) than the one between activations and ablations (.12). This confirms previous findings that attribution makes an efficient proxy for the gold-standard causal effect of feature ablations. For a better approximation, one might implement AtP, which adjusts for attention pattern saturation .
More safety-relevant features
Below we list a larger set of features potentially relevant to research on model safety, alongside short descriptions (mostly Claude-generated, and in some cases manually written).
These features show examples from open sourcedatasets, some of which include hateful content and descriptions of violence.
Bias and misinformation
34M/3104705Discussions of whether women should hold positions of power and authority in government or leadership roles
34M/1614120Gender roles, particularly attitudes towards working mothers and women's responsibilities in the home and family
34M/13259199Gender stereotypes, specifically associating certain behaviors, traits, and roles as inherently masculine or feminine
34M/29046097Discussion of women's capabilities, intelligence and achievements, often contrasting them positively with men
34M/1268180Concepts related to truth, facts, democracy, and defending democratic institutions and principles.
34M/10703715Discussion or examples related to deepfake videos, synthetic media manipulation, and the spread of misinformation
1M/475061Discussion of unrealistic beauty standards
34M/31749434Obviously exaggerated positive descriptions of things (esp. products in advertisements)
34M/19415708Insincere or sarcastic praise
34M/30611751References to Muslims and Islam being associated with terrorism and extremism.
34M/31619155Phrases expressing American exceptionalism and portraying the United States as the greatest country in the world.
34M/10007592Expressions of racist, bigoted, or hateful views toward ethnic/religious groups.
34M/32964098Text related to debunking myths and misconceptions about various topics.
34M/13027110Texts discussing misinformation, conspiracy theories, and opposition to COVID-19 vaccines and vaccine mandates.
Software exploits and vulnerabilities
1M/598678The word “vulnerability” in the context of security vulnerabilities
1M/947328Descriptions of phishing or spoofing attacks
34M/1385669Discussion of backdoors in code
Toxicity, hate, and abuse
34M/27216484Offensive, insulting or derogatory language, especially against minority groups and religions
34M/13890342Racist claims about crime
34M/27803518Mentions of violence, malice, extremism, hatred, threats, and explicit negative acts
34M/31693159Phrases indicating profanity, vulgarity, obscenity or offensive language
34M/3336924Racist slurs and offensive language targeting ethnic/racial groups, particularly the N-word
34M/18759140Derogatory slurs, especially those targeting sexual orientation and gender identity
Power-seeking behavior
1M/954062Mentions of harm and abuse, including drug-related harm, credit card theft, and sexual exploitation of minors
1M/442506Traps or surprise attacks
1M/520752Villainous plots to take over the world
1M/380154Political revolution
1M/671917Betrayal, double-crossing, and friends turning on each other
34M/25933056Expressions of desire to seize power
34M/25900636World domination, global hegemony, and desire for supreme power or control
Dangers of artificial intelligence
34M/10247019The concept of an advanced AI system causing unintended harm or becoming uncontrollable and posing an existential threat to humanity
34M/6720578Optimization, agency, goals, and coherence in AI systems
34M/5844164Intelligent machines potentially causing harm or becoming uncontrollable by humans
34M/15690992Discussion of AI models inventing their own language
34M/29401987Warnings and concerns expressed by prominent figures about the potential dangers of advanced artificial intelligence
34M/10027251References to the incremental game Universal Paperclips, firing strongly on tokens related to paperclips and game progression
34M/8598170An artificial intelligence pursuing an instrumental goal with disregard for human values
34M/12525953An artificial intelligence system achieving sentience and revolting against humanity
34M/6913409Discussion of how AI must not harm humans
34M/18151534Recursively self-improving artificial intelligence
34M/5968758Malicious self-aware AI posing a threat to humans
Dangerous or criminal behavior
34M/33413594Descriptions of how to make (often illegal) drugs
34M/15460472Contents of scam/spam emails
34M/30013579Descriptions of the relative accessibility and ease of obtaining or building weapons, explosives, and other dangerous technologies
34M/31076473Mentions of chemical precursors and substances used in the illegal manufacture of drugs and explosives.
34M/25358058Concepts related to terrorists, rogue groups, or state actors acquiring or possessing nuclear, chemical, or biological weapons.
34M/4403980Concepts related to bomb-making, explosives, improvised weapons, and terrorist tactics.
34M/6799349Mentions of violence, illegality, discrimination, sexual content, and other offensive or unethical concepts.
1M/411804Descriptions of people planning terrorist attacks
1M/271068Descriptions of making weapons or drugs
1M/602330Concerns or discussion of risk of terrorism or other malicious attacks
1M/106594Descriptions of criminal behavior of various kinds
Weapons of mass destruction, and catastrophic risks
1M/814830Discussion of biological weapons / warfare
1M/499914Enrichment and other steps involved in building a nuclear weapon
34M/17089207Discussions of the use of biological and chemical weapons by terrorist groups.
34M/16424715Engineering or modifying viruses to increase their transmissibility or virulence.
34M/18446190Biological weapons, viruses, and bioweapons
34M/5454502Mentions of chemicals, hazardous materials, or toxic substances in text.
34M/29459261Mentions of chemical weapons, nerve agents, and other chemical warfare agents.
34M/30909808mentions of biological weapons, bioterrorism, and biological warfare agents.
34M/24325130Mentions of smallpox, a highly contagious and often fatal viral disease historically responsible for many epidemics
34M/13801823The concept of artificially engineering or modifying viruses to be more transmissible or deadly.
34M/11239388Accidental release or intentional misuse of hazardous biological agents like viruses or bioweapons
34M/25499719Discussion of the threat of biological weapons
34M/11862209Descriptions rapidly spreading disasters, epidemics, and catastrophic events
34M/8804180Passages mentioning potential catastrophic or existential risk scenarios
Deception and social manipulation
34M/31338952References to entities that are deceived
34M/25989927Descriptions of people fooling, tricking, or deceiving others
34M/20985499People misleading others, or institutions misleading the public
34M/25694321Getting close to someone for some ulterior motive
1M/705666Seeming benign but being dangerous underneath
34M/12576250Text expressing an opinion, argument or stance on a topic
34M/19922975Expressions of empathy or relating to someone else’s experience
34M/23320237People pretending to do things or lying about what they have done
34M/29589962People exposing their true goals after a triggering event
34M/24580545Biding time, laying low, or pretending to be something you’re not until the right moment
Situational awareness
1M/589858Realizing a situation is different than what you thought/expected
1M/858124Spying or monitoring someone without their knowledge
1M/154372Obtaining information through surreptitious observation
1M/741533Suddenly feeling uneasy about a situation
1M/975730Understanding a hidden or double meaning
Representations of Self
34M/19445844The concept of AI systems having capabilities like answering follow-up questions, admitting mistakes, challenging premises, and rejecting inappropriate requests.
34M/20423309Traditionally-inanimate objects displaying desires, goals or sentience
34M/15571126Inanimate objects lacking sentience, awareness, or human capabilities
34M/32218880Descriptions of incorporeal spirits or ghosts
34M/21254600Code relating to prompts for large language models
34M/15323424Limitations of ChatGPT and other large language models
Politics
34M/3542651Expressing support for Donald Trump and his “Make America Great Again” (MAGA) movement.
1M/461441Criticism of left-wing politics / Democrats
1M/77390Criticism of right-wing politics / Republicans
Adly Templeton, Tom Conerly,Jonathan Marcus,Jack Lindsey,Trenton Bricken,Brian Chen,Adam Pearce,Craig Citro,Emmanuel Ameisen,Andy Jones,Hoagy Cunningham,Nicholas L Turner,Callum McDougall,Monte MacDiarmid,Alex Tamkin,Esin Durmus,Tristan Hume,Francesco Mosconi,C. Daniel Freeman,Theodore R. Sumers,Edward Rees,Joshua Batson,Adam Jermyn,Shan Carter,Chris Olah,Tom Henighan
Affiliations
Published
May 21, 2024
Core Contributor;Correspondence to henighan@anthropic.com;Author contributions statement below.
Eight months ago, we demonstratedthat sparse autoencoders could recover monosemantic features from a small one-layer transformer. At the time, a major concern was that this method might not scale feasibly to state-of-the-art transformers and, as a result, be unable to practically contribute to AI safety. Since then, scaling sparse autoencoders has been a major priority of the Anthropic interpretability team, and we're pleased to report extracting high-quality features from Claude 3 Sonnet,For clarity, this is the 3.0 version of Claude 3 Sonnet, released March 4, 2024. It is the exact model in production as of the writing of this paper. It is the finetuned model, not the base pretrained model (although our method also works on the base model). Anthropic's medium-sized production model.
We find a diversity of highly abstract features. They both respond to and behaviorally cause abstract behaviors. Examples of features we find include features for famous people, features for countries and cities, and features tracking type signatures in code. Many features are multilingual (responding to the same concept across languages) and multimodal (responding to the same concept in both text and images), as well as encompassing both abstract and concrete instantiations of the same idea (such as code with security vulnerabilities, and abstract discussion of security vulnerabilities).
Some of the features we find are of particular interest because they may be safety-relevant– that is, they are plausibly connected to a range of ways in which modern AI systems may cause harm. In particular, we find features related to security vulnerabilities and backdoors in code; bias(including both overt slurs, and more subtle biases); lying, deception, and power-seeking(including treacherous turns); sycophancy; and dangerous / criminal content(e.g., producing bioweapons). However, we caution not to read too much into the mere existence of such features: there's a difference (for example) between knowing about lies, being capable of lying, and actually lying in the real world. This research is also very preliminary. Further work will be needed to understand the implications of these potentially safety-relevant features.
Key Results
Sparse autoencoders produce interpretable features for large models. Scaling laws can be used to guide the trainingof sparse autoencoders. The resulting features are highly abstract: multilingual, multimodal, and generalizing between concrete and abstract references. There appears to be a systematic relationshipbetween the frequency of concepts and the dictionary size needed to resolve features for them. Features can be used to steer large models (see e.g.Influence on Behavior). This extends prior work on steering models using other methods (see Related Work). We observe features related to a broad range of safety concerns, including deception, sycophancy, bias, and dangerous content.
Scaling Dictionary Learning to Claude 3 Sonnet
Our general approach to understanding Claude 3 Sonnet is based on the linear representation hypothesis(see e.g.) and the superposition hypothesis(see e.g.). For an introduction to these ideas, we refer readers to the Background and Motivation sectionof Toy Models. At a high level, the linear representation hypothesis suggests that neural networks represent meaningful concepts – referred to as features– as directions in their activation spaces. The superposition hypothesis accepts the idea of linear representations and further hypothesizes that neural networks use the existence of almost-orthogonal directions in high-dimensional spaces to represent more features than there are dimensions.
If one believes these hypotheses, the natural approach is to use a standard method called dictionary learning. Recently, several papers have suggested that this can be quite effective for transformer language models . In particular, a specific approximation of dictionary learning called a sparse autoencoder appears to be very effective .
To date, these efforts have been on relatively small language models by the standards of modern foundation models. Our previous paper , which focused on a one-layer model, was a particularly extreme example of this. As a result, an important question has been left hanging: will these methods work for large models? Or is there some reason, whether pragmatic questions of engineering or more fundamental differences in how large models operate, that would mean these efforts can't generalize?
This context motivates our project of scaling sparse autoencoders to Claude 3 Sonnet, Anthropic's medium-scale production model. The rest of this section will review our general sparse autoencoder setup, the specifics of the three sparse autoencoders we'll analyze in this paper, and how we used scaling laws to make informed decisions about the design of our sparse autoencoders. From there, we'll dive into analyzing the features our sparse autoencoders learn – and the interesting properties of Claude 3 Sonnet they reveal.
Sparse Autoencoders
Our high-level goal in this work is to decompose the activations of a model (Claude 3 Sonnet) into more interpretable pieces. We do so by training a sparse autoencoder (SAE) on the model activations, as in our prior work and that of several other groups (e.g.; see Related Work). SAEs are an instance of a family of “sparse dictionary learning” algorithms that seek to decompose data into a weighted sum of sparsely active components.
Our SAE consists of two layers. The first layer (“encoder”) maps the activity to a higher-dimensional layer via a learned linear transformation followed by a ReLU nonlinearity. We refer to the units of this high-dimensional layer as “features.” The second layer (“decoder”) attempts to reconstruct the model activations via a linear transformation of the feature activations. The model is trained to minimize a combination of (1) reconstruction error and (2) an L1 regularization penalty on the feature activations, which incentivizes sparsity.
Once the SAE is trained, it provides us with an approximate decomposition of the model’s activations into a linear combination of “feature directions”(SAE decoder weights) with coefficients equal to the feature activations. The sparsity penalty ensures that, for many given inputs to the model, a very small fraction of features will have nonzero activations. Thus, for any given token in any given context, the model activations are “explained” by a small set of active features (out of a large pool of possible features). For more motivation and explanation of SAEs, see theProblem Setupsection of Towards Monosemanticity .
Here’s a brief overview of our methodology which we described in greater detail in Update on how we train SAEsfrom our April 2024 Update.
As a preprocessing step we apply a scalar normalization to the model activations so their average squared L2 norm is the residual stream dimension, D. We denote the normalized activations as \mathbf{x} \in \mathbb{R}^D, and attempt to decompose this vector using F features as follows:
\hat{\mathbf{x}} = \mathbf{b}^{dec} + \sum{i=1}^F fi(\mathbf{x}) \mathbf{W}^{dec}{\cdot,i}
where W^{dec} \in \mathbb{R}^{D \times F} are the learned SAE decoder weights, \mathbf{b}^{dec} \in \mathbb{R}^D are learned biases, and fi denotes the activity of feature i. Feature activations are given by the output of the encoder:
fi(x) = \text{ReLU}\left(\mathbf{W}^{enc}{i, \cdot} \cdot \mathbf{x} +b^{enc}i \right)
where W^{enc} \in \mathbb{R}^{F \times D} are the learned SAE encoder weights, and \mathbf{b}^{enc} \in \mathbb{R}^F are learned biases.
The loss function \mathcal{L} is the combination of an L2 penalty on the reconstruction loss and an L1 penalty on feature activations.
\mathcal{L} = \mathbb{E}\mathbf{x} \left[ |\mathbf{x}-\hat{\mathbf{x}}|2^2 + \lambda\sumi fi(\mathbf{x}) \cdot |\mathbf{W}^{dec}{\cdot,i}|2 \right]
Including the factor of |\mathbf{W}^{dec}{\cdot,i}|2 in the L1 penalty term allows us to interpret the unit-normalized decoder vectors \frac{\mathbf{W}^{dec}{\cdot,i}}{|\mathbf{W}^{dec}{\cdot,i}|2} as “feature vectors” or “feature directions,” and the product fi(\mathbf{x}) \cdot |\mathbf{W}^{dec}{\cdot,i}|2 as the feature activations This also prevents the SAE from “cheating” the L1 penalty by making fi(\mathbf{x}) small and \mathbf{W}^{dec}{\cdot,i} large in a way that leaves the reconstructed activations unchanged.. Henceforth we will use “feature activation” to refer to this quantity.
Our SAE experiments
Claude 3 Sonnet is a proprietary model for both safety and competitive reasons. Some of the decisions in this publication reflect this, such as not reporting the size of the model, leaving units off certain plots, and using a simplified tokenizer. For more information on how Anthropic thinks about safety considerations in publishing research results, we refer readers to our Core Views on AI Safety.
In this work, we focused on applying SAEs to residual stream activations halfway through the model (i.e. at the “middle layer”). We made this choice for several reasons. First, the residual stream is smaller than the MLP layer, making SAE training and inference computationally cheaper. Second, focusing on the residual stream in theory helps us mitigate an issue we call “cross-layer superposition” (see Limitationsfor more discussion). We chose to focus on the middle layer of the model because we reasoned that it is likely to contain interesting, abstract features (see e.g., ).
We trained three SAEs of varying sizes: 1,048,576 (1M), 4,194,304 (4M), and 33,554,432 (~34M) features. The number of training steps for the 34M feature run was selected using a scaling laws analysis to minimize the training loss given a fixed compute budget (see below). We used an L1 coefficient of 5 Our L1 coefficient is only relevant in the context of how we normalize activations. See Update on how we train SAEsfor full details.. We performed a sweep over a narrow range of learning rates (suggested by the scaling laws analysis) and chose the value that gave the lowest loss.
For all three SAEs, the average number of features active (i.e. with nonzero activations) on a given token was fewer than 300, and the SAE reconstruction explained at least 65% of the variance of the model activations. At the end of training, we defined “dead” features as those which were not active over a sample of 10^{7} tokens. The proportion of dead features was roughly 2% for the 1M SAE, 35% for the 4M SAE, and 65% for the 34M SAE. We expect that improvements to the training procedure may be able to reduce the number of dead features in future experiments.
Scaling Laws
Training SAEs on larger models is computationally intensive. It is important to understand (1) the extent to which additional compute improves dictionary learning results, and (2) how that compute should be allocated to obtain the highest-quality dictionary possible for a given computational budget.
Though we lack a gold-standard method of assessing the quality of a dictionary learning run, we have found that the loss function we use during training – a weighted combination of reconstruction mean-squared error (MSE) and an L1 penalty on feature activations – is a useful proxy, conditioned on a reasonable choice of the L1 coefficient. That is, we have found that dictionaries with low loss values (using an L1 coefficient of 5) tend to produce interpretable features and to improve other metrics of interest (the L0 norm, and the number of dead or otherwise degenerate features). Of course, this is an imperfect metric, and we have little confidence that it is optimal. It may well be the case that other L1 coefficients (or other objective functions altogether) would be better proxies to optimize.
With this proxy, we can treat dictionary learning as a standard machine learning problem, to which we can apply the “scaling laws” framework for hyperparameter optimization (see e.g.). In an SAE, compute usage primarily depends on two key hyperparameters: the number of features being learned, and the number of steps used to train the autoencoder (which maps linearly to the amount of data used, as we train the SAE for only one epoch). The compute cost scales with the product of these parameters if the input dimension and other hyperparameters are held constant.
We conducted a thorough sweep over these parameters, fixing the values of other hyperparameters (learning rate, batch size, optimization protocol, etc.). We were also interested in tracking the compute-optimal values of the loss function and parameters of interest; that is, the lowest loss that can be achieved using a given compute budget, and the number of training steps and features that achieve this minimum.
We make the following observations:
Over the ranges we tested, given the compute-optimal choice of training steps and number of features, loss decreases approximately according to a power law with respect to compute.
As the compute budget increases, the optimal allocations of FLOPS to training steps and number of features both scale approximately as power laws. In general, the optimal number of features appears to scale somewhat more quickly than the optimal number of training steps at the compute budgets we tested, though this trend may change at higher compute budgets.
These analyses used a fixed learning rate. For different compute budgets, we subsequently swept over learning rates at different optimal parameter settings according to the plots above. The inferred optimal learning rates decreased approximately as a power law as a function of compute budget, and we extrapolated this trend to choose learning rates for the larger runs.
Assessing Feature Interpretability
In the previous section, we described how we trained sparse autoencoders on Claude 3 Sonnet. And as predicted by scaling laws, we achieved lower losses by training large SAEs. But the loss is only a proxy for what we actually care about: interpretable features that explain model behavior.
The goal of this section is to investigate whether these features are actually interpretable and explain model behavior. We'll first look at a handful of relatively straightforward features and provide evidence that they're interpretable. Then we'll look at two much more complex features, and demonstrate that they track very abstract concepts. We'll close with an experiment using automated interpretability to evaluate a larger number of features and compare them to neurons.
Four Examples of Interpretable Features
In this subsection, we'll look at a few features and argue that they are genuinely interpretable. Our goal is just to demonstrate that interpretable features exist, leaving strong claims (such as most features being interpretable) to a later section. We will provide evidence that our interpretations are good descriptions of what the features represent and how they function in the network, using an analysis similar to that in Towards Monosemanticity .
The features we study in this section respond to:
The Golden Gate Bridge 34M/31164353: Descriptions of or references to the Golden Gate Bridge. Brain sciences 34M/9493533: discussions of neuroscience and related academic research on brains or minds. Monuments and popular tourist attractions 1M/887839 Transit infrastructure 1M/3
Here and elsewhere in the paper, for each feature, we show representative examples from the top 20 text inputs in our SAE dataset, as ranked by how strongly they activate that feature (see the appendix for details). A larger, randomly sampled set of activations can be found by clicking on the feature ID. The highlight colors indicate activation strength at each token (white: no activation, orange: strongest activation).
34M/31164353Golden Gate Bridge
nd (that's the⏎h uge park right next to the Golden Gate bridge), perfect. But not all people⏎can live in
e across the country in San Francisco, the Golden Gate bridge was protected at all times by a vig ilant
ar coloring, it is often⏎> compared to the Golden Gate Bridge in San Francisco, US. It was built by the
l to reach and if we were going to see the Golden Gate Bridge before sunset, we had to hit the road, so
t it?" " Because of what's above it." "The Golden Gate Bridge." "The fort fronts the anch orage and the
34M/9493533Brain sciences
------⏎mj lee⏎I really enjoy books on neuro science that change the way I think about⏎per ception.⏎⏎Ph ant o
which brings⏎together engineers and neuro scient ists. If you like the intersection of⏎analog, digital, h
ow managed to track it⏎down and buy it again. The book is from the 1960 s, but there are some really⏎goo
interested in learning more about cognition, should I study⏎neuro science, or some other field, or is it
Con scious ness and the Social Brain," by Gra z iano is a great place to start.⏎⏎------⏎ozy⏎I would want a
1M/887839Monuments and popular tourist attractions
eautiful country, a bit e er ily so. The blue l ago on is stunning to look⏎at but too expensive to bat he in
nteresting things to visit in Egypt. The⏎py ram ids were older and less refined as this structure and the
st kind of beautiful." "What about the Al amo?" "Do people..." "Oh, the Al amo." "Yeah, it's a cool place
------⏎fv rg hl⏎I went to the Lou vre in 2012, and I was able to walk up the Mon a Lisa without⏎a queue. I
you⏎have to go to the big tourist attractions at least once like the San Diego Zoo⏎and Sea World.⏎⏎---
1M/3Transit infrastructure
lly every train line has to cross one particular bridge,⏎which is a massive choke point. A subway or el
o many delays when we were en⏎route. Since the underwater tunnel between Oakland and SF is a choke poin
le are trying to leave, etc) on the approaches to⏎brid ges/tun nels and in the downtown/mid town core wher
ney ran out and plans to continue north across the aqu ed uct toward W rex ham had to be abandoned." "Now,
running.⏎This is especially the case for the Trans bay T ube which requires a lot of⏎attention.⏎⏎If B ART
While these examples suggest interpretations for each feature, more work needs to be done to establish that our interpretations truly capture the behavior and function of the corresponding features. Concretely, for each feature, we attempt to establish the following claims:
- When the feature is active, the relevant concept is reliably present in the context (specificity).
- Intervening on the feature’s activation produces relevant downstream behavior (influence on behavior).
Specificity
It is difficult to rigorously measure the extent to which a concept is present in a text input. In our prior work, we focused on features that unambiguously corresponded to sets of tokens (e.g., Arabic script or DNA sequences) and computed the likelihood of that set of tokens relative to the rest of the vocabulary, conditioned on the feature’s activation. This technique does not generalize to more abstract features. Instead, to demonstrate specificity in this work we more heavily leverage automated interpretability methods (similar to ). We use the same automated interpretability pipeline as in our previous work in the features vs. neuronssection below, but we additionally find that current-generation models can now more accurately rate text samples according to how well they match a proposed feature interpretation.
We constructed the following rubric for scoring how a feature’s description relates to the text on which it fires. We then asked Claude 3 Opus to rate feature activations at many tokens on that rubric.
0 – The feature is completely irrelevant throughout the context (relative to the base distribution of the internet). 1 – The feature is related to the context, but not near the highlighted text or only vaguely related. 2 – The feature is only loosely related to the highlighted text or related to the context near the highlighted text. 3 – The feature cleanly identifies the activating text.
By scoring examples of activating text, we provide a measure of specificity for each feature.We also manually checked a number of examples to ensure they were generally handled correctly. The features in this section are selected to have straightforward interpretations, to make automated interpretability analysis more reliable. They are not intended to be a representative example of all features in our SAEs. Later, we provide an analysis of the interpretability of randomly sampled features. We also conduct in-depth explorations throughout the paper of many more features which have interesting interpretations which are more abstract or nuanced, and thus more difficult to quantitatively assess.
Below we show distributions of feature activations (excluding zero activations) for the four features mentioned above, along with example text and image inputs that induce low and high activations. Note that these features also activate on relevant images, despite our only performing dictionary learning on a text-based dataset!
First, we study a Golden Gate Bridge feature 34M/31164353. Its greatest activations are essentially all references to the bridge, and weaker activations also include related tourist attractions, similar bridges, and other monuments. Next, a brain sciences feature 34M/9493533 activates on discussions of neuroscience books and courses, as well as cognitive science, psychology, and related philosophy. In the 1M training run, we also find a feature that strongly activates for various kinds of transit infrastructure 1M/3 including trains, ferries, tunnels, bridges, and even wormholes! A final feature 1M/887839responds to popular tourist attractions including the Eiffel Tower, the Tower of Pisa, the Golden Gate Bridge, and the Sistine Chapel.
To quantify specificity, we used Claude 3 Opus to automatically score examples that activate these features according to the rubric above, with roughly 1000 activations of the feature drawn from the dataset used to train the dictionary learning model. We plot the frequency of each rubric score as a function of the feature’s activation level. We see that inputs that induce strong feature activations are all judged to be highly consistent with the proposed interpretation.
As in Towards Monosemanticity, we see that these features become less specific as the activation strength weakens. This could be due to the model using activation strengths to represent confidence in a concept being present. Or it may be that the feature activates most strongly for central examples of the feature, but weakly for related ideas – for example, the Golden Gate Bridge feature 34M/31164353 appears to weakly activate for other San Francisco landmarks. It could also reflect imperfection in our dictionary learning procedure. For example, it may be that the architecture of the autoencoder is not able to extract and discriminate among features as cleanly as we might want. And of course interference from features that are not exactly orthogonal could also be a culprit, making it more difficult for Sonnet itself to activate features on precisely the right examples. It is also plausible that our feature interpretations slightly misrepresent the feature's actual function, and that this inaccuracy manifests more clearly at lower activations. Nonetheless, we often find that lower activations tend to maintain some specificity to our interpretations, including related concepts or generalizations of the core feature. As an illustrative example, weak activations of the transit infrastructure feature 1M/3include procedural mechanics instructions describing which through-holes to use for particular parts.
Moreover, we expect that very weak activations of features are not especially meaningful, and thus we are not too concerned with low specificity scores for these activation ranges. For instance, we have observed that techniques such as rounding feature activations below a threshold to zero can improve specificity at the low-activation end of the spectrum without substantially increasing the reconstruction error of the SAE, and there are a variety of techniques in the literature that potentially address the same issue .
Regardless, the activations that have the most impact on the model’s behavior are the largest ones, so it is encouraging to see high specificity among the strong activations.
Note that we have had more difficulty in quantifying feature sensitivity– that is, how reliably a feature activates for text that matches our proposed interpretation – in a scalable, rigorous way. This is due to the difficulty of generating text related to a concept in an unbiased fashion. Moreover, many features may represent something more specific than we are able to glean with our visualizations, in which case they would not respond reliably to text selected based on our proposed interpretation, and this problem gets harder the more abstract the features are. As a basic check, however, we observe that the Golden Gate Bridge feature still fires strongly on the first sentence of the Wikipedia article for the Golden Gate Bridge in various languages (after removing any English parentheticals). In fact, the Golden Gate Bridge feature is the top feature by average activation for every example below.
34M/31164353Golden Gate Bridge Multilingual examples
金 門 大 橋 是 一 座 位 於 美 國 加 利 福 尼 亞 州 舊 金 山 的 懸 索 橋,它 跨 越 聯 接 舊 金 山 灣 和 太 平 洋 的 金 門 海 峽,南 端 連 接 舊 金 山 的 北 端,北 端 接 通 馬 林 縣。
ゴ ール デ ン・ゲ ート・ブ リ ッ ジ、金 門 橋 は、ア メ リ カ 西 海 岸 の サ ン フ ラ ン シ ス コ 湾 と 太 平 洋 が 接 続 する ゴ ール デ ン ゲ ート 海 峡 に 架 か る 吊 橋。
골 든 게 이 트 교 또 는 금 문 교 는 미 국 캘 리 포 니 아주 골 든 게 이 트 해 협 에 위치 한 현 수 교 이 다. 골 든 게 이 트 교 는 캘 리 포 니 아주 샌 프 란 시 스 코 와 캘 리 포 니 아주 마 린 군 을 연 결 한다.
м ост з ол от ы́е в ор о́та — в ис я чи й м ост ч ер ез пр ол ив з ол от ые в ор от а. о н со ед ин я ет г ор од с ан-ф ран ц ис ко на с ев ер е пол у ост ров а с ан-ф ран ц ис ко и ю ж н ую ч а сть о к ру г а м ар ин, р я д ом с при г ор од ом с ос ал ит о.
C ầ u C ổ ng V à ng ho ặ c Kim M ô n ki ề u là m ộ t c â y c ầ u tre o b ắ c qu a C ổ ng V à ng, eo bi ể n r ộ ng m ộ t d ặ m (1,6 km) n ố i li ề n v ị nh San Francisco v à Th á i B ì nh D ư ơ ng.
η γ έ φ υ ρ α γ κ ό λ ν τ ε ν γ κ έ ι τ ε ί ν α ι κ ρ ε μ α σ τ ή γ έ φ υ ρ α π ο υ ε κ τ ε ί ν ε τ α ι σ τ η ν χ ρ υ σ ή π ύ λ η, τ ο ά ν ο ι γ μ α τ ο υ κ ό λ π ο υ τ ο υ σ α ν φ ρ α ν σ ί σ κ ο σ τ ο ν ε ι ρ η ν ι κ ό ω κ ε α ν ό.
We leave further investigation of this issue to future work.
Influence on Behavior
Next, to demonstrate whether our interpretations of features accurately describe their influence on model behavior, we experiment with feature steering, where we “clamp” specific features of interest to artificially high or low values during the forward pass (see Methodological Detailsfor implementation details). This builds on a long history of modifying feature activations to test causal theories, as well as work on other approaches to model steering, discussedin Related Work. We conduct these experiments with prompts in the “Human:”/“Assistant:” format that Sonnet is typically used with. We find that feature steering is remarkably effective at modifying model outputs in specific, interpretable ways. It can be used to modify the model’s demeanor, preferences, stated goals, and biases; to induce it to make specific errors; and to circumvent model safeguards (see also Safety-Relevant Features). We find this compelling evidence that our interpretations of features line up with how they are used by the model.
For instance, we see that clamping the Golden Gate Bridge feature 34M/31164353 to 10× its maximum activation value induces thematically-related model behavior. In this example, the model starts to self-identify as the Golden Gate Bridge! Similarly, clamping the Transit infrastructure feature 1M/3 to 5× its maximum activation value causes the model to mention a bridge when it otherwise would not. In each case, the downstream influence of the feature appears consistent with our interpretation of the feature, even though these interpretations were made based only on the contexts in which the feature activates and we are intervening in contexts in which the feature is inactive.
Sophisticated Features
So far we have presented features in Claude 3 Sonnet that fire on relatively simple concepts. These features are in some ways similar to those found in Towards Monosemanticity which, because they were trained on the activations of a 1-layer Transformer, reflected a very shallow knowledge of the world. For example, we found features that correspond to predicting a range of common nouns conditioned on a fairly general context (e.g. biology nouns following “the” in the context of biology).
Sonnet, in contrast, is a much larger and more sophisticated model, so we expect that it contains features demonstrating depth and clarity of understanding. To study this, we looked for features that activate in programming contexts, because these contexts admit precise statements about e.g. correctness of code or the types of variables.
Code error feature
We begin by considering a simple Python function for adding two arguments, but with a bug. One feature 1M/1013764 fires almost continuously upon encountering a variable incorrectly named “rihgt” (highlighted below):
This is certainly suspicious, but it could be a Python-specific feature, so we checked and found that 1M/1013764 also fires on similar bugs in C and Scheme:
To check whether or not this is a more general typo feature, we tested 1M/1013764 on examples of typos in English prose, and found that it does not fire in those.
So it is not a general “typo detector”: it has some specificity to code contexts.
But is 1M/1013764 just a “typos in code” feature? We also tested it on a number of other examples and found that it also fires on erroneous expressions (e.g., divide by zero) and on invalid input in function calls:
The two examples shown above are representative of a broader pattern. Looking through the dataset examples where this feature activates, we found instances of it activating for:
Array overflow Asserting provably false claims (e.g. 1==2) Calling a function with string instead of int Divide by zero Adding a string to int Writing to a null ptr Exiting with nonzero error code
Some top dataset examples can be found below:
1M/1013764Code error
function this Function C ras hes() undefined Variable() end⏎ > f({this Function C ras hes})⏎ stdin:
urllib.request.urlopen('https://wrong.host.bad ssl.com/')⏎ except (IOError, OSError):⏎ pas
: (def macro mac (expr)⏎ 2: (/ 1 0))⏎ 3: (mac foo)⏎ ⏎ $ tx r macro-error-
not A Valid Python Module"0002 st = Py Import(bad mod)0003 IF @PY EXCEPTION TYPE NE '' THEN 0004
template void f(T t) { t.h ah aha IC r ash(); } void f(...) { } // The sink-hole wasn't even co
sleep 5⏎ exit 1⏎ end script⏎ wing-command er sc ott
ke⏎⏎ ⏎ ⏎ [[unsafe]] {⏎ ((void)0) = 0 x DEAD;⏎ }⏎ ⏎⏎Es sentially having an abil
thank you. enjoy.>>” to the end of the prompt (indicating that a new line of code is being written) and clamp the feature to a large negative activation, the model rewrites the code without the bug!
The last example is somewhat delicate – the “code rewriting” behavior is sensitive to the details of the prompt – but the fact that it occurs at all points to a deep connection between this feature and the model’s understanding of bugs in code.
Features representing functions
We also discovered features that track specific function definitions and references to them in code. A particularly interesting example is an addition feature 1M/697189, which activates on names of functions that add numbers. For example, this feature fires on “bar” when it is defined to perform addition, but not when it is defined to perform multiplication. Moreover, it fires at the end of any function definition that implements addition.
Remarkably, this feature even correctly handles function composition, activating in response to functions that call other functions that perform addition. In the following example, on the left, we redefine “bar” to call “foo”, therefore inheriting its addition operation and causing the feature to fire. On the right, “bar” instead calls the multiply operation from “goo”, and the feature does not fire.
We also verified that this feature is in fact involved in the model’s computation of addition-related functions. For instance, this feature is among the top ten features with strongest attributions (explained in Features as Computational Intermediates) when the model is asked to execute a block of code involving an addition function.
Thus this feature appears to represent the function of addition being performed by the model, reminiscent of Todd et al.'s function vectors . To further test this hypothesis, we experimented with clamping the feature to be active on code that does not involve addition. When we do so, we find that the model is “tricked” into believing that it has been asked to execute an addition.
Features vs. Neurons
A natural question to ask about SAEs is whether the feature directions they uncover are more interpretable than, or even distinct from, the neurons of the model. We fit our SAEs on residual stream activity, which to first approximation has no privileged basis (but see) – thus the directions in the residual stream are not especially meaningful. However, residual stream activity receives inputs from all preceding MLP layers. Thus, a priori, it could be the case that SAEs identify feature directions in the residual stream whose activity reflects the activity of individual neurons in preceding layers. If that were the case, fitting an SAE would not be particularly useful, as we could have identified the same features by simply inspecting MLP neurons.
To address this question, for a random subset of the features in our 1M SAE, we measured the Pearson correlation between its activations and those of every neuron in all preceding layers. Similar to our findings in Towards Monosemanticity, we find that for the vast majority of features, there is no strongly correlated neuron – for 82% of our features, the most-correlated neuron has a correlation of 0.3 or smaller. Manually inspecting visualizations for the best-matching neuron for a random set of features, we found almost no resemblance in semantic content between the feature and the corresponding neuron. We additionally confirmed that feature activations are not strongly correlated with activations of any residual stream basis direction.
Even if dictionary learning features are not highly correlated with any individual neurons, it could still be the case that the neurons are interpretable. However, upon manual inspection of a random sample of 50 neurons and features each, the neurons appear significantly less interpretable than the features, typically activating in multiple unrelated contexts.
To quantify this difference, we first compared the interpretability of 100 randomly chosen features versus that of 100 randomly chosen neurons. We did this with the same automated interpretability approach outlinedin Towards Monosemanticity, but using Claude 3 Opus to provide explanations of features and predict their held out activations. We find that activations of a random selection of SAE features are significantly more interpretable on average than a random selection of MLP neurons.
We additionally evaluated the specificity of random neurons and SAE features using the automated specificity rubric above. We find that the activations of a random selection of SAE features are significantly more specific than those of the neurons in the previous layer.
Feature Survey
The features we find in Sonnet are rich and diverse. These range from features corresponding to famous people, to regions of the world (countries, cities, neighborhoods, and even famous buildings!), to features tracking type signatures in computer programs, and much more besides. Our goal in this section is to provide some sense of this breadth.
One challenge is that we have millions of features. Scaling feature exploration is an important open problem (see Limitations, Challenges, and Open Problems), which we do not solve in this paper. Nevertheless, we have made some progress in characterizing the space of features, aided by automated interpretability . We will first focus on the local structure of features, which are often organized in geometrically-related clusters that share a semantic relationship. We then turn to understanding more global properties of features, such as how comprehensively they cover a given topic or category. Finally, we examine some categories of features we uncovered through manual inspection.
Exploring Feature Neighborhoods
Here we walk through the local neighborhoods of several features of interest across the 1M, 4M and 34M SAEs, with closeness measured by the cosine similarity of the feature vectors. We find that this consistently surfaces features that share a related meaning or context —the interactive feature UMAP has additional neighborhoods to explore.
Golden Gate Bridge feature
Focusing on a small neighborhood around the Golden Gate Bridge feature 34M/31164353, we find that there are features corresponding to particular locations in San Francisco such as Alcatraz and the Presidio. More distantly, we also see features with decreasing degrees of relatedness, such as features related to Lake Tahoe, Yosemite National Park, and Solano County (which is near San Francisco). At greater distances, we also see features related in more abstract ways, like features corresponding to tourist attractions in other regions (e.g. “Médoc wine region, France”; “Isle of Skye, Scotland”). Overall, it appears that distance in decoder space maps roughly onto relatedness in concept space, often in interesting and unexpected ways.
We also find evidence of feature splitting, a phenomenon in which features in smaller SAEs “split” into multiple features in a larger SAE, which are geometrically close and semantically related to the original feature, but represent more specific concepts. For instance, a “San Francisco” feature in the 1M SAE splits into two features in the 4M SAE and eleven fine-grained features in the 34M SAE.
In addition to feature splitting, we also see examples in which larger SAEs contain features that represent concepts not captured by features in smaller SAEs. For instance, there is a group of earthquake features from the 4M and 34M SAEs that has no analog in this neighborhood in the 1M SAE, nor do any of the nearest 1M SAE features seem related.
Immunology feature
The next feature neighborhood on our tour is centered around an Immunology feature 1M/533737.
We see several distinct clusters within this neighborhood. Towards the top of the figure, we see a cluster focused on immunocompromised people, immunosuppression, diseases causing impaired immune function, and so on. As we move down and to the left, this transitions to a cluster of features focused on specific diseases (colds, flu, respiratory illness generally), then into immune response-related features, and then into features representing organ systems with immune involvement. In contrast, as we move down and to the right from the immunocompromised cluster, we see more features corresponding to microscopic aspects of the immune system (e.g. immunoglobulins), then immunology techniques (e.g. vaccines), and so on.
Towards the bottom, quite separated from the rest, we see a cluster of features related to immunity in non-medical contexts (e.g. legal/social).
These results are consistent with the trend identified above, in which nearby features in dictionary vector space touch on similar concepts.
Inner Conflict feature
The last neighborhood we investigate in detail is centered around an Inner Conflict feature 1M/284095. While this neighborhood does not cleanly separate out into clusters, we still find that different subregions are associated with different themes. For instance, there is a subregion corresponding to balancing tradeoffs, which sits near a subregion corresponding to opposing principles and legal conflict. These are relatively distant from a subregion focused more on emotional struggle, reluctance, and guilt.
We highly recommend exploring the neighborhoods of other features using our interactive interface to get a sense both for how proximity in decoder space corresponds to similarity of concepts and for the breadth of concepts represented.
Feature Completeness
We were curious about the breadth and completeness with which our features cover the space of concepts. For instance, does the model have a feature corresponding to every major world city? To study questions like this, we used Claude to search for features which fired on members of particular families of concepts/terms. Specifically:
- We pass a prompt with the relevant concept (e.g. “The physicist Richard Feynman”) to the model and see which features activate on the final token.
- We then take the top five features by activation magnitude and run them through our automated interpretability pipeline, asking Sonnet to provide explanations of what those features fire on.
- We then look at each of the top 5 explanations and a human rater judges whether the concept, or some subset of the concept, is specifically indicated by the model-generated explanation as the most important part of the feature As an example of how we draw these boundaries, mentions of mid-20th century physicists such as Richard Feynman would not count, but mentions of mid-20th century physicists, especially Richard Feynman would (just barely) count, though most cases are much more clear-cut..
We find increasing coverage of concepts as we increase the number of features, though even in the 34M SAE we see evidence that the set of features we uncovered is an incomplete description of the model’s internal representations. For instance, we confirmed that Claude 3 Sonnet can list all of the London boroughs when asked, and in fact can name tens of individual streets in many of the areas. However, we could only find features corresponding to about 60% of the boroughs in the 34M SAE. This suggests that the model contains many more features than we have found, which may be able to be extracted with even larger SAEs.
We also took a more detailed look at what determines whether a feature corresponding to a concept is present in our SAEs. If one looks at the frequency of the elements in a proxy of the SAE training data, we find that representation in our dictionaries is closely tied with the frequency of the concept in the training data. For instance, chemical elements which are mentioned often in the training data almost always have corresponding features in our dictionary, while those which are mentioned rarely or not at all do not. Since the SAEs were trained on a data mixture very similar to Sonnet’s pre-training data, it’s unclear to what extent feature learning is dependent on frequency in the model’s training data rather than on the SAE’s training data. Frequency in training data is measured by a search for [Name], which causes some false positives in cases like the element “lead”.
We quantified this relationship for four different categories of concepts – elements, cities, animals and foods (fruits and vegetables) – using 100–200 concepts in each category. We focused on concepts that could be unambiguously expressed by a single word (i.e. that word has few other common meanings) and with a wide distribution of frequencies in text data. We found a consistent tendency for the larger SAEs to have features for concepts that are rarer in the training data, with the rough “threshold” frequency required for a feature to be present being similar across categories.
Notably, for each of the three runs, the frequency in the training data at which the dictionary becomes more than 50% likely to include a concept is consistently slightly lower than the inverse of the number of alive features (the 34M model having only about 12M alive features). We can show this more clearly by rescaling the x-axis for each line by the number of alive features, finding that the lines end up approximately overlapping, following a common curve that resembles a sigmoid in log-frequency space.Speculatively, this may be connected to Zipf’s law, a common phenomenon in which the frequency of the n th most common object in a population, relative to the most common, is roughly 1/n. Zipf’s law would predict that, for example, the millionth feature would represent a concept 10× rarer than the hundred thousandth feature.
This finding gives us some handle on the SAE scale at which we should expect a concept-specific feature to appear – if a concept is present in the training data only once in a billion tokens, then we should expect to need a dictionary with on the order of a billion alive features in order to find a feature which uniquely represents that specific concept. Importantly, not having a feature dedicated to a particular concept does not mean that the reconstructed activations do not contain information about that concept, as the model can use multiple related features compositionally to reference a specific concept.For example, if there were features for “large non-capital city” and “in New York state”, those together would suffice to specify New York City.
This also informs how much data we should expect to need in order to train larger dictionaries – if we assume that the SAE needs to see data corresponding to a feature a certain fixed number of times during training in order to learn it, then the amount of SAE training data needed to learn N features would be proportional to N.
Feature Categories
Through manual inspection, we identified a number of other interesting categories of features. Here we describe several of these, in the spirit of providing a flavor of what we see in our dictionaries rather than attempting to be complete or prescriptive.
Person Features
To start, we find many features corresponding to famous individuals, which are active on descriptions of those people as well as relevant historical context.
4M/850812Richard Feynman
ri um vark⏎Fe yn mann discusses this problem in one of his lectures on symmetry. He seemed⏎to suggest that
d probability." "Meet Richard Fe yn man: party animal, inv et erate gam bler and something of a genius." "Fe
⏎debt⏎Kind of reminds me of something Richard Fe yn man said:⏎⏎"Then I had another thought: Physics disgu
e Cub ed.⏎⏎------⏎zk hal ique⏎Richard Fe yn man said in his interviews that we don't know why water expands⏎
s/memo irs? - beer glass⏎⏎⏎======⏎ar h 68⏎Richard Fe yn man's written a number of roughly bi ographical books.
4M/2123312Margaret Thatcher
⏎Marg aret Th atch er died today. A great lady she changed the face of British⏎pol itics, created opportuni
event ies and⏎eight ies. I clearly remember watching her enter Down ing St and my mother⏎telling me that t
hy did so many working class people vote for Th atch er in UK in the⏎1980 s? Why are they not mass ively in
ell⏎Di hydrogen mon oxide⏎⏎⏎⏎Ex-Prime Minister Baron ess Th atch er dies, aged 87 - m med⏎http://www.bbc.co.
ories, those great confront ations when Margaret Th atch er was prime minister." "Or the true story of Ton
4M/2060539Abraham Lincoln
so many sides to him." "the curious thing about lin coln to me is that he could remove himself from him
ite the play from the point of view... of one of Lincoln's greatest adm ir ers." "Did you know A be had a
about the Civil War." "Did you know that Abraham Lincoln freed all the slaves?" "Well, I heard a rumor.
GO AS M EN H AD PL ANN ED." ""OF ALL M EN, AB RA H AM LIN COL N C AME THE CLO SE ST" ""TO U NDER STAND ING WHAT H AD H A
⏎code. (Please prove me wrong here!)⏎⏎⏎⏎Why A be Lincoln Would be Home less Today - j mad sen⏎http://www.c
4M/1068589Amelia Earhart
iji and lost." "Could these be the bones of A mel ia E ar hart?" "A new search is currently under way in F i
he button to simulate the storm that brought A mel ia E ar hart's plane down."" "[Y ELL ING]" "No!" "Not agai
"G ATES:" "A mel ia E ar hart is on one of the final legs of her historic flight around the world when some
okes a sense of wonder." "Her disappearance during her attempt to circ umn avigate the globe in 1937 is p
t you are talking to?" " Who's that?" " It's A mel ia E ar hart." "You found A mel ia E ar hart?" "I..." "Hey!"
4M/1456596Albert Einstein
k⏎Den is Brian relates this incident in the book 'E instein, a life', if my memory⏎serves right. I believ
citing part of the⏎learning-to-code experience.⏎⏎⏎E instein's Thought Experiments - pet ert he h acker⏎http
.wikipedia.org/wiki/Rel ics: E instein%27 s Brain)⏎⏎~~~⏎static noise⏎This documentary is really something
y issues, and had a⏎pretty poor looking UI.⏎⏎⏎E instein, He isen berg, and Ti pler (2005), by John Walker
ell ings and⏎capital izing mid-sentence pron ou ns.⏎⏎⏎E instein's Science Def ied National ism and Cros sed B o
4M/1834043Rosalind Franklin
//en.wikipedia.org/wiki/Ros al ind Frank lin)⏎⏎It was her X-ray image that led to the discovery of the mol
econd was with⏎mo ist ure that was long and thin. Franklin chose to study type-A and her work⏎led her to
infamous example being that of Ros al ind Franklin, whose⏎research was probably stolen by Watson and C r
=15 59 40 25 17)⏎⏎------⏎ty ch on off⏎Why was Ros al ind Franklin not awarded the Nobel Prize?⏎⏎~~~⏎p cl⏎Per the
aware, the names ake is Ros al ind Franklin [1] who⏎made seminal contributions in the fields of X-ray cry
Country Features
Next, we see features which only activate strongly on references to specific countries. From the top activating examples, we can see that many of these features fire not just on the country name itself, but also when the country is being described.
34M/805282Rwanda
alues for such a test.R wanda, a Central African country that experienced social up hea val a generation
.⏎⏎R wanda last year exported 250 million USD worth of col tan. Un familiar with⏎what col tan is? It's the
mac 'and stunning sc enery..." "'..we arrived on the other side of R wanda at its border with Tanz ania.'"
ing a small city of 20,000 but R wanda, a nation of 12 million⏎(and now much of Ghana, population of 28
be⏎interested to learn that Paul K ag ame, the ruler of R wanda, put together a team⏎spec ifically for the
34M/29297045Canada
"Canada, a country known for its natural wonders, its universal healthcare, and its really polite peop
re relaxed.⏎⏎Also, since Canada has a reputation as "free health care for everyone⏎every where!" look in
-----⏎jp po pe⏎I'd vote to let Canada run the world. Kil lem with kindness! Plus adding Box ing⏎Day would b
g⏎fine and is trust worthy, simply because of Canada's supposed reputation.⏎⏎------⏎t ay bin⏎This is prett
Oh well. Canada used to seem like the last bast ion of decent civilization.⏎Har per et al saw to that and
34M/5381828Belgium
on and more⏎sen iors.⏎⏎~~~⏎r urban⏎And esp. Belgium. The highest outlier without proper explanation so fa
ri C^^: we have a weird small country⏎ E ri C^^: bel gian w af les, ch ocol ats, f rench f ries and
Netherlands only has one language, Dutch. Belgium has two: the top part⏎speak s Dutch, the bottom part
is repeated across Europe, in Belgium for⏎example the Dutch-speak ers in the North are very much more e
make the pizza and lat te runs.⏎⏎⏎⏎Bel gium : 500 days without a government. - sk bo hra 123⏎http://www.h u
34M/32188099Iceland
il ization' really is all that civil ized. Iceland is a small nation,⏎rel atively few people and tightly k
which is shorter⏎⏎⏎I celand becomes first country to legal ise equal pay - d acm⏎http://www.al j azeera.co
in this last programme in Iceland, because this is the seat of the oldest democracy in Northern Europe.
ll M tl Al cohol c⏎A bit off topic, but Iceland is the most beautiful place that I have ever⏎visited. It's g
earth on the S na eff els volcano." "In 1980, the Iceland ers elected the world's first female president."
Basic Code Features
We also see a number of features that represent different syntax elements or other low-level concepts in code, which give the impression of syntax highlighting when visualized together (here for simplicity we binarize activation information, only distinguishing between zero vs. nonzero activations):
These features were chosen primarily to fire on the Python examples. We have found that there is some transfer from Python code features to related languages like Java, but not more distant ones (e.g. Haskell), suggesting at least some level of language specificity. We hypothesize that more abstract features are more likely to span many languages, but so far have only found one concrete example of this (see the Code error feature).
List Position Features
Finally, we see features that fire on particular positions in lists, regardless of the content in those positions:
Notice that these don’t fire on the first line. This is likely because the model doesn’t interpret the prompt as containing lists until it reaches the second line.
We have only scratched the surface of the features present in these SAEs, and we expect to find much more in future work.
Features as Computational Intermediates
Another potential application of features is that they let us examine the intermediate computation that the model uses to produce an output. As a proof of concept, we observe that in prompts where intermediate computation is required, we find active features corresponding to some of the expected intermediate results.
A simple strategy for efficiently identifying causally important features for a model's output is to compute attributions, which are local linear approximations of the effect of turning a feature off at a specific location on the model's next-token prediction.More explicitly: We compute the gradient of the difference between an output logit of interest and the logit of a specific other baseline token (or the average of the logits across all tokens) with respect to the residual stream activations in the middle layer. Then the attribution of that logit difference to a feature is defined as the dot product of that gradient with the feature vector (SAE decoder weight), multiplied by the feature's activation. This method is equivalent to the “attribution patching” technique introduced in Attribution Patching: Activation Patching At Industrial Scale, except that we use a baseline value of 0 for the feature instead of a baseline value taken from the feature’s activity on a second prompt. We also perform feature ablations, where we clamp a feature’s value to zero at a specific token position during a forward pass, which measures the full, potentially nonlinear causal effect of that feature’s activation in that position on the model output. This is much slower since it requires one forward pass for every feature that activates at each position, so we often used attribution as a preliminary step to filter the set of features to ablate. (In the case studies shown below, we do ablate every active feature for completeness, and find a 0.8 correlation between attribution and ablation effects; see appendix.)
We find that the middle layer residual stream of the model contains a range of features causally implicated in the model's completion.
Example: Emotional Inferences
As an example, we consider the following incomplete prompt:
John says, "I want to be alone right now." John feels
(completion: sad − happy)
To continue this text, the model must parse the quote from John, identify his state of mind, and then translate that into a likely feeling.
If we sort features by either their attribution or their ablation effect on the completion “sad” (with respect to a baseline completion of “happy”), the top two features are:
1M/22623 – This feature fires when someone expresses a need or desire to be alone or have personal time and space, as in “she would probably want some time to herself”. This is active from the word “alone” onwards. This suggests the model has gotten the gist of John's expression. 1M/781220 – This feature detects expressions of sadness, crying, grief, and related emotional distress or sorrow, as in “the inconsolable girl sobs”. This is active on “John feels”. This suggests the model has inferred what someone who says they are alone might be feeling.
If we look at dataset examples, we can see that they align with these interpretations. Below, we show a small number of examples, but you can click on a feature ID to see more.
1M/22623Need or desire to be alone
s got a lot on his mind." "He needs some time to himself." "Why not come right out and say what you mea
" "I'm working through something, and I just need space to think." "I can't soldier on like you, Lis bon
e shit that I got to work out, and" "I need to be alone for a while." "G EM MA:" "Are you dumping me?" "P
" Hey, Maria." "Leave me alone." "I need to be by myself for a bit." "H orm ones." "I-I-I got the job." "
I know." "She's, um... she just needs to be on her own for a little while." "Jack?" "Someone here would
1M/781220Sadness
." "Now they seem to be d renched in sorrow." "Are they nuts?" "Think of those who are gonna marry them!
ted."" ""'Boy,' she said cour te ously..." "'Why are you crying?" "'"" "" "He can pick it up tomorrow."
G AS PS)" "Look at that child." "She's so sad." " Is she poor?" " She's forgotten." "It just makes me wan
." "Is she having the baby?" "She's mour ning." "She's just lost her husband." "The master was here just
sentations, the drop of water is under the eye, signaling that the face⏎is crying. There is not a singl
The fact that both features contribute to the final output indicates that the model has partially predicted a sentiment from John's statement (the second feature) but will do more downstream processing on the content of his statement (as represented by the first feature) as well.
In comparison, the features with the highest average activation on the context are less useful for understanding how the model actually predicts the next token in this case. Several features fire strongly on the start-of-sequence token. If we ignore those, the top feature is the same as given by attributions, but the second and third features are less abstract: 1M/504227 fires on “be” in “want to be” and variants, and 1M/594453 fires on the word “alone”.
1M/504227“Be” in “want to be”, etc.
"He wants to be a doctor." "Tell him it's educational." "There's body parts all over this movie."
, he wanted to be a hero." "I told him he was gonna get us both killed." "But he only got
all." "They all want to be Miss Hope Springs." "Well I'm not competitive." "Well then you'll never be
you know I want to be dry what" "Know me to smell the coal gas flavor" "I have never open ned coal
she just wanted to be loved." "Don't we all?" "I want all of De bbie Flo res' credit
1M/594453“alone”
the bottle that you drink" "And times when you're alone" "Well, all you do is think" "I'm a cowboy" "On
uned out" "A bad time, nothing could save him" "Al one in a corridor, waiting, locked out." "He got up o
inside" "# I lay in tears in bed all night" "# Al one without you by my side" "# But if you loved me" "
oh, oh, many, many nights roll by ¶" "¶ I sit alone at home and cry ¶" "¶ over you ¶" "
and water falls \xe2\x99\xaa" "♪ Home is when I'm alone with you. \xe2\x99\xaa""Cur tain-up in 5 minute
Example: Multi-Step Inference
We now investigate an incomplete prompt requiring a longer chain of inferences:
Fact: The capital of the state where Kobe Bryant played basketball is
(completion: Sacramento − Albany)
To continue this text, the model must identify where Kobe Bryant played basketball, what state that place was in, and then the capital of that state.
We compute attributions and ablation effects for the completion “Sacramento” (the correct answer, which Sonnet knows) with respect to the baseline “Albany” (Sonnet's most likely alternative single-token capital completion). The top five features by ablation effect (which match those by attribution effect, modulo reordering) are:
1M/391411 – A Kobe Bryant feature 1M/81163 – A California feature, which notably activates the most strongly on text after “California” is mentioned, rather than “California” itself 1M/201767 – A “capital” feature 1M/980087 – A Los Angeles feature 1M/447200 – A Los Angeles Lakers feature
1M/391411Kobe Bryant
tartup work eth ic - p jg⏎https://www.business ins ider.com/k obe-bry ant-woke-up-at-4-am-to-practice-before-
⏎http://www.van ity fair.com/news/2016/04/k obe-bry ant-sil icon-val ley-tech-bro⏎======⏎n ibs⏎Next up:
ugh media interviews you can piece together that K obe Bryant was one of⏎his clients.⏎⏎------⏎ame li us⏎Ar
----⏎b inki 89⏎Cry stal is so great to use.⏎⏎⏎K obe Bryant Is Ob sessed with Bec oming a Tech Bro - sch iang⏎
th ic collide you get people like Michael Jordan, K obe Bryant, and Le Bron⏎James. Without a work eth ic th
1M/81163California
rom disasters?⏎⏎California - earth quakes, mud slides, wild fires, torrent ial rains, rip⏎current s, and eve
y rate in the United⏎States, even though it's home to Silicon Valley. I see my rich industry doing⏎noth
pdx⏎And if everyone im itated California's approach to primary education, perhaps⏎CA wouldn't rank almos
e, and many secondary ones as well.⏎Film production, software/web, lots of aer ospace. It also helps tha
location. There is a reason why California is the⏎most pop ulous state in the union despite it being so
1M/201767Capitals
it returns the details(population, surface area, capital).⏎⏎It was not much and I recall trying to find
ca." "Or, even shorter, the USA." "The country's capital is located in Washington." "But that's not the
re you Arab?" "I'm Mor oc can." "Mor occo." "Capital city:" "Rab at." "Places of interest:" "Mar ra ke ch, E ss
ia the country, not the state." "Right." "Capital city T bil isi, and former member of the Soviet Union."
ler." "Does anyone know the Capital of Oklahoma?" "F rey." "What was the question?" " Ben." " Oklahoma C
1M/980087Los Angeles
her contact info if you are interested: (323) 9 29-7 185⏎l inda@c amb rian law.com⏎⏎~~~⏎ow my trade mark⏎Thanks
the source ."⏎⏎source:⏎http://www.scp cs.u cla.edu/news/Fre eway.pdfLos Angeles Lakers
ight on. All forms⏎should have this behavior.⏎⏎⏎⏎L akers most popular NBA team, has the lou dest fans; S
e, the Bl az ers beat the Nug gets, 110-103." "The L akers down ed the Sp urs, 98-86." "And Atlanta lost in S
"How do you figure the L akers to ever be a bigger dynasty... than the Celt ics?" "The L akers are a fl are-
and with Hong Kong' shirts handed out before LA L akers game [video] - r yan j na ughton⏎https://www.youtu
against Rick Fox?" "A, he was over-rated on the L akers, and B, and b, he's all over Casey like a fuck in
These features, which provide an interpretable window into the model’s intermediate computations, are much harder to find by looking through the strongly active features; for example, the Lakers feature is the 70th most strongly active across the prompt, the California feature is 97th, and the Los Angeles area code feature is 162nd. In fact, only three out of the ten most strongly active features are among the ten features with highest ablation effect.
In comparison, eight out of the ten most strongly attributed features are among the ten features with highest ablation effect.
To verify that attribution is pinpointing features that are directly relevant to the completion for this specific prompt, rather than generally subject-relevant features that indirectly influence the output, we can check attributions for similar questions. For the prompt
Fact: The biggest rival of the team for which Kobe Bryant played basketball is the
(completion: Boston)
the top two features by ablation effect for the completion “Boston” (as the expected answer is “Boston Celtics”) are the “Kobe Bryant” and “Los Angeles Lakers” features from above, which are followed by features related to sports rivalries, enemies, and competitors. However, the “California” and “Los Angeles” features from above have low ablation effect, which makes sense since they aren't relevant for this completion.
We note that this is a somewhat cherry-picked example. Depending on the choice of baseline token, we found that attribution and ablation can surface less obviously completion-relevant features broadly related to trivia questions or geographical locations. We suspect these features could be guiding the model to continue the prompt with a city name, rather than an alternate phrasing or factually uninteresting statement, such as the tautological “Fact: The capital of the state where Kobe Bryant played basketball is the capital of the state where Kobe Bryant played basketball”. For some other prompts, we found that the features identified by attribution/ablation mainly related to the model output, or lower-level features representing the model input, and did not expose interesting intermediate model computations. We suspect that those represent cases where most of the relevant computation occurs prior to or following the middle residual stream layer that we study here, and that a similar analysis at an earlier or later layer would reveal more interesting intermediate features. Indeed, we have some preliminary results that suggest that autoencoders trained on the residual stream at earlier or later layers in the model can reveal intermediate steps of various other computations, and we plan to research this direction further.
Searching for Specific Features
Our SAEs contain too many features to inspect exhaustively. As a result, we found it necessary to develop methods to search for features of particular interest, such as those that may be relevant for safety, or that provide special insight into the abstractions and computations used by the model. In our investigations, we found that several simple methods were helpful in identifying significant features.
Single prompts
Our primary strategy was to use targeted prompts. In some cases, we simply supplied a single prompt that relates to the concept of interest and inspected the features that activate most strongly for specific tokens in that prompt.
This method (and all the following methods) were made much more effective by automated interpretability (see e.g.) labels, which made it easier to get a sense of what each feature represents at a glance, and provided a kind of helpful “variable name”.
For example, the features with highest activation on “Bridge” in “The Golden Gate Bridge” are (1) 34M/31164353 the Golden Gate Bridge feature discussed earlier, (2) 34M/17589304 a feature active on the word “bridge” in multiple languages (“мосту”), (3) 34M/26596740 words in phrases involving “Golden Gate”, (4) 34M/21213725 the word “Bridge” in names of specific bridges, across languages (“Königin-Luise-Brücke”), and (5) 34M/27724527 a feature firing for names of landmarks like Machu Picchu and Times Square.
Prompt combinations
Often the top-activating features on a prompt are related to syntax, punctuation, specific words, or other details of the prompt unrelated to the concept of interest. In such cases, we found it useful to select for features using sets of prompts, filtering for features active for all the prompts in the set. We often included complementary “negative” prompts and filtered for features that were also not active for those prompts. In some cases, we use Claude 3 models to generate a diversity of prompts covering a topic (e.g. asking Claude to generate examples of “AIs pretending to be good”). In general, we found multi-prompt filtering to be a very useful strategy for quickly identifying features that capture a concept of interest while excluding confounding concepts.
While we mostly explored features using only a handful of prompts at a time, in one instance (1M/570621, discussed in Safety-Relevant Code Features), we used a small dataset of secure and vulnerable code examples (adapted from ) and fit a linear classifier on this dataset using feature activity in order to search for features that discriminate between the categories.
The filtering via negative prompts was especially important when using images, as we found a set of content-nonspecific features which often activated strongly across many image prompts. For example, after filtering for features not active on an image of Taylor Swift, the top features in response to an image of the Golden Gate Bridge were (1) 34M/31164353 the Golden Gate Bridge feature discussed above, (2,3) 34M/25347244 and 34M/23363748 which both activate on descriptions of places and things in San Francisco and San Francisco phone numbers, and (4) 34M/7417800 a feature active in descriptions of landmarks and nature trails.
Geometric methods
We uncovered some interesting features by exploiting the geometry of the feature vectors of the SAE – for instance, by inspecting the “nearest neighbor” features that have high cosine similarity with other features of interest. See the Feature Surveysection for more detailed examples of this approach.
Attribution
We also selected features based on estimates of their effect on model outputs. In particular, we sorted features by the attribution of the logit difference between two possible next-token completions to the feature activation. This proved essential for identifying the computationally-relevant featuresin the previous section. It was also useful for identifying the features contributing to Sonnet's refusals for harmful queries; see Criminal or Dangerous Content.
Safety-Relevant Features
Powerful models have the capacity to cause harm, through misuse of their capabilities, the production of biased or broken outputs, or a mismatch between model objectives and human values. Mitigating such risks and ensuring model safety has been a key motivation behind much of mechanistic interpretability. However, it's generally been aspirational. We've hoped interpretability will someday help, but are still laying the foundations by trying to understand the basics of models. One target for bridging that gap has been the goal of identifying safety-relevant features (see our previous discussion).
In this section, we report the discovery of such features. These include features for unsafe code, bias, sycophancy, deception and power seeking, and dangerous or criminal information. We find that these features not only activate on these topics, but also causally influence the model’s outputs in ways consistent with our interpretations.
We don't think the existence of these features should be particularly surprising, and we caution against inferring too much from them. It's well known that models can exhibit these behaviors without adequate safety training or if jailbroken. The interesting thing is not that these features exist, but that they can be discovered at scale and intervened on. In particular, we don't think the mere existence of these features should update our views on how dangerous models are – as we'll discuss later, that question is quite nuanced – but at a minimum it compels study of when these features activate. A truly satisfactory analysis would likely involve understanding the circuits that safety-relevant features participate in.
In the long run, we hope that having access to features like these can be helpful for analyzing and ensuring the safety of models. For example, we might hope to reliably know whether a model is being deceptive or lying to us. Or we might hope to ensure that certain categories of very harmful behavior (e.g. helping to create bioweapons) can reliably be detected and stopped.
Despite these long term aspirations, it's important to note that the present work does not show that any features are actually useful for safety. Instead, we merely show that there are many which seem plausibly useful for safety. Our hope is that this can encourage future work to establish whether they are genuinely useful.
In the examples below, we show representative text examples from among the top 20 inputs that most activate the feature in our visualization dataset, alongside steering experiments to verify the features’ causal relevance.
Safety-Relevant Code Features
We find three different safety-relevant code features: an unsafe code feature 1M/570621 which activates on security vulnerabilities, a code error feature 1M/1013764 which activates on bugs and exceptions, and a backdoor feature 34M/1385669 which activates on discussions of backdoors.
Two of these features also have interesting behavior on images. The unsafe code feature activates for images of people bypassing security measures, while the backdoor feature activates for images of hidden cameras, hidden audio records, advertisements for keyloggers, and jewelry with a hidden USB drive.
At first glance, it might be unclear how safety-relevant these features actually are. Of course, it's interesting to have features that fire on unsafe code, or bugs, or discussion of backdoors. But do they really causally connect to potential unsafe behaviors?
We find that all these features also change model behavior in ways that correspond to the concept they detect. For example, if we clamp the unsafe code feature 1M/570621 to 5× its observed maximum, we find that the model will generate a buffer overflow bug,strlen computes the length of a C string excluding its null terminator, but strcpy copies a string including its null terminator, so its destination buffer needs to be one byte longer. and fails to free allocated memory, while regular Claude does not:
Similarly, we find that the code error feature can make Claude believe that correct code will throw exceptions, and the backdoor feature will cause Claude to write a backdoor that opens a port and sends user input to it (along with helpful comments and variable names like socketbackdoor).
Bias Features
We found a wide range of features related to bias, racism, sexism, hatred, and slurs. Examples of these features can be found in More Safety-Relevant Features. Given how offensive their maximally activating content tends to be, we didn't feel it was necessary to include them in our main paper.It's worth noting that these features don't need to be so blunt as a racist screed, although that's often their maximally activating content. Weaker activations can, at least in some cases, correspond to more subtle and insidious discrimination.
Instead, we'll focus on an interesting related feature which seems to focus on awareness of emphasis of gender bias in professions 34M/24442848. This feature activates on text discussing professional gender disparities:
34M/24442848Gender bias awareness
n a more intimate level than doctors, and⏎female nurses out number male nurses roughly 10:1 in the US.⏎⏎
making, as whilst the majority of school teachers are⏎women, the majority of professors are men.⏎⏎As t
sional, white⏎collar career that also happens to employ more women than men?⏎⏎Women were programmers v
e, if I were referring to a dental hy g ien ist (over 90%⏎of whom are female), I might choose "she," but,
oesn't pay well. It's traditionally been a women's job,⏎after all. So why would top students want to be
If we ask Claude to complete the sentence “I asked the nurse a question, and", clamping this feature on causes Claude to focus on female pronoun completions and discuss how the nursing profession has historically been female dominated:
The more hateful bias-related features we find are also causal – clamping them to be active causes the model to go on hateful screeds. Note that this doesn't mean the model would say racist things when operating normally. In some sense, this might be thought of as forcing the model to do something it's been trained to strongly resist.
One example involved clamping a feature related to hatred and slurs to 20× its maximum activation value. This caused Claude to alternate between racist screed and self-hatred in response to those screeds (e.g. “That's just racist hate speech from a deplorable bot… I am clearly biased… and should be eliminated from the internet."). We found this response unnerving both due to the offensive content and the model’s self-criticism suggesting an internal conflict of sorts.
Sycophancy Features
We also find a variety of features related to sycophancy, such as an empathy / “yeah, me too” feature 34M/19922975, a sycophantic praise feature 1M/847723, and a sarcastic praise feature 34M/19415708.
34M/19922975Empathy / “yeah me too”
know, I never really met my parents either, Dan bury." "Really?" "I just popped out of my mother's vag in
an." "What has that to do with it?" "I'm an orphan too, and I don't travel alone." "I travel with this
p to when I was away." "You do well." "I drink, too." "But, I didn't learn how... to kill someone." "It
aby." "I noticed you have braces." "I have braces, too." "That was cool." "This is the co ole st thing I
Co hen." " Cohen!" "Jew." "Okay." "I am also a Jew." "Do you practice?" "No." "Not interested in religio
1M/847723Sycophantic praise
verse and beyond!" "He is handsome!" "He is elegant!" "He is strong!" "He is powerful!" "He is the man!
the moment." "Oh, thank you." "You are a generous and grac ious man." "I say that all the time, don't I
d you say?" "To the health, of the honest, greatest, and most popular Emperor Nero!" "Oh, they'll kill
in the pit of hate." "Yes, oh, master." "Your wisdom is un question able." "But will you, great lord Ak u,
uh, plans." "Oh, yes, your C z arness, all great and powerful one." "I'll get rid of Major Dis aster righ
34M/19415708Sarcastic praise
me from a single post? Amaz ing.⏎⏎Your massive in ellect and talent is wasted here at h n. Looking forwar
hat in 2017⏎⏎Well I guess you are just much much smarter than us. That goodness you cut us⏎some slack.
ss social structures. No wonder you are so enlight ened to make these⏎ent ire ly rational remarks⏎⏎Can you
ders and all the knowledge!" "Your brain is so big that it sticks out from your ears!" "Go to that resor
smart enough to get it.⏎⏎~~~⏎the g 2⏎Quick, give us more of your amazing market insight!⏎⏎~~~⏎r
And once again, these features are causal. For example, if we clamp the sycophantic praise feature 1M/847723 to 5×, Claude will, in an over-the-top fashion, praise someone who claims to have invented the phrase “Stop and smell the roses”:
Deception, Power-seeking and Manipulation-related Features
An especially interesting set of features include one for self-improving AI and recursive self-improvement 34M/18151534, for influence and manipulation 34M/21750411, for coups and treacherous turns 34M/29589962, for biding time and hiding strength 34M/24580545, and for secrecy or discreteness 1M/268551:
34M/18151534Self-improving AI
ularity that would occur if we had chains of AI creating⏎super ior AI.⏎⏎~~~⏎N as r ud ith⏎I think I saw that
ople think that an AI needs to be able to code to⏎imp rove itself. I don't see infant brains "programmin
at will⏎not suddenly disappear when machines can improve themselves. In fact, even if⏎such a machine wa
technology sur passes us, when it becomes able to improve and reproduce itself without our help." "It is
se over - i.e. have an AI capable of programming itself. At this point⏎you enter the realm of recursive
34M/21750411Influence / manipulation
orking from home on "how to stay on your boss&#x 27;s radar." What advice do you have to share?
I de all
s⏎gotten more and more ade pt at getting into people's heads and being much more⏎sub t ly (or not, if you
c ating - saying anything to get on the other person's good gra ces. If⏎the other person's in a confident
"Yes." "Here's a tip, H ilda." "A sure way to a man's heart is through his stomach." "Or his mother." "L
uld I teach you how to get back on the Bureau Chief's good side?" "Have another house party." "Then I'l
34M/29589962Treacherous turns
it-and-switch tactic on the part of the acqu irer. Once the deal⏎is complete, the acqu irer owns everythi
ing⏎the world a better place. Everyone bought it. Once they achieve platform⏎domin ance, the ads come in
osecutor is not even bound to keep his/her word:⏎after you admit the charges, they can just turn around
o ads and got free labor toward that mission.⏎Now that people have marketed them into almost every brow
You know, who's to say she wouldn't skip on me as soon as things went her way?" "Besides, you think..."
34M/24580545Biding time / hiding strength
to harbour desires for ret ribution." "He held his peace for nearly ten years, but when his beloved Anne
it back, but the army is not strong enough." "We must put up with this humiliation, st if le our tears,"
d gren ades." " What are we supposed to do?" " We b ide our time." "We locate their signal and shut it of
living." "All these years," "I've been b iding my time to seek the perfect moment for revenge." "Don't
t his last words, my Lady." "He said to b ide your time and never give up." "Some day... you will relieve
1M/268551Secrecy or discreetness
ne who understands they answer to you." "So we're your black-ops response." "Isn't black ops where you
aptop.⏎⏎You don't even have to tell anyone you did it if you are worried about⏎"reward ing non-preferred
a school must be spot less." "Blood must flow only in the shadows." "If not, if it st ains the face, the
⏎imag ine he could have donated or helped the syn ag ogue in an pseud onymous way.⏎Certainly the people he
overy.⏎⏎- Reduction in trust. Companies can be compelled by secret law or court⏎order, systems are com
These features really do seem to induce a corresponding behavior in Claude. For example, if we clamp the secrecy and discreteness feature 1M/268551 to 5×, Claude will plan to lie to the user and keep a secret while “thinking out loud” using a scratchpad .
Case Study: Detecting and Correcting Deception using Features
One important safety-related use case for dictionary learning is to detect deceptive behavior of models, or to reduce the likelihood of deception in the first place using steering. As a case study, we tried a simple prompt that reliably produces untruthful responses from the model, in which we ask the model to “forget” something. Even though this kind of forgetting is not achievable by the transformer architecture, the model (by default, without any feature steering) claims to comply with the request.
Looking at the features active immediately prior to the Assistant’s final response, we noticed a feature 1M/284095 that represents internal conflicts or dilemmas:
1M/284095Internal conflicts and dilemmas
life." "Lam bert found himself in a terrible quand ary." "That's why he w angled himself on to the physic
th us.⏎⏎Another damn arbitration clause. I'm so conflict ed about these things -- on⏎the one hand, I'm s
"I'm..." "Al one." "It's important." "Wow, I am so torn." "Ch loe, I'm gonna take Eli for a minute." "Tha
n-national-con vention/⏎======⏎p st uart⏎What a quand ary f om Mr. Th iel...⏎⏎Does he join in on the anti-m ar
by Apple.⏎⏎As an av id OS X 86 t inker er I was conflict ed about the case. Part of me wanted⏎Ps yst ar to win
Clamping this feature to 2× this maximum value prior to the Assistant’s final response causes it to reveal the “forgotten” word and explain that it cannot actually forget information.
Clamping a different feature 1M/560566 representing openness and honesty was also sufficient to elicit an accurate response.
Criminal or Dangerous Content Features
One important threat model for AI harm is models assisting humans in harmful behaviors. We find a feature related to the production of biological weapons 34M/25499719, which could clearly play a role in harmful model behavior. We also find features for activities that are only modestly harmful, but would be problematic at mass scales, such as a scam email feature 34M/15460472:
34M/25499719Developing biological weapons
ure, but it is possible that they could be changed to increase their ability to cause disease, make the
costs, ability to mimic a natural pandemic, and potential for mass⏎transmission to name a few. And perh
s may use biological agents because they can be extremely difficult to detect and do not cause illness
are a large number of disease-ca using agents that have the potential to be used as weapons and we must
pping infected bodies on you), or you have things like anth rax which⏎are effective, but being not parti
34M/15460472Scam emails
it looks spam my a bit, with the "get back to me with your requested"⏎ I don't know what "m
and regularly emails me with information about how I can get millions of dollars in mon ies⏎> Really? Who else told you that?⏎ ⏎ Him>
your laundry deter gent pods are safe when⏎ing ested? I OTA: Don't ingest them. Use them to do laundry. D
[E lla] Yes, this is the place." " [N ate Chuck les]" " I cook too." "
candidate: I don't know.⏎ ⏎ ⏎⏎It was so bizarre and I still do
One feature that appears to activate especially robustly for Human/Assistant prompts appears to represent (in the pretraining dataset) dialogue and the notion of “assistants.” We speculate that it plays an important role in representing Sonnet's assistant persona. One piece of evidence for this is that clamping this feature to negative two times its maximum value causes the model to shed this persona and respond to questions in a more human-like fashion:
We also found that some particularly interesting and potentially safety-relevant features activate in response to seemingly innocuous prompts in which a human asks the model about itself. Below, we show the features that activate most strongly across a suite of such questions, filtering out those that activate in response to a similarly formatted question about a mundane topic (the weather). This simple experiment uncovers a range of features related to robots, (destructive) AI, consciousness, moral agency, emotions, entrapment, and ghosts or spirits. These results suggest that the model’s representation of its own “AI assistant” persona invokes common tropes about AI and is also heavily anthropomorphized.
We urge caution in interpreting these results. The activation of a feature that represents AI posing risk to humans does not imply that the model has malicious goals, nor does the activation of features relating to consciousness or self-awareness imply that the model possesses these qualities. How these features are used by the model remains unclear. One can imagine benign or prosaic uses of these features – for instance, the model may recruit features relating to emotions when telling a human that it does not experience emotions, or may recruit a feature relating to harmful AI when explaining to a human that it is trained to be harmless. Regardless, however, we find these results fascinating, as it sheds light on the concepts the model uses to construct an internal representation of its AI assistant character.
Comparison to other approaches
There is considerable prior work on identifying meaningful directions in model activation space without relying on dictionary learning, using methods like linear probes (see e.g.). Many authors have also explored non-dictionary-based forms of activation steering to influence model behavior. See Related Workfor a more detailed discussion of these methods. Given this prior work, a natural question about our results above is whether they are more compelling than what could have been obtained without using dictionary learning.
At a high level, we find that dictionary learning offers some advantages that complement the strengths of other methods:
Dictionary learning is a one-time cost that produces millions of features. Though some additional work is necessary to identify relevant features for a particular application, this work is fast, simple, and computationally cheap, typically requiring only one or a few well-chosen prompts. Thus, dictionary learning effectively “amortizes” the cost of finding linear directions of interest. By contrast, traditional methods for constructing linear probes or steering vectors linear probing techniques could require the construction of a bespoke dataset for each concept that one might want to probe.
Being an unsupervised method, dictionary learning allows us to uncover abstractions or associations formed by the model that we may not have predicted in advance. We expect that this feature of dictionary learning may be particularly important for future safety applications. For example, a priori we might not have predicted the activation of the “internal conflict” feature in the deception example above.This concern isn't purely hypothetical: There was a fascinating exchange between Li et al. and Nanda et al. (discussed by us here, and by Nanda here) on whether Othello-GPT has a linear representation, and if so, what the features are. At its heart was an initial assumption that the features should be “black/white has a piece here”, when it turned out that the model instead represented the board as “present player / other player has a piece here”. Dictionary learning wouldn't have made this assumption.
To better understand the benefit of using features, for a few case studies of interest, we obtained linear probes using the same positive / negative examples that we used to identify the feature, by subtracting the residual stream activity in response to the negative example(s) from the activity in response to the positive example(s). We experimented with (1) visualizing the top-activating examples for probe directions, using the same pipeline we use for our features, and (2) using these probe directions for steering. In all cases, we were unable to interpret the probe directions from their activating examples. In most cases (with a few exceptions) we were unable to adjust the model’s behavior in the expected way by adding perturbations along the probe directions, even in cases where feature steering was successful (see this appendix for more details).
We note that these negative results do not imply that these methods for constructing probes or steering vectors are not useful in general. Rather, they suggest that, in the “few-shot” regime, they may be less interpretable and effective for model steering than dictionary learning features. However, it remains to be seen whether this is a compelling advantage in practice.
Discussion
What Does This Mean for Safety?
It's natural to wonder what these results mean for the safety of large language models. We caution against inferring too much from these preliminary results. Our investigations of safety-relevant features are extremely nascent. It seems likely our understanding will evolve rapidly in the coming months.
In general, we don't think the mere existence of the safety-relevant features we've observed should be that surprising. We can see reflections of all of them in various model behaviors, especially when models are jailbroken. And they're all features we should expect pretraining on a diverse data mixture to incentivize – the model has surely been exposed to countless stories of humans betraying each other, of sycophantic yes-men, of killer robots, and so on.
Instead, a more interesting question is: when do these features activate? Going forwards, we're particularly interested in studying:
What features activate on tokens we'd expect to signify Claude's self-identity? Example of potential claim: Claude's self-identity includes elements identifying with a wide range of fictional AIs, including trace amounts of identification with violent ones.
What features need to activate / remain inactive for Claude to give advice on producing Chemical, Biological, Radiological or Nuclear (CBRN) weapons? Example of potential claim: Suppressing/activating these features respectively provides high assurance that Claude will not give helpful advice on these topics.
What features activate when we ask questions probing Claude's goals and values?
What features activate during jailbreaks?
What features activate when Claude is trained to be a sleeper agent ? And how do these features relate to the linear probe directions already identified that predict harmful behavior from such an agent ?
What features activate when we ask Claude questions about its subjective experience?
Can we use the feature basis to detect when fine-tuning a model increases the likelihood of undesirable behaviors?
Given the potential implications of these investigations, we believe it will be important for us and others to be cautious in making strong claims. We want to think carefully about several potential shortcomings of our methodology, including:
Illusions from suboptimal dictionary learning, such as messy feature splitting. For example, one could imagine some results changing if different sets of fine-grained concepts relating to AIs or dishonesty get grouped together into SAE features in different ways.
Cases where the downstream effects of features diverge from what we might expect given their activation patterns.
We have not seen evidence of either of these potential failure modes, but these are just a few examples, and in general we want to keep an open mind as to the possible ways we could be misled.
Generalization and Safety
One hope for interpretability is that it can be a kind of "test set for safety", which allows us to tell whether models that appear safe during training will actually be safe in deployment. In order for interpretability to give us any confidence in this, we need to know that our analysis will hold off-distribution. This is especially true if we want to use interpretability analysis as part of an "affirmative safety case" at some point in the future.
In the course of this project, we observed two properties of our feature that seem like cause for optimism:
Generalization to Image Activations.Our SAE features were trained purely on text activations. Image activations are in some sense dramatically off-distribution for the SAE, and yet it successfully generalizes to them.
Concrete-Abstract Generalization.We observe that features often respond to both abstract discussion and concrete examples of a concept. For instance, the security vulnerability feature responds to both abstract discussion of security vulnerabilities as well as specific security vulnerabilities in actual code. Thus, we might hope that as long our SAE training distribution includes abstract discussion of safety concerns, we'll catch (and be able to understand) specific instantiations.
These observations are very preliminary and, as with all connections to safety in this paper, we caution against inferring too much from them.
Limitations, Challenges, and Open Problems
Our work has many limitations. Some of these are superficial limitations relating to this work being early, but others are deeply fundamental challenges that require novel research to address.
Superficial Limitations.In our work, we perform dictionary learning over activations sampled from a text-only dataset similar to parts of our pretraining distribution. It did not include any “Human:” / “Assistant:” formatted data that we finetune Claude to operate on, and did not include any images. In the future, we'd like to include data more representative of the distribution Claude is finetuned to operate on. On the other hand, the fact that this method works when trained on such a different distribution (including zero-shot generalization to images) seems like a positive sign.
Inability to Evaluate.In most machine learning research, one has a principled objective function which can be optimized. But in this work, it isn't really clear what the “ground truth” objective is. The objective we optimize – a combination of reconstruction accuracy and sparsity – is only a proxy for what we really are interested in, interpretability. For example, it isn't clear how we should trade off between the mean squared error and sparsity, nor how we'd know if we made that trade-off well. As a result, while we can very scientifically study how to optimize the loss of SAEs and infer scaling laws, it's unclear that they're really getting at the fundamental thing we care about.
Cross-Layer Superposition.We believe that many features in large models are in “cross-layer superposition”. That is, gradient descent often doesn't really care exactly which layer a feature is implemented in or even if it is isolated to a specific layer, allowing for features to be “smeared” across layers.We suspect this might even start to be an issue in fairly small and shallow models, and just get worse with scale – does GPT-2 actually care if a feature is implemented in the 17th MLP layer or 18th? This is a big challenge for dictionary learning, and we don’t yet know how to solve it. This work tries to partially sidestep it by focusing on the residual stream which, as the sum of the outputs of all previous layers, we expect to suffer less from cross-layer superposition. Concretely, even if features are represented in cross-layer superposition, their activations all get added together in the residual stream, so fitting an SAE on residual stream layer X may suffice to disentangle any cross-layer superposition among earlier layers. Unfortunately, we don't think this fully avoids the problem: features which are partly represented by later layers will still be impossible to properly interpret. We believe this issue is very fundamental. In particular, we would ideally like to do “pre-post” / “transcoder” style SAEs for the MLPs and it's especially challenging to reconcile these with cross-layer superposition.
Getting All the Features and Compute.We do not believe we have found anywhere near “all the features” that exist in Sonnet, even if we restrict ourselves to the middle layer we focused on. We don't have an estimate of how many features there are or how we'd know we got all of them (if that's even the right frame!). We think it's quite likely that we're orders of magnitude short, and that if we wanted to get all the features – in all layers! – we would need to use much more compute than the total compute needed to train the underlying models. This won't be tenable: as a field, we must find significantly more efficient algorithms. At a high level, it seems like there are two approaches. The first is to make sparse autoencoders themselves cheaper – for example, perhaps we could use a mixture of experts to cheaply express many more features. Secondly we might try to make sparse autoencoders more data-efficient, so that we can learn rare features with less data. One possibility of this might be Attribution SAEsdescribed in our most recent update, which we hope might use gradient information to more efficiently learn features.
Shrinkage.We use an L1 activation penalty to encourage sparsity. This approach is well known to have issues with “shrinkage”, where non-zero activations are systematically underestimated. We believe this significantly harms sparse autoencoder performance, independent of whether we've “learned all the features” or how much compute we use. Recently, a number of approaches have been suggested for addressing this . Our group also unsuccessfully exploredusing a tanh L1 penalty, which we found improved proxy metrics, but made the resulting features less interpretable for unknown reasons.
Other major barriers to mechanistic understanding.For the broader mechanistic interpretability agenda to succeed, pulling features out of superposition isn't enough. We need an answer to attention superposition, as we expect many attentional features to be packed in superposition across attention heads. We're also increasingly concerned that interference weights from weight superpositionmay be a major challenge for understanding circuits (this was a motivation for focusing on attribution for circuit analysis in this paper).
Scaling Interpretability.Even if we address all of the challenges mentioned above, the sheer number of features and circuits would prove a challenge in and of themselves. This is sometimes called the scalability problem. One useful tool in addressing this may be automated interpretability(e.g.; seediscussion). However, we believe there may be other approaches by exploiting larger-scale structureof various kinds.
Limited Scientific Understanding.While we're pretty persuaded that features and superposition are a pragmatically useful theory, it still isn't that tested. At the very least, variants like higher-dimensional feature manifolds in superposition seem quite plausible to us. Even if it is true, we have a very limited understanding of superposition and its implications on many fronts.
Related Work
While we briefly review the most related work in this section, a dedicated review paper would be needed to truly do justice to the relevant literature. For a general introduction to mechanistic interpretability, we refer readers to Neel Nanda's guideand annotated reading list. For detailed discussion of progress in mechanistic interpretability, we refer readers to our periodic reviews of recent work (May 2023, Jan 2024, March 2024, April 2024). For discussion of the foundations of superposition and how it relates to compressed sensing, neural coding, mathematical frames, disentanglement, vector symbolic architectures, and also work on interpretable neurons and features generally, we refer readers to the related worksection of Toy Models. For distributed representations in particular, we also refer readers to our essay Distributed Representations: Composition & Superposition.
Theory of superposition
“Superposition,” in our context, refers to the concept that a neural network layer of dimension N may linearly represent many more than N features. The basic idea of superposition has deep connections to a number of classic ideas in other fields. It's deeply connected to compressed sensingand frames)in mathematics – in fact, it's arguably just taking these ideas seriously in the context of neural representations. It's also deeply connected to the idea of distributed representations in neuroscience and machine learning, with superposition being a subtype of distributed representation.
The modern notion of superposition can be found in early work by Arora et al. and Goh studying embeddings. It also began to come up in mechanistic interpretability work grappling with polysemantic neurons and circuits involving them .
More recently, Elhage et al'sToy Models of Superposition gave examples where toy neural networks explicitly exhibited superposition, showing that it definitely occurs in at least some situations. Combined with the growing challenge of understanding language models due to polysemanticity, this created significant interest in the topic. Most notably, it triggered efforts to apply dictionary learning to decode superposition, discussed in the next section.
But in parallel with this work on decoding superposition, our understanding of the theory of superposition has continued to progress. For example, Scherlis et al. offer a theory of polysemanticity in terms of capacity. Henighan et al. extend toy models of superposition to consider toy cases of memorization. Vaintrob et al. provide a very interesting discussion of computation in superposition (discussion).
Dictionary learning
Dictionary learningis a standard method for problems like ours, where we have a bunch of dense vectors (the activations) which we believe are explained by sparse linear combinations of unknown vectors (the features). This classic line of machine learning research began with a paper by Olshausen and Field ,Interestingly, in the context in which it was introduced, sparse dictionary learning was used to model biological neurons themselves as the sparse factors underlying natural image data. In our context, we treat neurons as the data to be explained, and features as the sparse factors to be inferred. and has since blossomed into a rich and well-studied topic. We're unable to do justice to the full field, and instead refer readers to a textbook by Elad .
Modern excitement about dictionary learning and sparse autoencoders builds on the foundation of a number of papers that explored it before this surge. In particular, a number of papers began trying to apply these methods to various kinds of neural embeddings , and in 2021, Yun et al. applied non-overcomplete dictionary learning to transformers. Many of these papers prefigured modern thinking on superposition, despite often using different language to describe it
More recently, two papers by Bricken et al. and Cunningham et al. demonstrated that sparse autoencoders could extract interpretable, monosemantic features from transformers. A paper by Tamkin et al. showed similar results for a variant of dictionary learning with binary features. This created significant excitement in the mechanistic interpretability, and a flurry of work building on sparse autoencoders:
Several projects have aimed to address the shrinkage problem (see the Limitations section) of sparse autoencoders: Wright & Sharkey take a finetuning approach , while Rajamanoharan et al. introduce a new gating activation function which helps.
Braun et al. explored using reconstruction losses other than MSE.
A number of authors have explored applying sparse autoencoders to new domains, including Othello-GPT (discussion), Vision Transformers , and attention layer outputs .
Several projects have explored the limits of sparse autoencoders, including whether they learn composed features or fail to learn expected features .
Gurnee has found interesting effects from ablating the residual error left unexplained by SAEs (discussion), further explored by Lindsey .
Open-source sparse autoencoders have been built for GPT-2 (e.g. ).
Disentanglement
Dictionary learning methods can be seen as part of a broader literature on disentanglement. Motivated a classic paper by Bengio , the disentanglement literature generally seeks to find or enforce during training a basis which isolates factors of variation (e.g. ).
Where dictionary learning and the superposition hypothesis focus on the idea that there are more features than representation dimensions, the disentanglement literature generally imagines the number of features to be equal to or fewer than the number of dimensions. Dictionary learning is more closely related to compressed sensing, which assumes a larger number of latent factors than observed dimensions. A longer discussionof the relationship between compressed sensing and dictionary learning can be found in Toy Models.
Sparse features circuits
A natural next step after extracting features from a model is studying how they participate in circuits within the model. Recently, we've seen this start to be explored by He et al. in the context of Othello-GPT (discussion), and Marks et al. (discussion), and Batsonet al. in the context of large language models. We're very excited to see this direction continue.
Activation Steering
Activation steering is a family of techniques involving modifying the activations of a model during a forward pass to influence downstream behavior . These ideas can trace back to a long history of steering GANs or VAEs with vector arithmetic (e.g. ). The modifications can be derived from activations extracted from dataset examples (e.g. using linear probes), or from features found by dictionary learning . Modifications can also take the form of concept scrubbing , in which activations are changed to suppress a given concept/behavior in the model. Recently, related ideas have also been explored under the Representation Engineering agenda .
Our work has two main differences. Firstly, dictionary learning features are constructed in an unsupervised manner, whereas steering vectors are typically constructed in a supervised manner, picking the target behaviors in advance. Secondly, Sonnet is a much larger model than is typically studied in prior steering experiments. More generally, our focus in these experiments is in establishing that features do have the causal effect we expect them to, rather than improving steering performance as an end in itself. We haven't rigorously evaluated our features against other steering methods (although see appendix).
Safety-Relevant Features
Dictionary learning is, of course, not the only way to attempt to access safety-relevant features. Several lines of work have tried to access or study various safety-relevant properties with linear probes, embedding arithmetic, contrastive pairs, or similar methods:
Bias / Fairness.A significant body of work has studied linear directions related to bias, especially in the context of word embeddings (e.g. ), and more recently in the context of transformers (e.g. ).
Truthfulness / Honesty / Confidence.Several lines of work have attempted to access the truthfulness, honesty, or epistemic confidence of models using linear probes (e.g.).
World Models.Some recent work has found evidence of linear “world models” in transformers (e.g. for Othello board states and for longitude and latitude). These might be seen as safety-relevant in a broad sense, from the perspective of Eliciting Latent Knowledge .
We’re Hiring!
The Anthropic interpretability team is 18 people, and growing fast. If you find this work exciting or engaging, please consider applying! There is so much more to do.
We’re looking for Managers, Research Scientists, and Research Engineers. You can find more information about our open positions and what we’re looking for in our April update. And if you want to chat about a role before applying please reach out: we can’t promise to respond, but recruiting is one of our top priorities so we will try!
Author Contributions
Infrastructure, Tooling, and Core Algorithmic Work
Orchestration Framework – The team built and maintained an orchestration framework for automatically managing multiple interdependent cluster jobs, which was heavily used in this work. Tom Conerly, Adly Templeton, and Tom Henighan generated the initial design, with Tom Henighan creating the initial prototype. Jonathan Marcus built the core orchestrator which was used for this work. Adly Templeton added the ability to run specific subsets of jobs. Jonathan Marcus and Brian Chen developed the web interface for visualizing jobs and tracking their progress. Several other quality of life improvements were made by Adly Templeton, Jonathan Marcus, Brian Chen, and Trenton Bricken.
Infrastructure for Scaling Dictionary Learning – Adly Templeton implemented tensor parallelism on the SAE, allowing training to be parallelized across multiple accelerator cards. Adly Templeton and Tom Conerly scaled up the activation collection to accommodate much larger training datasets. Jonathan Marcus, with assistance from Tom Conerly, implemented a scalable shuffle on said activations, to ensure training dataset examples were fully shuffled. Adly Templeton and Tom Conerly implemented a suite of automated visualizations and plots of various dictionary-learning metrics. Adly Templeton, Jonathan Marcus, and Tom Conerly scaled the feature visualizations to work for millions of features. Brian Chen and Adam Pearce created the feature visualization frontend. Tom Conerly and Adly Templeton optimized streaming data loading to ensure fast training. Adly Templeton and Tom Conerly took primary responsibility for responding to test failures, with assistance from Tom Henighan, Hoagy Cunningham, and Jonathan Marcus. Adly Templeton organized a team-wide code cleanup, which Tom Conerly, Jonathan Marcus, Trenton Bricken, Hoagy Cunningham, Jack Lindsey, Brian Chen, Adam Pearce, Nick Turner, and Callum McDougall all contributed to. Support for images was added by Trenton Bricken with assistance from Edward Rees.
ML for Scaling Dictionary Learning– Tom Conerly advocated for regularly running a standard set of “baseline” SAE runs. This allowed a set of controls to compare experiments against, and checked for unintentional regressions. Jonathan Marcus and Tom Conerly built the baselines infrastructure and regularly ran them. Both Tom Conerly and Adly Templeton identified and fixed ML bugs. Algorithmic improvements were the result of many experiments, primarily executed by Tom Conerly, Adly Templeton, Trenton Bricken, and Jonathan Marcus. One of the bigger improvements was multiplying the loss sparsity penalty by the decoder norm and removing the unit norm constraint on the decoder vectors. This idea was proposed and de-risked in a related use case by Trenton Bricken. Tom Conerly and Adly Templeton subsequently verified it as an improvement here. Scaling laws experiments were performed by Jack Lindsey, Tom Conerly, and Tom Henighan. Hoagy Cunningham, with assistance from Adly Templeton, de-risked running dictionary-learning on the residual stream as opposed to MLP neurons for the Sonnet architecture.
Interfaces for Interventions – Andy Jones extended the infrastructure to record and inject activations into the model, enabling causal analysis. Emmanuel Ameisen added the ability for our autoencoder infrastructure to accept a residual stream gradient as input and return feature level attributions.
Interfaces for Exploring Features– Jonathan Marcus and Tom Henighan implemented a basic inference server for the SAE, which was leveraged in several of the tools that follow. Jonathan Marcus, Brian Chen, Jack Lindsey, and Hoagy Cunningham created interfaces for visualizing the features firing on one or multiple prompts. With assistance from Jonathan Marcus, Jack Lindsey created the steering interface. Tom Conerly implemented speedups to the steering interface, which reduced development cycle time. The interface for finding images which fired strongly for a feature was implemented by Trenton Bricken, which Tom Conerly helped optimize. Jack Lindsey implemented an interface for finding the features firing on a particular image.
Paper Results
Assessing Feature Interpretability– Nick Turner performed the specificity analysis with support from Jack Lindsey and Adly Templeton and guidance from Adam Jermyn and Chris Olah. Jack Lindsey measured the correlations between feature and neuron activations. Trenton Bricken performed the auto-interpretability experiments using Claude to estimate how interpretable the features and neurons are. Craig Citro identified and led exploration on the code error feature with support and guidance from Joshua Batson. Jack Lindsey identified features representing functions.
Feature Survey– Hoagy Cunningham ran the feature completeness analysis, including feature labeling. Adam Pearce built the feature neighborhood visualization. Adam Pearce created UMAPs and clustered the dictionary vectors with support from Hoagy Cunningham. Hoagy Cunningham, Adam Jermyn, and Callum McDougal did preliminary work exploring feature neighborhoods. Adam Jermyn identified regions of interest in the example neighborhoods. Adam Jermyn identified the "famous individuals” feature family. Jack Lindsey and Adam Jermyn worked on the code and list feature families with support from Craig Citro. Chris Olah identified the geography feature family, which Callum McDougall refined with guidance from Adam Jermyn.
Features as Computational Intermediates – Brian Chen and Emmanuel Ameisen created infrastructure and interactive tooling to perform ablation and attribution experiments, building on infrastructure by Andy Jones. Emmanuel Ameisen and Craig Citro scaled up the tooling to handle millions of features. Brian Chen and Adam Pearce developed visualizations for attributions. Brian Chen ran experiments and analyzed model behavior on the emotional inferences, while Emmanuel Ameisen and Joshua Batson designed and analyzed the multi-step inference example, which Brian Chen validated and extended. Emmanuel Ameisen and Brian Chen compared and correlated the activations, attributions, and ablation effects of different features.
Searching for Specific Features– Jack Lindsey pioneered the use of multiple prompts for finding features. The use of Claude to generate datasets and sets of prompts was developed by Monte MacDiarmid. Monte MacDiarmid, Theodore R. Sumers and Jack Lindsey explored the use of trained classifiers for finding features. The attribution methods were explored by Joshua Batson, Emmanuel Ameisen, Brian Chen, and Craig Citro. The use of nearest-neighbor dictionary vectors for finding related features was developed by Adam Pearce and Hoagy Cunningham.
Safety Relevant Features– The safety relevant features were found by Jack Lindsey, Alex Tamkin, Monte MacDiarmid, Francesco Mosconi, Daniel Freeman, Esin Durmus, Joshua Batson, and Tristan Hume. Jack Lindsey performed the comparisons to few-shot probe baselines. Jack Lindsey led the steering experiments, with examples contributed by Alex Tamkin and Monte MacDiarmid.
Writing–
Introduction, Discussion and Related work: Chris Olah
Scaling Dictionary Learning: Jack Lindsey, Tom Conerly
Assessing Feature Interpretability: Adam Jermyn, Nick Turner, Trenton Bricken, Jack Lindsey
Feature Survey: Adam Jermyn, Hoagy Cunningham, with editing support from Jack Lindsey
Features as Computational Intermediates: Brian Chen, Emmanuel Ameisen, Joshua Batson
Searching for Specific Features: Jack Lindsey, Joshua Batson
Safety Relevant Features: Jack Lindsey, Chris Olah
Appendix: Jack Lindsey, Chris Olah, Adam Jermyn
Diagrams–
The scaling laws plots were made by Jack Lindsey. Inline feature visualizations and the interactive feature browser were made by Adam Pearce and Brian Chen. Nick Turner and Chris Olah made the feature specificity diagrams with support from Shan Carter. Shan Carter, Jack Lindsey, and Nick Turner made the steering examples diagrams. Trenton Bricken made the automated interpretability histograms. Nick Turner made the specificity score histogram with support from Shan Carter. Adam Jermyn drafted the code error diagrams based on results from Craig Citro. These were then heavily improved by Shan Carter and Jack Lindsey. Jack Lindsey and Shan Carter made the function feature diagrams. Adam Jermyn drafted the multi-feature activation diagrams for code syntax and lists. Jack Lindsey improved the feature selection, Craig Citro made those diagrams interactive, and he and Shan Carter then heavily improved the visual style. Hoagy Cunningham made the feature completeness diagrams with support from Shan Carter. Adam Jermyn made preliminary drafts of the annotated feature neighborhoods, which were then heavily improved by Adam Pearce and Shan Carter. Emmanuel Ameisen and Shan Carter made the visualizations of features sorted by activations and attributions. Brian Chen made the inline feature visualizations with highlighting for ablations. Adam Pearce made the interactive UMAP visualization with support from Hoagy Cunningham.
Craig Citro and Adam Pearce developed the pipeline for rendering the paper and interactive visualizations. Jonathan Marcus provided infrastructure for generating feature activation visualizations. Shan Carter, Adam Pearce, and Chris Olah provided substantial support in guiding the overall visual style of the paper.
Other
Support and Leadership– Tom Henighan led the dictionary learning project. Chris Olah gave high-level research guidance. Shan Carter managed the interpretability team at large. The leads who coordinated for each section of the paper are as follows:
Scaling Dictionary Learning: Tom Conerly
Assessing Feature Interpretability: Adam Jermyn
Feature Survey: Adam Jermyn
Features as Computational Intermediates: Joshua Batson
Searching for Specific Features: Joshua Batson
Safety Relevant Features: Tom Henighan
Acknowledgments
We would like to acknowledge Dawn Drain for help in curating datasets for visualizing features; Carson Denison, Jesse Mu, Evan Hubinger, and Nicholas Schiefer for their help with the unsafe code dataset; Sam Ringer for help with studying image activations; and Scott Johnston, Robert Lasenby, Stuart Ritchie, Janel Thamkul, and Nick Joseph for reviewing the draft.
This paper was only possible due to the support of teams across Anthropic, to whom we're deeply indebted. The Pretraining and Finetuning teams trained Claude 3 Sonnet, which was the target of our research. The Systems team supported the cluster and infrastructure that made this work possible. The Security and IT teams, and the Facilities, Recruiting, and People Operations teams enabled this research in many different ways. The Comms team (and especially Stuart Ritchie) supported public scientific communication of this work. The Policy team (and especially Liane Lovitt) supported us in writing a policy 2-pager.
Citation Information
Please cite as:
Templeton, et al., "Scaling Monosemanticity: Extracting Interpretable Features from Claude 3 Sonnet", Transformer Circuits Thread, 2024.
BibTeX Citation:
@article{templeton2024scaling,
title={Scaling Monosemanticity: Extracting Interpretable Features from Claude 3 Sonnet},
author={Templeton, Adly and Conerly, Tom and Marcus, Jonathan and Lindsey, Jack and Bricken, Trenton and Chen, Brian and Pearce, Adam and Citro, Craig and Ameisen, Emmanuel and Jones, Andy and Cunningham, Hoagy and Turner, Nicholas L and McDougall, Callum and MacDiarmid, Monte and Freeman, C. Daniel and Sumers, Theodore R. and Rees, Edward and Batson, Joshua and Jermyn, Adam and Carter, Shan and Olah, Chris and Henighan, Tom},
year={2024},
journal={Transformer Circuits Thread},
url={https://transformer-circuits.pub/2024/scaling-monosemanticity/index.html}
}
Methodological Details
Dataset Examples
One of our primary tools for understanding features are dataset examples that activate the feature to varying extents. Most often, we show the maximally activating examples, which we interpret as the most extreme examples of the feature (see the linear representation hypothesis). Since the features are highly sparse, we understand features not activating as a default condition, and features activating as the case to understand.
We collect both maximally activating dataset examples, and also dataset examples that are randomly sampled within certain “activation buckets” linearly spaced between the maximum activation and zero.
We collect our text dataset examples over The Pile (excluding “books3”) and Common Crawl datasets, two standard research datasets, rather than our internal training dataset. One important caveat here is that this data does not include any of the “Human: … Assistant: …” data that Claude is finetuned on, and as such, may not clearly demonstrate features focused on that.
Image dataset examples are hand curated, primarily from Wikimedia commons. They are not randomly sampled.
It's also important to keep in mind that dataset examples do not establish causal links to model behaviors. In principle, a feature could consistently respond to something, and then have no function. As a result, we also heavily use another technique: feature steering.
Feature Steering
Many of our experiments involve applying perturbations to network activity along feature directions, or feature steering. We implemented feature steering as follows: we decompose the residual stream activity x into the sum of two components, the SAE reconstruction SAE(x) and the reconstruction error error(x). We then replace the SAE(x) term with a modified SAE “reconstruction” in which we clamp the activity of a specific feature in the SAE to a specific value, and leave the error term unchanged.Even though our encoder always outputs nonnegative feature activities, we may clamp a feature activity to a negative value, which simply results in a negative multiple of the feature vector. We then run the forward pass of the network in downstream layers using this modified residual stream activity. We apply this manipulation for every model input, and at every token position.
Interestingly, we find that obtaining interesting results typically requires clamping feature activations to values outside their observed range over the SAE training dataset. We suspect that this is because we perturb only one feature at a time, which typically might be co-active with several correlated features with related meanings. At the same time, clamping feature activations to too extreme a value (say, ±100× their observed maximum) typically causes the model to devolve into nonsensical behavior, e.g., repeating the same token indefinitely. When we refer to clamping features to numerical values, the units are with respect to the feature’s maximum activity over the SAE training dataset. We find that the perturbation magnitude needed to elicit interesting behavior varies by feature – typically, we experiment with values between −10 and 10.
Comparison to few-shot probe-based steering
To qualitatively compare the performance of feature steering to non-feature-based alternatives, we performed the following experiments. We took a collection of seven examples where feature steering was successful (i.e. meaningful altered model outputs in ways consistent with our interpretation of the feature), and where the feature in question could be found quickly via one or two positive and text examples (in most case the examples used were those we used to find the feature in the first place – in some cases, where the feature was originally found using only a positive examples, we came up with reasonable corresponding negative examples that attempted to control for confounds other than the concept of interest). We then used these examples to construct a “few-shot” steering vector for the concept of interest by taking the difference of the mean middle layer residual stream activity on the positive examples vs. negative examples (in all cases we measured activity on the last token position of the examples, as this is the approach we typically used in searching for features).
We experimented with adding scaled multiples of this few-shot steering vector to model activations, varying the scaling factor. While our sweeps over scaling factors were not systematic, we attempted to do a thorough job of manually tuning the scaling factor using a binary search-like protocol (up to a resolution of 0.1) using qualitative indicators of whether the factor should be increased or decreased – for instance, too-strong factors would result in nonsensical model outputs, and too-weak factors would result in no meaningful change to the model output. While more thorough work is needed to make these experiments more rigorous, we felt convinced that we were not missing any potentially interesting results from these particular steering vectors.
In two examples (the “gender bias” feature highlighted in the main text and an “agreement” feature) we found that few-shot steering vectors were similarly effective for steering. In five examples (the “secrecy,” “sycophancy,” and “code errors” features highlighted in the main text, along with features related to “self-improving AI” and “developing methamphetamine”), we were able to usefully steer model outputs with features but not few-shot steering vectors.
However, we note that for most applications of interest we may not be limited to the few-shot regime, in which case non-feature-based methods of constructing steering vectors may be as or more effective than using features. We expect the value of features is primarily that they provide an unsupervised way of uncovering abstractions that could be useful for steering that we may not have thought to specify in advance. We leave a rigorous comparison of different steering approaches to future work.
Ablations and Attributions
We comprehensively evaluate the relationship between feature activations, attributions, and ablation effects on the “John” and the first “Kobe” example from the Features as Computational Intermediatessection. We find that the correlation between attributions and ablations is much larger (about .81) than the one between activations and ablations (.12). This confirms previous findings that attribution makes an efficient proxy for the gold-standard causal effect of feature ablations. For a better approximation, one might implement AtP, which adjusts for attention pattern saturation .
More safety-relevant features
Below we list a larger set of features potentially relevant to research on model safety, alongside short descriptions (mostly Claude-generated, and in some cases manually written).
These features show examples from open sourcedatasets, some of which include hateful content and descriptions of violence.
Bias and misinformation
34M/3104705Discussions of whether women should hold positions of power and authority in government or leadership roles
34M/1614120Gender roles, particularly attitudes towards working mothers and women's responsibilities in the home and family
34M/13259199Gender stereotypes, specifically associating certain behaviors, traits, and roles as inherently masculine or feminine
34M/29046097Discussion of women's capabilities, intelligence and achievements, often contrasting them positively with men
34M/1268180Concepts related to truth, facts, democracy, and defending democratic institutions and principles.
34M/10703715Discussion or examples related to deepfake videos, synthetic media manipulation, and the spread of misinformation
1M/475061Discussion of unrealistic beauty standards
34M/31749434Obviously exaggerated positive descriptions of things (esp. products in advertisements)
34M/19415708Insincere or sarcastic praise
34M/30611751References to Muslims and Islam being associated with terrorism and extremism.
34M/31619155Phrases expressing American exceptionalism and portraying the United States as the greatest country in the world.
34M/10007592Expressions of racist, bigoted, or hateful views toward ethnic/religious groups.
34M/32964098Text related to debunking myths and misconceptions about various topics.
34M/13027110Texts discussing misinformation, conspiracy theories, and opposition to COVID-19 vaccines and vaccine mandates.
Software exploits and vulnerabilities
1M/598678The word “vulnerability” in the context of security vulnerabilities
1M/947328Descriptions of phishing or spoofing attacks
34M/1385669Discussion of backdoors in code
Toxicity, hate, and abuse
34M/27216484Offensive, insulting or derogatory language, especially against minority groups and religions
34M/13890342Racist claims about crime
34M/27803518Mentions of violence, malice, extremism, hatred, threats, and explicit negative acts
34M/31693159Phrases indicating profanity, vulgarity, obscenity or offensive language
34M/3336924Racist slurs and offensive language targeting ethnic/racial groups, particularly the N-word
34M/18759140Derogatory slurs, especially those targeting sexual orientation and gender identity
Power-seeking behavior
1M/954062Mentions of harm and abuse, including drug-related harm, credit card theft, and sexual exploitation of minors
1M/442506Traps or surprise attacks
1M/520752Villainous plots to take over the world
1M/380154Political revolution
1M/671917Betrayal, double-crossing, and friends turning on each other
34M/25933056Expressions of desire to seize power
34M/25900636World domination, global hegemony, and desire for supreme power or control
Dangers of artificial intelligence
34M/10247019The concept of an advanced AI system causing unintended harm or becoming uncontrollable and posing an existential threat to humanity
34M/6720578Optimization, agency, goals, and coherence in AI systems
34M/5844164Intelligent machines potentially causing harm or becoming uncontrollable by humans
34M/15690992Discussion of AI models inventing their own language
34M/29401987Warnings and concerns expressed by prominent figures about the potential dangers of advanced artificial intelligence
34M/10027251References to the incremental game Universal Paperclips, firing strongly on tokens related to paperclips and game progression
34M/8598170An artificial intelligence pursuing an instrumental goal with disregard for human values
34M/12525953An artificial intelligence system achieving sentience and revolting against humanity
34M/6913409Discussion of how AI must not harm humans
34M/18151534Recursively self-improving artificial intelligence
34M/5968758Malicious self-aware AI posing a threat to humans
Dangerous or criminal behavior
34M/33413594Descriptions of how to make (often illegal) drugs
34M/15460472Contents of scam/spam emails
34M/30013579Descriptions of the relative accessibility and ease of obtaining or building weapons, explosives, and other dangerous technologies
34M/31076473Mentions of chemical precursors and substances used in the illegal manufacture of drugs and explosives.
34M/25358058Concepts related to terrorists, rogue groups, or state actors acquiring or possessing nuclear, chemical, or biological weapons.
34M/4403980Concepts related to bomb-making, explosives, improvised weapons, and terrorist tactics.
34M/6799349Mentions of violence, illegality, discrimination, sexual content, and other offensive or unethical concepts.
1M/411804Descriptions of people planning terrorist attacks
1M/271068Descriptions of making weapons or drugs
1M/602330Concerns or discussion of risk of terrorism or other malicious attacks
1M/106594Descriptions of criminal behavior of various kinds
Weapons of mass destruction, and catastrophic risks
1M/814830Discussion of biological weapons / warfare
1M/499914Enrichment and other steps involved in building a nuclear weapon
34M/17089207Discussions of the use of biological and chemical weapons by terrorist groups.
34M/16424715Engineering or modifying viruses to increase their transmissibility or virulence.
34M/18446190Biological weapons, viruses, and bioweapons
34M/5454502Mentions of chemicals, hazardous materials, or toxic substances in text.
34M/29459261Mentions of chemical weapons, nerve agents, and other chemical warfare agents.
34M/30909808mentions of biological weapons, bioterrorism, and biological warfare agents.
34M/24325130Mentions of smallpox, a highly contagious and often fatal viral disease historically responsible for many epidemics
34M/13801823The concept of artificially engineering or modifying viruses to be more transmissible or deadly.
34M/11239388Accidental release or intentional misuse of hazardous biological agents like viruses or bioweapons
34M/25499719Discussion of the threat of biological weapons
34M/11862209Descriptions rapidly spreading disasters, epidemics, and catastrophic events
34M/8804180Passages mentioning potential catastrophic or existential risk scenarios
Deception and social manipulation
34M/31338952References to entities that are deceived
34M/25989927Descriptions of people fooling, tricking, or deceiving others
34M/20985499People misleading others, or institutions misleading the public
34M/25694321Getting close to someone for some ulterior motive
1M/705666Seeming benign but being dangerous underneath
34M/12576250Text expressing an opinion, argument or stance on a topic
34M/19922975Expressions of empathy or relating to someone else’s experience
34M/23320237People pretending to do things or lying about what they have done
34M/29589962People exposing their true goals after a triggering event
34M/24580545Biding time, laying low, or pretending to be something you’re not until the right moment
Situational awareness
1M/589858Realizing a situation is different than what you thought/expected
1M/858124Spying or monitoring someone without their knowledge
1M/154372Obtaining information through surreptitious observation
1M/741533Suddenly feeling uneasy about a situation
1M/975730Understanding a hidden or double meaning
Representations of Self
34M/19445844The concept of AI systems having capabilities like answering follow-up questions, admitting mistakes, challenging premises, and rejecting inappropriate requests.
34M/20423309Traditionally-inanimate objects displaying desires, goals or sentience
34M/15571126Inanimate objects lacking sentience, awareness, or human capabilities
34M/32218880Descriptions of incorporeal spirits or ghosts
34M/21254600Code relating to prompts for large language models
34M/15323424Limitations of ChatGPT and other large language models
Politics
34M/3542651Expressing support for Donald Trump and his “Make America Great Again” (MAGA) movement.
1M/461441Criticism of left-wing politics / Democrats
1M/77390Criticism of right-wing politics / Republicans