缩放与评估稀疏自编码器

Scaling and evaluating sparse autoencoders

亚历克·拉德福德 Alec Radford · OpenAI · 2024-06-06 · arXiv:2406.04093 ↗ · 被引 516

打开互动全文版(逐段中英对照 + 图/公式 + 论文问答)→

摘要 · Abstract

稀疏自编码器通过从稀疏瓶颈层重建激活,提供了一种有前景的无监督方法,用于从语言模型中提取可解释特征。由于语言模型学习众多概念,自编码器需要非常大才能恢复所有相关特征。然而,由于需要平衡重建和稀疏性目标以及存在死亡潜在单元,研究自编码器缩放特性很困难。我们提出使用 k-稀疏自编码器[Makhzani and Frey, 2013]直接控制稀疏性,简化调优并改善重建-稀疏性前沿。此外,我们发现了即使在尝试的最大规模下也能导致很少死亡潜在单元的修改。利用这些技术,我们发现了关于自编码器大小和稀疏性的清晰缩放规律。我们还引入了几个基于假设特征恢复、激活模式可解释性和下游效应稀疏性的新指标来评估特征质量。这些指标通常随自编码器大小增加而改善。为了展示我们方法的可扩展性,我们在 GPT-4 激活上训练了一个 1600 万潜在单元的自编码器,处理了 400 亿个 token。我们发布了训练代码和开源模型的自编码器,以及一个可视化工具。

Sparse autoencoders provide a promising unsupervised approach for extracting interpretable features from a language model by reconstructing activations from a sparse bottleneck layer. Since language models learn many concepts, autoencoders need to be very large to recover all relevant features. However, studying the properties of autoencoder scaling is difficult due to the need to balance reconstruction and sparsity objectives and the presence of dead latents. We propose using k-sparse autoencoders [Makhzani and Frey, 2013] to directly control sparsity, simplifying tuning and improving the reconstruction-sparsity frontier. Additionally, we find modifications that result in few dead latents, even at the largest scales we tried. Using these techniques, we find clean scaling laws with respect to autoencoder size and sparsity. We also introduce several new metrics for evaluating feature quality based on the recovery of hypothesized features, the explainability of activation patterns, and the sparsity of downstream effects. These metrics all generally improve with autoencoder size. To demonstrate the scalability of our approach, we train a 16 million latent autoencoder on GPT-4 activations for 40 billion tokens. We release training code and autoencoders for open-source models, as well as a visualizer.

核心贡献 · Key contributions

局限 · Limitations

论文章节 · Sections(共 21)

阅读逐段中英对照全文 →