用稀疏自编码器提取可解释特征,提升大模型分类与跨任务迁移能力。
Sparse Autoencoder Features for Classifications and Transferability
- 通过调整层、宽度和池化策略优化稀疏自编码器结构。
- 特征宏F1超0.8,优于隐藏状态与词袋基线,支持零样本跨语言毒性检测。
- 二值化激活可替代传统特征筛选,提升效率且不降性能,适合安全关键场景。
稀疏自编码器(SAEs)为大型语言模型(LLMs)中结构化、人类可理解表征的发现提供了潜力,是构建透明可控AI系统的关键工具。本文系统分析了SAE在安全关键分类任务中从LLMs中提取可解释特征的性能。框架评估了(1)模型层选择与缩放特性,(2)SAE架构配置,包括宽度与池化策略,以及(3)连续激活二值化的影响。基于SAE的特征在分类任务中实现宏F1 > 0.8,优于隐藏状态与词袋(BoW)基线,并展现出从Gemma 2 2B到9B-IT模型的跨模型迁移能力。这些特征在零样本条件下泛化至跨语言毒性检测与视觉分类任务。分析表明,池化策略与二值化阈值影响显著,二值化提供了一种高效替代传统特征选择的方法,同时保持或提升性能。研究确立了SAE可解释性的新实践标准,推动大模型在真实场景中的可扩展透明部署。完整代码:https://github.com/shan23chen/MOSAIC。
原文摘要 · Abstract (English)
Sparse Autoencoders (SAEs) provide potentials for uncovering structured, human-interpretable representations in Large Language Models (LLMs), making them a crucial tool for transparent and controllable AI systems. We systematically analyze SAE for interpretable feature extraction from LLMs in safety-critical classification tasks. Our framework evaluates (1) model-layer selection and scaling properties, (2) SAE architectural configurations, including width and pooling strategies, and (3) the effect of binarizing continuous SAE activations. SAE-derived features achieve macro F1 > 0.8, outperforming hidden-state and BoW baselines while demonstrating cross-model transfer from Gemma 2 2B to 9B-IT models. These features generalize in a zero-shot manner to cross-lingual toxicity detection and visual classification tasks. Our analysis highlights the significant impact of pooling strategies and binarization thresholds, showing that binarization offers an efficient alternative to traditional feature selection while maintaining or improving performance. These findings establish new best practices for SAE-based interpretability and enable scalable, transparent deployment of LLMs in real-world applications. Full repo: https://github.com/shan23chen/MOSAIC.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。