揭示现代文本编码器为何能用平均池化仍保持效果
Why Mean Pooling Works: Quantifying Second-Order Collapse in Text Embeddings

- 提出量化二阶信息坍塌的指标,分析平均池化是否丢失语义结构
- 实测发现主流模型对信息坍塌有强鲁棒性,尤其对比学习微调后更优
- 模型鲁棒性源于词嵌入在文本内高度集中,且与下游性能正相关
在构建文本嵌入时,平均池化(即对词嵌入取均值)是标准做法。本文探讨该方法在真实模型中是否真正有效。首先指出,平均池化可能使信息坍塌超越一阶统计量,如捕获词嵌入空间结构的二阶统计量,从而将不同的嵌入分布映射为相似的文本嵌入。为此,我们提出一个简单度量来量化平均池化引发的信息坍塌。随后,利用该度量在真实模型和文本上进行实证测量,发现现代文本编码器对此类坍塌具有鲁棒性。特别是,经过对比学习微调的编码器比其预训练主干模型更不易发生坍塌。我们还发现,这种鲁棒性源于每个文本中词嵌入的高度集中。此外,我们发现该度量所衡量的鲁棒性与下游任务性能呈正相关。总体而言,本研究为现代文本编码器在依赖看似粗略的平均池化时仍有效的现象提供了新视角。
原文摘要 · Abstract (English)
For constructing text embeddings, mean pooling, which averages token embeddings, is the standard approach. This paper examines whether mean pooling actually works well in real models. First, we note that mean pooling can collapse information beyond the first-order statistics of the token embeddings, such as second-order statistics that capture their spatial structure, potentially mapping distinct token embedding distributions to similar text embeddings. Motivated by this concern, we propose a simple metric to quantify such a collapse induced by mean pooling. Then, using this metric, we empirically measure how often this collapse occurs in actual models and texts, and find that modern text encoders are robust to this collapse. In particular, contrastive fine-tuned text encoders tend to be less prone to the collapse than their pretrained backbone models. We also find that the robustness of these text encoders lies in the concentration of token embeddings within each text. In addition, we find that robustness to the collapse, as quantified by our proposed metric, correlates with downstream task performance. Overall, our findings offer a new perspective on why modern text encoders remain effective despite relying on seemingly coarse mean pooling.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。