提出fmxcoders,让大模型跨层特征更连贯、更可解释。
fmxcoders: Factorized Masked Crosscoders for Cross-Layer Feature Discovery

- 用低秩分解和随机层掩码,强制跨层特征共享统一基底。
- 在4个模型上提升探测准确率10-30点,重构误差降25%-50%。
- 适合研究模型内部表征、做可解释性分析的学者使用。
预训练Transformer中的许多特征跨越多个层:它们在推理过程中逐步出现,存在于残差流中,或由并行MLP共同构建。跨编码器(crosscoders)旨在通过单一共享隐空间恢复这些跨层特征。我们发现标准跨编码器在此任务上表现不佳。尽管其解码器权重范数在各层间均匀分布,但引入的功能一致性度量显示,每个隐变量的激活平均仅由一两层驱动。功能一致的隐变量可作为人类可读的概念探测器(如美国州和城市),而跨编码器主要学习到的层局部隐变量则退化为表面模式(如数字检测器)。我们归因于两个结构缺陷:无约束的跨层参数化与无正则化的跨层依赖。为此提出fmxcoders,(i) 用低秩张量分解替换编码器与解码器,使每个隐变量的每层权重来自共享的跨层基底;(ii) 引入随机层掩码,沿层轴施加去噪正则项,惩罚当单层被掩码时贡献崩溃的隐变量。在GPT2-Small、Pythia-410M、Pythia-1.4B和Gemma2-2B上,fmxcoders将平均探测F1提升10-30点,超越标准跨编码器无法达到的逐层SAE基线,重建均方误差降低25%-50%,功能一致性大致翻倍。大模型评判评估进一步显示,fmxcoders在所有四个基础模型上恢复的语义连贯隐变量多出3-13倍。
原文摘要 · Abstract (English)
Many features in pretrained Transformers span multiple layers: they emerge through stages of inference, persist in the residual stream, or are built jointly by parallel MLPs. Crosscoders (namely, sparse dictionaries trained jointly across layers) aim to recover these cross-layer features in a single shared latent space. We show that standard crosscoders largely fail at this purpose. Although their decoder weight norms spread evenly across layers, a functional coherence metric we introduce reveals that each latent's activation is effectively driven by only one or two layers on average. While functionally coherent latents act as human-interpretable concept detectors (e.g., US states and cities), the layer-localized latents that crosscoders predominantly learn collapse onto surface-level patterns such as digit detectors. We trace this failure to two structural limitations: unconstrained cross-layer parameterization and unregularized cross-layer dependence. We address both by introducing fmxcoders, which (i) replace the encoder and decoder with low-rank tensor factorizations that draw every latent's per-layer weights from a shared cross-layer basis, and (ii) apply stochastic layer masking, a denoising regularizer along the layer axis that penalizes latents whose contribution collapses when a single layer is masked. Across GPT2-Small, Pythia-410M, Pythia-1.4B, and Gemma2-2B, fmxcoders lift mean probing F1 by 10-30 points, surpassing per-layer SAE baselines that standard crosscoders fail to reach, reduce reconstruction MSE by 25-50%, and roughly double mean functional coherence. An LLM-as-a-judge evaluation further shows that fmxcoders recover 3-13$\times$ more semantically coherent latents than standard crosscoders across all four base LLMs.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。