arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.14133cs.CL
收藏

利用稀疏自编码器进行自正则化以实现可控的基于 LLM 的分类

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

University of Georgia(佐治亚大学);Tencent AI Lab(腾讯AI实验室)

Xuansheng Wu, Wenhao Yu, Xiaoming Zhai, Ninghao Liu

AI总结:

提出基于稀疏自编码器的自正则化框架,识别并抑制 LLM 潜在空间中的非预期特征,从而提升文本分类的泛化性、公平性与隐私可控性。

摘要:

现代文本分类方法严重依赖大型语言模型(LLM)生成的上下文嵌入。与人工设计的特征相比,这些嵌入为分类模型训练提供了自动化且有效的表示。然而,它们也带来了一个挑战:我们失去了手动移除非预期特征(例如敏感特征或与任务无关的特征)的能力,而这些特征本可用于确保监管合规或提升分类模型的泛化能力。这一局限源于 LLM 嵌入不透明且难以解释。本文提出了一种新颖框架,用于识别并正则化 LLM 潜在空间中的非预期特征。具体而言,我们首先预训练一个稀疏自编码器(SAE),以从 LLM 潜在空间中提取可解释特征。为确保 SAE 能够捕获任务特定特征,我们进一步在任务特定数据集上对其进行微调。在训练分类模型时,我们提出了一种简单而有效的正则化器:通过最小化分类器权重与已识别的非预期特征之间的相似度,消除这些非预期特征对分类的影响。我们在三个真实任务上评估了所提出框架,包括有害聊天检测、奖励建模和疾病诊断。结果表明,所提出的自正则化框架能够通过正则化那些在语义上与任务不相关的特征,提升分类器的泛化能力。本工作通过利用经解释的特征来应对泛化性、公平性和隐私挑战,开创了 LLM 潜在空间上的可控文本分类。代码和数据公开发布于 https://github.com/JacksonWuxs/Controllable_LLM_Classifier。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑