arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.18147cs.LGcs.AIcs.CL
收藏

雅可比稀疏自编码器:稀疏化计算,而非仅稀疏化激活

Jacobian Sparse Autoencoders: Sparsify Computations, Not Just Activations

School of Engineering Mathematics and Technology, University of Bristol, Bristol, UK(工程数学与技术学院,布里斯托尔大学,布里斯托尔,英国)

Lucy Farnik, Tim Lawson, Conor Houghton, Laurence Aitchison

AI总结:

本文提出雅可比稀疏自编码器(JSAEs),通过高效计算雅可比矩阵,在保持LLM性能的同时稀疏化模型组件间的计算,并证明计算稀疏性是LLM训练习得的性质,比标准SAEs更适合理解transformer计算。

摘要:

稀疏自编码器(SAEs)已被成功用于发现大语言模型(LLMs)潜在激活的稀疏且可人工解释的表示。然而,我们最终希望理解LLMs执行的计算,而不仅仅是它们的表示。SAEs能在多大程度上帮助我们理解计算尚不清楚,因为它们在设计上并不以任何方式“稀疏化”计算,而只稀疏化潜在激活。为解决这一问题,我们提出雅可比SAEs(JSAEs),它不仅能在给定模型组件的输入和输出激活中产生稀疏性,还能在连接二者的计算(形式上为雅可比矩阵)中产生稀疏性。若采用朴素实现,LLMs中的雅可比矩阵因其规模而在计算上不可行。因此,一项关键的技术贡献是找到一种在此设置下高效计算雅可比矩阵的方法。我们发现,JSAEs能提取出相对较大程度的计算稀疏性,同时保持下游LLM性能与传统SAEs大致相当。我们还表明,雅可比矩阵是计算稀疏性的合理代理,因为当在JSAE基下重写时,MLPs近似线性。最后,我们表明,与等效的随机化LLM相比,JSAEs在预训练LLMs上实现了更大程度的计算稀疏性。这表明计算图的稀疏性似乎是LLMs通过训练学习到的一种性质,并提示JSAEs可能比标准SAEs更适合理解已学习的transformer计算。

英文摘要:

Sparse autoencoders (SAEs) have been successfully used to discover sparse and human-interpretable representations of the latent activations of LLMs. However, we would ultimately like to understand the computations performed by LLMs and not just their representations. The extent to which SAEs can help us understand computations is unclear because they are not designed to "sparsify" computations in any sense, only latent activations. To solve this, we propose Jacobian SAEs (JSAEs), which yield not only sparsity in the input and output activations of a given model component but also sparsity in the computation (formally, the Jacobian) connecting them. With a naïve implementation, the Jacobians in LLMs would be computationally intractable due to their size. One key technical contribution is thus finding an efficient way of computing Jacobians in this setup. We find that JSAEs extract a relatively large degree of computational sparsity while preserving downstream LLM performance approximately as well as traditional SAEs. We also show that Jacobians are a reasonable proxy for computational sparsity because MLPs are approximately linear when rewritten in the JSAE basis. Lastly, we show that JSAEs achieve a greater degree of computational sparsity on pre-trained LLMs than on the equivalent randomized LLM. This shows that the sparsity of the computational graph appears to be a property that LLMs learn through training, and suggests that JSAEs might be more suitable for understanding learned transformer computations than standard SAEs.

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

↑