arXiv:2501.19406cs.LG2025-01ICML被引 6

用低秩微调让语言模型适配稀疏自编码器,提升可解释性且不损失性能。

Low-Rank Adapting Models for Sparse Autoencoders

  • 用低秩适配(LoRA)微调语言模型,使其适应预训练的稀疏自编码器。
  • 插入自编码器后交叉熵损失下降30%至55%,推理速度提升3到20倍。
  • 可同时适配多个自编码器,保持模型通用能力,适合模型可解释性研究。

稀疏自编码器(SAEs)将语言模型表示分解为一组稀疏的线性潜在向量。近期工作通过语言模型梯度改进SAEs,但需大量昂贵的反向传播,且插入重建结果时仍导致交叉熵损失显著增加。本文提出根本性新方法:使用低秩适配(LoRA)对语言模型本身进行微调,以适配预先训练的SAE。我们在Gemma Scope系列SAE上分析了不同稀疏度、宽度、模型规模、LoRA秩及模型层的影响。结果表明,前向传播中插入SAE时,交叉熵损失差距降低30%至55%。相比端到端(e2e)SAE,该方法在Gemma上实现相同下游交叉熵损失快3至20倍,在LLaMA上快2至10倍。此外,该方法提升下游指标,支持同时适配多个SAE而不损害语言模型通用能力。结果表明,提升模型可解释性不仅限于事后SAE训练;直接优化模型本身也可实现帕累托改进。

原文摘要 · Abstract (English)

Sparse autoencoders (SAEs) decompose language model representations into a sparse set of linear latent vectors. Recent works have improved SAEs using language model gradients, but these techniques require many expensive backward passes during training and still cause a significant increase in cross entropy loss when SAE reconstructions are inserted into the model. In this work, we improve on these limitations by taking a fundamentally different approach: we use low-rank adaptation (LoRA) to finetune the \textit{language model itself} around a previously trained SAE. We analyze our method across SAE sparsity, SAE width, language model size, LoRA rank, and model layer on the Gemma Scope family of SAEs. In these settings, our method reduces the cross entropy loss gap by 30\% to 55\% when SAEs are inserted during the forward pass. We also find that compared to end-to-end (e2e) SAEs, our approach achieves the same downstream cross entropy loss 3$\times$ to 20$\times$ faster on \gemma and 2$\times$ to 10$\times$ faster on \llama. We further show that our technique improves downstream metrics and can adapt multiple SAEs at once without harming general language model capabilities. Our results demonstrate that improving model interpretability is not limited to post-hoc SAE training; Pareto improvements can also be achieved by directly optimizing the model itself.

稀疏自编码器模型可解释性低秩适配语言模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。