BERTの異方性
Replacing static word embeddings with contextualized word representations has yielded significant improvements on many NLP tasks. However, just how contextual are the contextualized representations produced by models such as ELMo and BERT? Are there infinitely many context-specific representations for each word, or are words essentially assigned one of a finite number of word-sense representations? For one, we find that the contextualized representations of all words are not isotropic in any layer of the contextualizing model. While representations of the same word in different contexts still have a greater cosine similarity than those of two different words, this self-similarity is much lower in upper layers. This suggests that upper layers of contextualizing models produce more context-specific representations, much like how upper layers of LSTMs produce more task-specific representations. In all layers of ELMo, BERT, and GPT-2, on average, less than 5% of the variance in a word’s contextualized representations can be explained by a static embedding for that word, providing some justification for the success of contextualized representations.
Ethayarajh, Kawin. How contextual are contextualized word representations? comparing the geometry of BERT, ELMo, and GPT-2 embeddings. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), 2019, pages 55–65.
(DeepL)静的な単語埋め込みを文脈化された単語表現に置き換えることで、多くの自然言語処理タスクで大幅な改善が見られた。しかし、ELMoやBERTのようなモデルによって生成される文脈化された表現は、どの程度文脈的なのだろうか?各単語には無限に多くの文脈固有表現があるのだろうか、それとも単語には基本的に有限個の語義表現のいずれかが割り当てられているのだろうか。ひとつは、すべての単語の文脈固有表現は、文脈固有化モデルのどのレイヤーにおいても等方的ではないことである。異なる文脈における同じ単語の表現は、2つの異なる単語の表現よりも大きな余弦類似性を持つが、この自己類似性は上層ではずっと低い。これは、LSTMの上位層がよりタスクに特化した表現を生成するのと同じように、文脈付与モデルの上位層がより文脈に特化した表現を生成することを示唆している。ELMo、BERT、GPT-2のすべての層で、平均して、ある単語の文脈化表現の分散のうち、その単語の静的埋め込みで説明できるものは5%未満であり、文脈化表現の成功にある程度の正当性を与えている。