Skip to main content
QUICK REVIEW

[论文解读] Not All Language Model Features Are One-Dimensionally Linear

Joshua Engels, Eric J. Michaud|arXiv (Cornell University)|May 23, 2024
Natural Language Processing TechniquesComputer Science被引用 3
一句话总结

本文通过证明某些特征——尤其是表示循环概念(如星期几和月份)的圆形表示——本质上是多维且不可约的,挑战了语言模型中线性表示假设。作者利用稀疏自编码器在 GPT-2 和 Mistral 7B 中发现并验证了这些特征,通过干预实验表明,这些特征在 Llama 3 8B 和 Mistral 7B 中解决模运算任务时是基本计算单元。

ABSTRACT

Recent work has proposed that language models perform computation by manipulating one-dimensional representations of concepts ("features") in activation space. In contrast, we explore whether some language model representations may be inherently multi-dimensional. We begin by developing a rigorous definition of irreducible multi-dimensional features based on whether they can be decomposed into either independent or non-co-occurring lower-dimensional features. Motivated by these definitions, we design a scalable method that uses sparse autoencoders to automatically find multi-dimensional features in GPT-2 and Mistral 7B. These auto-discovered features include strikingly interpretable examples, e.g. circular features representing days of the week and months of the year. We identify tasks where these exact circles are used to solve computational problems involving modular arithmetic in days of the week and months of the year. Next, we provide evidence that these circular features are indeed the fundamental unit of computation in these tasks with intervention experiments on Mistral 7B and Llama 3 8B, and we examine the continuity of the days of the week feature in Mistral 7B. Overall, our work argues that understanding multi-dimensional features is necessary to mechanistically decompose some model behaviors.

研究动机与目标

  • 挑战线性表示假设,该假设认为所有语言模型特征都是一维的。
  • 定义并识别大语言模型中不可约的多维特征,特别是圆形流形。
  • 证明此类特征并非仅仅是副产品,而是涉及模运算任务的基本计算单元。
  • 开发并应用一种可扩展的方法,利用稀疏自编码器发现多维特征。
  • 通过干预实验验证,圆形特征在解决星期和月份的模加法任务中至关重要。

提出的方法

  • 基于无法分解为独立或不共现的低维特征,提出不可约多维特征的形式化定义。
  • 设计一种基于稀疏自编码器(SAEs)的可扩展方法,自动发现 GPT-2 和 Mistral 7B 激活空间中的多维特征。
  • 对 SAE 词典元素进行聚类,以识别表示周期性概念(如星期几和月份)的圆形流形。
  • 构建两个任务——对星期几和月份进行模加法——以探测模型行为并测试特征使用情况。
  • 在 Mistral 7B 和 Llama 3 8B 上进行干预实验,使用激活修补法和 EVR(解释方差比)评估特征贡献。
  • 通过迭代分解法解构隐藏状态,揭示模型内部计算中可解释的圆形表示。
Figure 1: Circular representations of days of the week, months of the year, and years of the 20th century in layer 7 of GPT-2-small. These representations were discovered via clustering SAE dictionary elements, described in Section 4 . Points are colored according to the token which created the repr
Figure 1: Circular representations of days of the week, months of the year, and years of the 20th century in layer 7 of GPT-2-small. These representations were discovered via clustering SAE dictionary elements, described in Section 4 . Points are colored according to the token which created the repr

实验结果

研究问题

  • RQ1语言模型能否使用不可约多维特征(如圆形流形)来表示周期性概念(如星期几和月份)?
  • RQ2这些圆形特征是否对解决模运算任务是根本性的,还是冗余表示?
  • RQ3干预实验是否证实圆形特征是模加法任务中的主要计算单元?
  • RQ4稀疏自编码器能否可靠地发现并隔离大语言模型中的此类多维特征?
  • RQ5LLM 的隐藏状态是否可分解为包含周期性数据圆形表示的可解释组件?

主要发现

  • 作者通过稀疏自编码器在 GPT-2-small 和 Mistral 7B 中发现了星期几和月份的圆形表示,圆周上的点对应于特定标记。
  • 在 Mistral 7B 和 Llama 3 8B 上的干预实验表明,圆形特征对解决模加法任务至关重要,因为移除或干扰它们会显著降低性能。
  • EVR 分析显示,将圆形特征 γ 加入解释变量后,关键层的解释方差从约 0.7 提升至约 0.99,表明其具有极强的解释力。
  • 注意力头并未计算或传播圆形特征 γ,因为在第 25 层之前,将 γ 加入解释函数并未带来额外的方差解释。
  • 模型在第 20 至 25 层之间的 MLP 块中计算 γ,且在这些层观察到最强的干预效应,确认 MLP 是主要计算来源。
  • 隐藏状态的解构表明,模型对星期和月份的内部表示形成了连贯的圆形流形,支持多维计算的存在。
(a) Testing $S({\mathbf{a}})$ and $M_{\epsilon}({\mathbf{a}})$ on a reducible feature ${\mathbf{a}}$ .
(a) Testing $S({\mathbf{a}})$ and $M_{\epsilon}({\mathbf{a}})$ on a reducible feature ${\mathbf{a}}$ .

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。