arXiv:2502.14133cs.CL2025-02KDD被引 2

用稀疏自编码器识别并清除大模型隐空间中的无关特征,提升分类模型泛化性。

Self-Regularization with Sparse Autoencoders for Controllable LLM-based Classification

  • 通过预训练+微调稀疏自编码器,从大模型隐空间提取可解释特征。
  • 在三类真实任务中,模型泛化能力显著提升,尤其在敏感信息去除上表现突出。
  • 适合关注模型公平性、隐私保护与可控性的研究者和工程师使用。

当前文本分类高度依赖大语言模型(LLM)的上下文嵌入,这类表示虽自动高效,但缺乏可解释性,难以手动剔除敏感或无关特征,影响模型合规性与泛化能力。本文提出一种新框架,在LLM隐空间中识别并正则化非语义相关特征。首先预训练稀疏自编码器(SAE)以提取可解释特征,并在具体任务数据集上微调以捕捉任务特异性特征。训练分类器时,通过最小化分类器权重与这些无关特征间的相似度,实现对干扰特征的抑制。在有毒聊天检测、奖励建模和疾病诊断三个真实任务上的实验表明,该方法能有效提升分类器的泛化性能。本工作首次在LLM隐空间实现可控文本分类,为解决泛化性、公平性与隐私问题提供新路径。代码与数据已公开于 https://github.com/JacksonWuxs/Controllable_LLM_Classifier。

原文摘要 · Abstract (English)

Modern text classification methods heavily rely on contextual embeddings from large language models (LLMs). Compared to human-engineered features, these embeddings provide automatic and effective representations for classification model training. However, they also introduce a challenge: we lose the ability to manually remove unintended features, such as sensitive or task-irrelevant features, to guarantee regulatory compliance or improve the generalizability of classification models. This limitation arises because LLM embeddings are opaque and difficult to interpret. In this paper, we propose a novel framework to identify and regularize unintended features in the LLM latent space. Specifically, we first pre-train a sparse autoencoder (SAE) to extract interpretable features from LLM latent spaces. To ensure the SAE can capture task-specific features, we further fine-tune it on task-specific datasets. In training the classification model, we propose a simple and effective regularizer, by minimizing the similarity between the classifier weights and the identified unintended feature, to remove the impact of these unintended features on classification. We evaluate the proposed framework on three real-world tasks, including toxic chat detection, reward modeling, and disease diagnosis. Results show that the proposed self-regularization framework can improve the classifier's generalizability by regularizing those features that are not semantically correlated to the task. This work pioneers controllable text classification on LLM latent spaces by leveraging interpreted features to address generalizability, fairness, and privacy challenges. The code and data are publicly available at https://github.com/JacksonWuxs/Controllable_LLM_Classifier.

可控分类稀疏自编码器大模型可解释性隐私保护

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