arXiv:2507.18171cs.CLcs.AI2025-07ACL被引 3

发现文本嵌入模型中的‘粘性词元’会扭曲相似度,影响下游任务性能。

Sticking to the Mean: Detecting Sticky Tokens in Text Embedding Models

  • 提出高效检测方法STD,通过句子与词元过滤识别异常词元
  • 在40个模型中发现868个粘性词元,导致检索性能下降最高50%
  • 揭示词元粘性源于词汇表特殊项或碎片化子词,与模型大小无关

尽管基于Transformer的文本嵌入模型广泛应用于NLP任务,但令人意外的‘粘性词元’会损害嵌入的可靠性。这些词元反复插入句子时,使句子相似度趋向特定值,破坏嵌入距离的正常分布并降低下游性能。本文系统研究此类异常词元,正式定义其特性,并提出基于句子和词元过滤的高效检测方法Sticky Token Detector (STD)。对14个模型族共40个检查点应用STD,共发现868个粘性词元。分析表明,这些词元常源自词汇表中的特殊或未使用条目,以及多语言语料中的碎片化子词。值得注意的是,其存在与模型大小或词汇表大小无严格相关性。进一步评估显示,粘性词元在聚类和检索等下游任务中导致最高达50%的性能下降。通过注意力层分析,发现粘性词元显著主导模型内部表示,引发对分词鲁棒性的担忧。研究呼吁未来文本嵌入应用需改进分词策略与模型设计以缓解粘性词元影响。

原文摘要 · Abstract (English)

Despite the widespread use of Transformer-based text embedding models in NLP tasks, surprising 'sticky tokens' can undermine the reliability of embeddings. These tokens, when repeatedly inserted into sentences, pull sentence similarity toward a certain value, disrupting the normal distribution of embedding distances and degrading downstream performance. In this paper, we systematically investigate such anomalous tokens, formally defining them and introducing an efficient detection method, Sticky Token Detector (STD), based on sentence and token filtering. Applying STD to 40 checkpoints across 14 model families, we discover a total of 868 sticky tokens. Our analysis reveals that these tokens often originate from special or unused entries in the vocabulary, as well as fragmented subwords from multilingual corpora. Notably, their presence does not strictly correlate with model size or vocabulary size. We further evaluate how sticky tokens affect downstream tasks like clustering and retrieval, observing significant performance drops of up to 50%. Through attention-layer analysis, we show that sticky tokens disproportionately dominate the model's internal representations, raising concerns about tokenization robustness. Our findings show the need for better tokenization strategies and model design to mitigate the impact of sticky tokens in future text embedding applications.

文本嵌入词元检测模型鲁棒性

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