arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2310.17230cs.LGcs.CL
收藏

码本特征:神经网络的稀疏与离散可解释性

Codebook Features: Sparse and Discrete Interpretability for Neural Networks

Anthropic;FAR AI;Stanford University(斯坦福大学)

Alex Tamkin, Mohammad Taufeeque, Noah D. Goodman

AI总结:

本文提出码本特征方法,通过向量量化瓶颈将神经网络隐藏状态变为稀疏离散码之和,在有限状态机和语言模型上验证其可解释性与可控性,性能损失适度。

摘要:

理解神经网络之所以困难,部分原因在于其隐藏状态的稠密、连续特性。我们探索是否可以通过将连续特征量化为我们称之为码本特征的形式,来训练出隐藏状态稀疏、离散且更具可解释性的神经网络。码本特征通过在每一层引入向量量化瓶颈并对神经网络进行微调而生成,由此得到的网络其隐藏特征是少量从更大码本中选取的离散向量码之和。令人惊讶的是,我们发现神经网络在这种极端瓶颈下仍能运行,且性能仅有适度下降。这种稀疏、离散的瓶颈还提供了一种直观的控制神经网络行为的方式:首先找到在期望行为出现时被激活的码,然后在生成过程中激活这些相同的码以引出该行为。我们通过在多个不同数据集上训练码本 Transformer 来验证该方法。首先,我们探索了一个隐藏状态数量远多于神经元数量的有限状态机数据集。在该设置下,我们的方法通过将状态分配给不同的码来克服叠加问题,并且我们发现可以通过激活对应状态的码,使神经网络表现得如同处于不同状态。其次,我们在两个自然语言数据集上训练了参数量高达 410M 的 Transformer 语言模型。我们在这些模型中识别出表示多样且解耦概念的码(从负面情绪到一年中的月份),并发现可以通过在推理过程中激活适当的码来引导模型生成不同主题。总体而言,码本特征似乎是一种有前景的神经网络分析与控制及可解释性单元。我们的代码库和模型已在 https://github.com/taufeeque9/codebook-features 开源。

英文摘要:

Understanding neural networks is challenging in part because of the dense, continuous nature of their hidden states. We explore whether we can train neural networks to have hidden states that are sparse, discrete, and more interpretable by quantizing their continuous features into what we call codebook features. Codebook features are produced by finetuning neural networks with vector quantization bottlenecks at each layer, producing a network whose hidden features are the sum of a small number of discrete vector codes chosen from a larger codebook. Surprisingly, we find that neural networks can operate under this extreme bottleneck with only modest degradation in performance. This sparse, discrete bottleneck also provides an intuitive way of controlling neural network behavior: first, find codes that activate when the desired behavior is present, then activate those same codes during generation to elicit that behavior. We validate our approach by training codebook Transformers on several different datasets. First, we explore a finite state machine dataset with far more hidden states than neurons. In this setting, our approach overcomes the superposition problem by assigning states to distinct codes, and we find that we can make the neural network behave as if it is in a different state by activating the code for that state. Second, we train Transformer language models with up to 410M parameters on two natural language datasets. We identify codes in these models representing diverse, disentangled concepts (ranging from negative emotions to months of the year) and find that we can guide the model to generate different topics by activating the appropriate codes during inference. Overall, codebook features appear to be a promising unit of analysis and control for neural networks and interpretability. Our codebase and models are open-sourced at https://github.com/taufeeque9/codebook-features.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑