Skip to main content
QUICK REVIEW

[论文解读] How Contextual are Contextualized Word Representations? Comparing the Geometry of BERT, ELMo, and GPT-2 Embeddings

Kawin Ethayarajh|arXiv (Cornell University)|Sep 1, 2019
Topic Modeling被引用 8
一句话总结

本文通过分析其隐藏状态的几何结构,研究了 BERT、ELMo 和 GPT-2 中词表示的上下文敏感性。研究发现,尽管表示具有高度各向异性,且高层更具有上下文特异性,但静态词嵌入最多只能解释不到 5% 的上下文表示方差——即使在考虑各向异性之后也是如此,表明上下文表示无法简化为有限数量的词义向量。

ABSTRACT

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.

研究动机与目标

  • 确定 BERT、ELMo 和 GPT-2 等上下文词模型的表示在多大程度上真正具有上下文特异性。
  • 探究上下文表示是否对应于有限数量的词义嵌入,还是无限多个上下文特异性向量。
  • 比较不同层和模型之间的几何特性——尤其是各向异性和相似性结构。
  • 评估从上下文表示的第一主成分导出的静态嵌入的有效性。
  • 理解上下文特异性在 ELMo、BERT 和 GPT-2 之间的变化方式,及其对下游性能的影响。

提出的方法

  • 通过计算同一词语在不同上下文中的上下文表示之间的余弦相似度,来衡量上下文特异性。
  • 通过测量词向量在向量空间中是否集中于一个狭窄圆锥内,来分析表示空间的各向异性。
  • 使用主成分分析(PCA)提取每个词语在各层上下文表示中的第一主成分。
  • 通过测量第一主成分解释的上下文表示方差比例(MEV),评估其是否可被简化为静态嵌入。
  • 对相似度分数进行各向异性调整,以将真正的上下文特异性与表示空间中的方向偏差分离开来。
  • 在标准词向量基准测试(如 SimLex、MEN、WordSim、Google 类比)上评估由 PCA 导出的静态嵌入。

实验结果

研究问题

  • RQ1BERT、ELMo 和 GPT-2 中的上下文词表示在多大程度上真正具有上下文特异性,而非分配有限数量的词义向量?
  • RQ2表示空间的各向异性在多大程度上影响上下文嵌入的解释性和性能?
  • RQ3上下文特异性在各层和各模型之间(尤其是 ELMo、BERT 和 GPT-2 之间)如何变化?
  • RQ4能否从上下文表示的第一主成分导出的静态词嵌入,优于传统的静态嵌入(如 GloVe 和 FastText)?
  • RQ5在考虑各向异性后,单个静态向量能解释多少比例的上下文表示方差?

主要发现

  • 在 ELMo、BERT 和 GPT-2 的所有层中,上下文词表示均表现出各向异性,向量集中于一个狭窄的圆锥内;GPT-2 的最后一层各向异性极强,以至于随机词对的余弦相似度接近完美。
  • 同一词语在不同上下文中的表示并非完全相同,且其余弦相似度在高层逐渐降低,表明上下文特异性增强。
  • 在对各向异性进行调整后,平均而言,所有层和模型中,一个词语的上下文表示方差中可由其第一主成分解释的部分不足 5%。
  • 尽管高层表现出高度的上下文特异性,但低层表示(尤其是 BERT 的第一层)的第一主成分在词向量基准测试中仍优于 GloVe 和 FastText。
  • 上下文特异性表现形式不同:ELMo 在高层中表现出同一句子内词语相似度增加,BERT 表现出中等程度的不相似度增加,而 GPT-2 则未表现出此类增加——同一句子中的词语并不比随机词对更相似。
  • GPT-2 表示的第一主成分表现明显劣于 ELMo 和 BERT,表明高度上下文特异的表示会产生效果较差的静态近似。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。