标签向量的余弦相似度无法反映模型预测概率,需结合分类器理解。
What Cosine Similarity of Label Representations Can and Cannot Tell us
- 证明标签向量余弦相似度与模型概率无关,可人为构造极端值
- 软最大分类器下,相似度无法预示预测排名顺序
- 适合研究模型解释性、向量空间语义的读者参考
余弦相似度常被用来衡量神经网络表示向量的相似性,但其在标签表示上的应用并不保证能反映模型的概率输出。本文证明:对于软最大分类器(无论是图像分类还是自回归语言模型),标签表示间的余弦相似度无法提供任何关于模型分配概率的信息。具体而言,给定两个标签向量,总能构建另一个模型,对所有输入赋予相同概率,但标签向量间余弦相似度却可为1或-1。对于多标签的Sigmoid分类器,标签向量间的所有两两余弦相似度可确定可能的标签组合;而对于软最大分类器(每个输入有标签排序),必须知道所有标签向量差值之间的余弦相似度才能判断模型可能预测的排序。结论是,脱离分类器单独解读标签向量余弦相似度具有误导性。
原文摘要 · Abstract (English)
Cosine similarity is often used to measure the similarity of vector representations of neural network models. However, the cosine similarity of representations is not guaranteed to tell us anything about model probabilities. In this paper we show that for a softmax classifier, be it an image classifier or an autoregressive language model, the cosine similarity between label representations (called unembeddings in the paper) does not give any information on the probabilities assigned by the model. Specifically, we prove that given two unembeddings, it is possible to create another model which assigns the same probabilities for all inputs, but where the cosine similarity between the representations is now either 1 or -1. We also show that for a sigmoid classifier (where each input can be assigned multiple labels), all pairwise cosine similarities between the unembeddings define the set of possible label combinations. However, for softmax classifiers (where each input is assigned a ranking of the labels from most to least likely), we need all pairwise cosine similarities between all differences of unembeddings to know which rankings the model can predict. We conclude that it is misleading to interpret the cosine similarity between unembeddings without reference to the classifier that produced them.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。