Abstract
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 impacts of these unintended features toward 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 framework can significantly improve the classifier's generalizability by regularizing those features that are not semantically correlated to each task. This work pioneers controllable text classification on LLM latent spaces by leveraging interpreted features to address generalizability, fairness, and privacy challenges. We will release our code and data once accepted.
Abstract (translated)
现代文本分类方法高度依赖于大型语言模型(LLM)生成的上下文嵌入。与人工设计的特征相比,这些嵌入能自动且有效地为分类模型训练提供表示方式。然而,这也带来了一个挑战:我们失去了手动移除敏感或任务无关特征的能力,以确保符合监管要求或提升分类模型的一般适用性。这种限制出现的原因是LLM嵌入具有不透明性和难以解释的特点。在本文中,我们提出了一种新颖的框架,用于识别和规范化LLM潜在空间中的非意图特征。具体来说,我们首先预训练了一个稀疏自动编码器(SAE),以从LLM潜在空间中提取可解释的特征。为了确保SAE能够捕捉到特定任务的相关特征,我们在特定任务的数据集上进一步微调了它。在训练分类模型时,我们提出了一种简单且有效的正则化方法:通过最小化分类器权重与识别出的非意图特征之间的相似性来移除这些非意图特征对分类的影响。我们在三个现实世界任务中评估了所提出的框架,包括有毒聊天检测、奖励建模和疾病诊断。结果表明,该框架能够显著提高分类器的一般适用性,通过规范化那些在语义上与每个特定任务无关的特征。这项工作开创了基于解释特征解决大型语言模型潜在空间中的可控制文本分类问题的方法,以应对一般适用性、公平性和隐私方面的挑战。一旦被接受,我们将发布我们的代码和数据集。
URL
https://arxiv.org/abs/2502.14133