arXiv:2410.24200cs.CLcs.AI2024-10ACL被引 17

长文本嵌入会因低通滤波效应而坍缩,导致相似度下降。

Length-Induced Embedding Collapse in PLM-based Models

  • 发现长文本嵌入因自注意力的低通滤波特性而聚集
  • 长文本嵌入相似度显著上升,导致性能下降
  • 提出TempScale方法缓解坍缩,提升长文本任务表现

基于PLM的文本嵌入广泛应用于各类任务,但其在长文本上的表现常出现退化。本文揭示了一种名为'长度坍缩'(Length Collapse)的现象:长文本嵌入趋向于聚类,造成长短文本嵌入分布不一致。通过理论分析自注意力机制作为低通滤波器的作用,我们证明随着文本长度增加,低通滤波强度增强,嵌入保留更多低频成分,使输入词元特征趋同,最终引发嵌入坍缩。为此,我们提出简单有效的TempScale方法,缩小长短文本间低通滤波率差距,实现更一致的嵌入表示。该方法在MTEB上提升0.94%,在专注于长上下文检索的LongEmbed上提升1.10%,验证了分析的有效性。

原文摘要 · Abstract (English)

Text embeddings from PLM-based models enable a wide range of applications, yet their performance often degrades on longer texts. In this paper, we introduce a phenomenon we call Length Collapse, where embeddings of longer texts tend to cluster together. This clustering results in a distributional inconsistency between the embeddings of short and long texts. We further investigate how these differences contribute to the performance decline observed with longer texts across various downstream tasks. Through a rigorous theoretical analysis of the self-attention mechanism, which acts as a low-pass filter in PLM-based models, we demonstrate that as text length increases, the strength of low-pass filtering intensifies, causing embeddings to retain more low-frequency components. As a result, input token features become more similar, leading to clustering and ultimately the collapse of embeddings for longer texts. To address this issue, we propose a simple method, TempScale, which mitigates the Length Collapse phenomenon. By narrowing the gap in low-pass filtering rates between long and short texts, TempScale ensures more consistent embeddings across different text lengths. This approach leads to performance improvements of 0.94% on MTEB and 1.10% on LongEmbed, which focuses specifically on long-context retrieval, providing strong evidence for the validity of our analysis. The source code is available at https://github.com/Yuqi-Zhou/Length_Collapse.

嵌入坍缩长文本自注意力PLM

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