通过滤除高频词干扰,让大模型文本嵌入更精准。
Your UnEmbedding Matrix is Secretly a Feature Lens for Text Embeddings

- 用线性变换过滤语言模型中的高频词干扰
- 在多个基准上提升零样本性能,且嵌入维度大幅降低
- 适合想优化文本嵌入质量的研究者和工程师
大型语言模型在众多下游任务中表现出色,但在作为即插即用的嵌入模型时表现不佳,导致大规模文本嵌入基准上的性能不理想。本文发现其根本原因:当文本嵌入投影到词汇空间时,会过度对齐高频但信息量低的词。这些高频词的过度表达抑制了模型捕捉细微语义的能力。为此,我们提出EmbedFilter,一种直接作用于大模型嵌入的简单线性变换。我们发现,模型中的反嵌入矩阵(unembedding matrix)编码了一个隐含空间,主动将高频词写入嵌入空间。通过滤除该子空间,EmbedFilter有效抑制高频词影响,增强语义表示。作为附带收益,该方法实现内在降维,显著降低索引存储和检索开销,同时保持高质量嵌入。实验表明,使用EmbedFilter的模型在多个大模型主干上均取得更优零样本性能,且嵌入维度可大幅压缩。代码已开源。
原文摘要 · Abstract (English)
Large language models exhibit impressive zero-shot capabilities across a wide range of downstream tasks. However, they struggle to function as off-the-shelf embedding models, leading to suboptimal performance on massive text embedding benchmarks. In this paper, we identify a potential cause underlying this deficiency. Our motivation stems from an unexpected observation: text embeddings tend to align with frequent but uninformative tokens when projected onto the vocabulary space. We argue that this excessive expression of high-frequency tokens suppresses the model's ability to capture nuanced semantics. To address this, we introduce EmbedFilter, a simple linear transformation designed to refine text embeddings derived from LLMs directly. Specifically, we uncover that the unembedding matrix within LLMs encodes a latent space that is actively writing these frequent tokens into embedding space. By filtering out this subspace, EmbedFilter suppress the influence of high-frequency tokens, thereby enhancing semantic representations. As a compelling byproduct, this enables an inherent dimensionality reduction, lowering index storage and speedup retrieval while fully preserving the refined embedding quality. Our experiments across multiple LLM backbones demonstrate that LLMs equipped with EmbedFilter achieve superior zero-shot downstream performance even with significantly reduced embedding dimensions. We hope our findings provide deeper insights into the mechanisms of LLM-based representations and inspire more principled designs to improve text embeddings training. Our code is available at https://github.com/CentreChen/EmbFilter.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。