发现句子嵌入空间的几何关系无法预测任务表现
Testing the assumptions about the geometry of sentence embedding spaces: the cosine measure need not apply
- 比较三种句子嵌入方法,检验其几何距离与任务性能的关系
- 余弦相似度仅反映浅层差异,无法预测实际任务表现
- 语言信息依赖加权维度组合,非空间距离可体现
Transformer 模型在编码文本时生成上下文词嵌入,通常假设语义相近的词在嵌入空间中距离较近。实践中常反推:空间距离近的词意义相关,远则无关。但这一假设是否适用于句子嵌入?我们研究了三种句子嵌入方式:词嵌入平均值、[CLS] token 嵌入、随机词嵌入,并检验其嵌入距离与多种语言任务表现的相关性。结果表明,余弦相似度虽能捕捉浅层共性,但无法预测具体任务的表现差异。语言信息实际由不同维度的加权组合编码,这些深层结构无法通过嵌入空间的几何形态体现。
原文摘要 · Abstract (English)
Transformer models learn to encode and decode an input text, and produce contextual token embeddings as a side-effect. The mapping from language into the embedding space maps words expressing similar concepts onto points that are close in the space. In practice, the reverse implication is also assumed: words corresponding to close points in this space are similar or related, those that are further are not. Does closeness in the embedding space extend to shared properties for sentence embeddings? We present an investigation of sentence embeddings and show that the geometry of their embedding space is not predictive of their relative performances on a variety of tasks. We compute sentence embeddings in three ways: as averaged token embeddings, as the embedding of the special [CLS] token, and as the embedding of a random token from the sentence. We explore whether there is a correlation between the distance between sentence embedding variations and their performance on linguistic tasks, and whether despite their distances, they do encode the same information in the same manner. The results show that the cosine similarity -- which treats dimensions shallowly -- captures (shallow) commonalities or differences between sentence embeddings, which are not predictive of their performance on specific tasks. Linguistic information is rather encoded in weighted combinations of different dimensions, which are not reflected in the geometry of the sentence embedding space.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。