fmxcoders: 分层掩码交叉编解码器用于跨层特征发现
fmxcoders: Factorized Masked Crosscoders for Cross-Layer Feature Discovery
AI总结:
本文提出fmxcoders,通过低秩张量分解和随机层掩码技术,解决传统交叉编解码器在跨层特征恢复中的不足,提升模型的语义相干性与重构性能。
摘要:
许多预训练Transformer中的特征跨越多层:它们通过推理阶段出现,残留在残差流中,或由并行MLP共同构建。交叉编解码器(即跨层联合训练的稀疏字典)旨在在共享潜在空间中恢复这些跨层特征。我们证明标准交叉编解码器在这一目的上表现不佳。尽管其解码器权重范数在各层均匀分布,但引入的功能相干度量揭示每个潜在激活主要由一到两层驱动。功能相干的潜在激活可作为人类可解释的概念检测器(如美国州和城市),而交叉编解码器主要学习的层局部化潜在激活则塌缩为表面模式如数字检测器。我们将其失败归因于两个结构限制:无约束的跨层参数化和未正则化的跨层依赖。我们通过引入fmxcoders解决这两个问题:(i) 用低秩张量分解替代编码器和解码器,使每个潜在的每层权重从共享的跨层基中获取;(ii) 应用随机层掩码,一种沿层轴的去噪正则化器,惩罚当单个层被掩码时潜在激活塌缩的潜在。在GPT2-Small、Pythia-410M、Pythia-1.4B和Gemma2-2B上,fmxcoders将平均探测F1提升10-30个点,超越标准交叉编解码器无法达到的每层SAE基线,将重构MSE降低25-50%,并大致将平均功能相干性翻倍。一个LLM-as-a-judge评估进一步显示,fmxcoders在所有四个基础LLM上恢复的语义相干潜在激活比标准交叉编解码器多3-13倍。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。