改进稀疏自编码器,让每样本激活的特征数可变,提升重建效果。
BatchTopK Sparse Autoencoders
- 在批量层面放松顶K约束,允许每样本动态调整活跃特征数。
- 在GPT-2 Small和Gemma 2 2B上重建误差更低,平均稀疏度可控。
- 无需繁琐调参,可直接指定平均激活特征数,适合高效实验部署。
稀疏自编码器(SAEs)已成为解析语言模型激活的重要工具,通过将激活分解为稀疏且可解释的特征。主流方法是顶K SAE,即对每个样本固定使用最活跃的K个潜在变量进行重构。本文提出批量顶K SAE(BatchTopK SAE),通过将顶K约束放宽至批量层级,允许每样本根据需要动态选择不同数量的活跃潜变量。该方法在不牺牲平均稀疏度的前提下,显著提升了激活重构精度。实验表明,BatchTopK SAE在GPT-2 Small和Gemma 2 2B上的表现持续优于传统顶K SAE,且与当前最优的JumpReLU SAE性能相当。其优势在于可直接设定平均潜变量数量,避免了通过昂贵超参数搜索近似调节。代码已开源:https://github.com/bartbussmann/BatchTopK
原文摘要 · Abstract (English)
Sparse autoencoders (SAEs) have emerged as a powerful tool for interpreting language model activations by decomposing them into sparse, interpretable features. A popular approach is the TopK SAE, that uses a fixed number of the most active latents per sample to reconstruct the model activations. We introduce BatchTopK SAEs, a training method that improves upon TopK SAEs by relaxing the top-k constraint to the batch-level, allowing for a variable number of latents to be active per sample. As a result, BatchTopK adaptively allocates more or fewer latents depending on the sample, improving reconstruction without sacrificing average sparsity. We show that BatchTopK SAEs consistently outperform TopK SAEs in reconstructing activations from GPT-2 Small and Gemma 2 2B, and achieve comparable performance to state-of-the-art JumpReLU SAEs. However, an advantage of BatchTopK is that the average number of latents can be directly specified, rather than approximately tuned through a costly hyperparameter sweep. We provide code for training and evaluating BatchTopK SAEs at https://github.com/bartbussmann/BatchTopK
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。