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.
翻译:稀疏自编码器通过从稀疏瓶颈层重构激活,为从语言模型中提取可解释特征提供了一种有前景的无监督方法。由于语言模型学习大量概念,自编码器需要非常庞大才能恢复所有相关特征。然而,研究自编码器规模化特性存在困难,原因在于需要平衡重构与稀疏性目标,以及存在“死隐变量”的问题。我们提出使用k-稀疏自编码器[Makhzani and Frey, 2013]来直接控制稀疏性,从而简化调参并改善重构-稀疏性边界。此外,我们发现一些改进方法能大幅减少死隐变量,即使在我们尝试的最大规模下也是如此。运用这些技术,我们发现了关于自编码器规模与稀疏性的清晰缩放规律。我们还引入了几个基于假设特征的恢复程度、激活模式的可解释性以及下游影响的稀疏性来评估特征质量的新指标。这些指标总体上均随自编码器规模的增大而提升。为证明我们方法的可扩展性,我们在GPT-4的激活数据上训练了一个包含1600万隐变量的自编码器,处理了400亿个词元。我们开源了针对开源模型的训练代码、自编码器及可视化工具。