从令牌列表到图动机:对稀疏自编码器特征的Weisfeiler-Lehman分析
From Token Lists to Graph Motifs: Weisfeiler-Lehman Analysis of Sparse Autoencoder Features
AI总结:
本文提出一种基于图结构的稀疏自编码器特征表示方法,通过Weisfeiler-Lehman风格的图核分析,揭示特征间的高阶共现结构,发现语言模式和代码模板等动机家族,补充了传统方法的不足。
摘要:
稀疏自编码器(SAEs)已成为机制可解释性中的核心,将Transformer激活分解为单义特征。然而,现有分析几乎仅通过顶部激活令牌列表或解码器权重向量来表征特征,忽略了特征间共享的高阶共现结构。本文引入了一种图结构表示,将每个SAE特征建模为令牌共现图:节点是强激活附近最频繁的令牌,边连接在局部上下文窗口内共现的令牌对。自定义的WL风格、频率分箱图核为这一结构空间提供了相似性度量。应用于一个在GPT-2 Small上训练的大型SAE,其特征通过合成混合领域语料进行探测,聚类恢复了无法通过解码器余弦相似度聚类得到的启发式动机家族(标点密集模式、语言和脚本集群以及代码样模板)。令牌直方图基线在整体纯度上更高,因此图视角的贡献是补充而非主导:它揭示了仅靠令牌频率和解码器权重视角无法捕捉的结构关系。聚类分配在图构建超参数和随机种子下保持稳定。
英文摘要:
Sparse autoencoders (SAEs) have become central to mechanistic interpretability, decomposing transformer activations into monosemantic features. Yet existing analyses characterise features almost exclusively through top-activating token lists or decoder weight vectors, leaving the higher-order co-occurrence structure shared across features largely unexamined. We introduce a graph-structured representation in which each SAE feature is modelled as a token co-occurrence graph: nodes are the tokens most frequent near strong activations, and edges connect pairs that co-occur within local context windows. A custom WL-style, frequency-binned graph kernel then provides a similarity measure over this structural space. Applied as a proof of concept to features from a large SAE trained on GPT-2 Small and probed with a synthetic mixed-domain corpus, our clustering recovers heuristic motif families (punctuation-heavy patterns, language and script clusters, and code-like templates) that are not recovered by clustering on decoder cosine similarity. A token-histogram baseline achieves higher overall purity, so the contribution of the graph view is complementary rather than dominant: it surfaces structural relationships that token-frequency and decoder-weight views alone do not capture. Cluster assignments are stable across graph-construction hyperparameters and random seeds.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。