Knowledge Enhanced Contextual Word Representations

Contextual word representations, typically trained on unstructured, unlabeled text, do not contain any explicit grounding to real world entities and are often unable to remember facts about those entities. We propose a general method to embed multiple knowledge bases (KBs) into large scale models, and thereby enhance their representations with structured, human-curated knowledge. For each KB, we first use an integrated entity linker to retrieve relevant entity embeddings, then update contextual word representations via a form of word-to-entity attention. In contrast to previous approaches, the entity linkers and self-supervised language modeling objective are jointly trained end-to-end in a multitask setting that combines a small amount of entity linking supervision with a large amount of raw text. After integrating WordNet and a subset of Wikipedia into BERT, the knowledge enhanced BERT (KnowBert) demonstrates improved perplexity, ability to recall facts as measured in a probing task and downstream performance on relationship extraction, entity typing, and word sense disambiguation. KnowBert’s runtime is comparable to BERT’s and it scales to large KBs.


Introduction
Large pretrained models such as ELMo (Peters et al., 2018), GPT (Radford et al., 2018), and BERT (Devlin et al., 2019) have significantly improved the state of the art for a wide range of NLP tasks.These models are trained on large amounts of raw text using self-supervised objectives.However, they do not contain any explicit grounding to real world entities and as a result have difficulty recovering factual knowledge (Logan et al., 2019).
Knowledge bases (KBs) provide a rich source of high quality, human-curated knowledge that can be used to ground these models.In addition, they often include complementary information to that found in raw text, and can encode factual knowledge that is difficult to learn from selectional preferences either due to infrequent mentions of commonsense knowledge or long range dependencies.
We present a general method to insert multiple KBs into a large pretrained model with a Knowledge Attention and Recontextualization (KAR) mechanism.The key idea is to explicitly model entity spans in the input text and use an entity linker to retrieve relevant entity embeddings from a KB to form knowledge enhanced entity-span representations.Then, the model recontextualizes the entity-span representations with word-toentity attention to allow long range interactions between contextual word representations and all entity spans in the context.The entire KAR is inserted between two layers in the middle of a pretrained model such as BERT.
In contrast to previous approaches that integrate external knowledge into task-specific models with task supervision (e.g., Yang and Mitchell, 2017;Chen et al., 2018), our approach learns the entity linkers with self-supervision on unlabeled data.This results in general purpose knowledge enhanced representations that can be applied to a wide range of downstream tasks.
Our approach has several other benefits.First, it leaves the top layers of the original model unchanged so we may retain the output loss layers and fine-tune on unlabeled corpora while training the KAR.This also allows us to simply swap out BERT for KnowBert in any downstream application.Second, by taking advantage of the existing high capacity layers in the original model, the KAR is lightweight, adding minimal additional parameters and runtime.Finally, it is easy to incorporate additional KBs by simply inserting them at other locations.
KnowBert is agnostic to the form of the arXiv:1909.04164v1[cs.CL] 9 Sep 2019 KB, subject to a small set of requirements (see Sec. 3.2).We experiment with integrating both WordNet (Miller, 1995) and Wikipedia, thus explicitly adding word sense knowledge and facts about named entities (including those unseen at training time).However, the method could be extended to commonsense KBs such as ConceptNet (Speer et al., 2017) or domain specific ones (e.g., UMLS; Bodenreider, 2004).
We evaluate KnowBert with a mix of intrinsic and extrinsic tasks.Despite being based on the smaller BERT BASE model, the experiments demonstrate improved masked language model perplexity and ability to recall facts over BERT LARGE .The extrinsic evaluations demonstrate improvements for challenging relationship extraction, entity typing and word sense disambiguation datasets, and often outperform other contemporaneous attempts to incorporate external knowledge into BERT.

Related Work
Pretrained word representations Initial work learning word vectors focused on static word embeddings using multi-task learning objectives (Collobert and Weston, 2008) or corpus level cooccurence statistics (Mikolov et al., 2013a;Pennington et al., 2014).Recently the field has shifted toward learning context-sensitive embeddings (Dai and Le, 2015;Peters et al., 2018;Devlin et al., 2019).We build upon these by incorporating structured knowledge into these models.
Entity embeddings Entity embedding methods produce continuous vector representations from external knowledge sources.Knowledge graphbased methods optimize the score of observed triples in a knowledge graph.These methods broadly fall into two categories: translational distance models (Bordes et al., 2013;Wang et al., 2014b;Lin et al., 2015;Xiao et al., 2016) which use a distance-based scoring function, and linear models (Nickel et al., 2011;Yang et al., 2014;Trouillon et al., 2016;Dettmers et al., 2018) which use a similarity-based scoring function.We experiment with TuckER (Balazevic et al., 2019) embeddings, a recent linear model which generalizes many of the aforecited models.Other methods combine entity metadata with the graph (Xie et al., 2016), use entity contexts (Chen et al., 2014;Ganea and Hofmann, 2017), or a combination of contexts and the KB (Wang et al., 2014a;Gupta et al., 2017).Our approach is agnostic to the details of the entity embedding method and as a result is able to use any of these methods.
Entity-aware language models Some previous work has focused on adding KBs to generative language models (LMs) (Ahn et al., 2017;Yang et al., 2017;Logan et al., 2019) or building entity-centric LMs (Ji et al., 2017).However, these methods introduce latent variables that require full annotation for training, or marginalization.In contrast, we adopt a method that allows training with large amounts of unannotated text.
Task-specific KB architectures Other work has focused on integrating KBs into neural architectures for specific downstream tasks (Yang and Mitchell, 2017;Sun et al., 2018;Chen et al., 2018;Bauer et al., 2018;Mihaylov and Frank, 2018;Wang and Jiang, 2019;Yang et al., 2019).Our approach instead uses KBs to learn more generally transferable representations that can be used to improve a variety of downstream tasks.

KnowBert
KnowBert incorporates knowledge bases into BERT using the Knowledge Attention and Recontextualization component (KAR).We start by describing the BERT and KB components.We then move to introducing KAR.Finally, we describe the training procedure, including the multitask training regime for jointly training KnowBert and an entity linker.

Pretrained BERT
We describe KnowBert as an extension to (and candidate replacement for) BERT, although the method is general and can be applied to any deep pretrained model including left-to-right and rightto-left LMs such as ELMo and GPT.Formally, BERT accepts as input a sequence of N Word-Piece tokens (Sennrich et al., 2016;Wu et al., 2016), (x 1 , . . ., x N ), and computes L layers of D-dimensional contextual representations H i ∈ R N ×D by successively applying non-linear functions H i = F i (H i−1 ).The non-linear function is a multi-headed self-attention layer followed by a position-wise multilayer perceptron (MLP) (Vaswani et al., 2017): The multi-headed self-attention uses H i−1 as the query, key, and value to allow each vector to attend to every other vector.
BERT is trained to minimize an objective function that combines both next-sentence prediction (NSP) and masked LM log-likelihood (MLM): Given two inputs x A and x B , the next-sentence prediction task is binary classification to predict whether x B is the next sentence following x A .The masked LM objective randomly replaces a percentage of input word pieces with a special [MASK] token and computes the negative loglikelihood of the missing token with a linear layer and softmax over all possible word pieces.

Knowledge Bases
The key contribution of this paper is a method to incorporate knowledge bases (KB) into a pretrained BERT model.To encompass as wide a selection of prior knowledge as possible, we adopt a broad definition for a KB in the most general sense as fixed collection of K entity nodes, e k , from which it is possible to compute entity embeddings, e k ∈ R E .This includes KBs with a typical (subj, rel, obj) graph structure, KBs that contain only entity metadata without a graph, and those that combine both a graph and entity metadata, as long as there is some method for embedding the entities in a low dimensional vector space.We also do not make any assumption that the entities are typed.As we show in Sec.4.1 this flexibility is beneficial, where we compute entity embeddings from WordNet using both the graph and synset definitions, but link directly to Wikipedia pages without a graph by using embeddings computed from the entity description.
We also assume that the KB is accompanied by an entity candidate selector that takes as input some text and returns a list of C potential entity links, each consisting of the start and end indices of the potential mention span and M m candidate entities in the KG: In practice, these are often implemented using precomputed dictionaries (e.g., CrossWikis; Spitkovsky and Chang, 2012), KB specific rules (e.g., a WordNet lemmatizer), or other heuristics (e.g., string match; Mihaylov and Frank, 2018).Ling et al. (2015) showed that incorporating candidate priors into entity linkers can be a powerful signal, so we optionally allow for the candidate selector to return an associated prior probability for each entity candidate.In some cases, it is beneficial to over-generate potential candidates and add a special NULL entity to each candidate list, thereby allowing the linker to discriminate between actual links and false positive candidates.In this work, the entity candidate selectors are fixed but their output is passed to a learned context dependent entity linker to disambiguate the candidate mentions.
Finally, by restricting the number of candidate entities to a fixed small number (we use 30), KnowBert's runtime is independent of the size the KB, as it only considers a small subset of all possible entities for any given text.As the candidate selection is rule-based and fixed, it is fast and in our implementation is performed asynchronously on CPU.The only overhead for scaling up the size of the KB is the memory footprint to store the entity embeddings.

KAR
The Knowledge Attention and Recontextualization component (KAR) is the heart of KnowBert.The KAR accepts as input the contextual representations at a particular layer, H i , and computes knowledge enhanced representations H i = KAR(H i , C).This is fed into the next pretrained layer, H i+1 = TransformerBlock(H i ), and the remainder of BERT is run as usual.
In this section, we describe the KAR's key components: mention-span representations, retrieval of relevant entity embeddings using an entity linker, update of mention-span embeddings with retrieved information, and recontextualization of entity-span embeddings with word-to-entity-span attention.We describe the KAR for a single KB, but extension to multiple KBs at different layers is straightforward.See Fig. 1 for an overview.

Mention-span representations
The KAR starts with the KB entity candidate selector that provides a list of candidate mentions which it uses to compute mention-span representations.H i is first pro- (1), then pooled over candidate mentions spans (2) to compute S, and contextualized into S e using mention-span self-attention ( 3).An integrated entity linker computes weighted average entity embeddings Ẽ (4), which are used to enhance the span representations with knowledge from the KB (5), computing S e .Finally, the BERT word piece representations are recontextualized with word-to-entity-span attention ( 6) and projected back to the BERT dimension (7) resulting in H i .
jected to the entity dimension (E, typically 200 or 300, see Sec. 4.1) with a linear projection, (1) Then, the KAR computes C mention-span representations s m ∈ R E , one for each candidate mention, by pooling over all word pieces in a mentionspan using the self-attentive span pooling from Lee et al. (2017).The mention-spans are stacked into a matrix S ∈ R C×E .

Entity linker
The entity linker is responsible for performing entity disambiguation for each potential mention from among the available candidates.
It first runs mention-span self-attention to compute The span self-attention is identical to the typical transformer layer, exception that the self-attention is between mention-span vectors instead of word piece vectors.This allows KnowBert to incorporate global information into each linking decision so that it can take advantage of entity-entity cooccurrence and resolve which of several overlapping candidate mentions should be linked. 1Following Kolitsas et al. (2018), S e is used to score each of the candidate entities while incorporating the candidate entity prior from the KB.Each candidate span m has an associated mention-span 1 We found a small transformer layer with four attention heads and a 1024 feed-forward hidden dimension was sufficient, significantly smaller than each of the layers in BERT.Early experiments demonstrated the effectiveness of this layer with improved entity linking performance.
vector s e m (computed via Eq. 2), M m candidate entities with embeddings e mk (from the KB), and prior probabilities p mk .We compute M m scores using the prior and dot product between the entityspan vectors and entity embeddings, with a two-layer MLP (100 hidden dimensions).
If entity linking (EL) supervision is available, we can compute a loss with the gold entity e mg .The exact form of the loss depends on the KB, and we use both log-likelihood, and max-margin, formulations (see Sec. 4.1 for details).
Knowledge enhanced entity-span representations KnowBert next injects the KB entity information into the mention-span representations computed from BERT vectors (s e m ) to form entityspan representations.For a given span m, we first disregard all candidate entities with score ψ below a fixed threshold, and softmax normalize the remaining scores: Then the weighted entity embedding is If all entity linking scores are below the threshold δ, we substitute a special NULL embedding for ẽm .Finally, the entity-span representations are updated with the weighted entity embeddings which are packed into a matrix S e ∈ R C×E .
Recontextualization After updating the entityspan representations with the weighted entity vectors, KnowBert uses them to recontextualize the word piece representations.This is accomplished using a modified transformer layer that substitutes the multi-headed self-attention with a multiheaded attention between the projected word piece representations and knowledge enhanced entityspan vectors.As introduced by Vaswani et al. ( 2017), the contextual embeddings H i are used for the query, key, and value in multi-headed selfattention.The word-to-entity-span attention in KnowBert substitutes for the query, and S e for both the key and value: This allows each word piece to attend to all entity-spans in the context, so that it can propagate entity information over long contexts.After the multi-headed word-to-entity-span attention, we run a position-wise MLP analogous to the standard transformer layer. 2inally, H proj i is projected back to the BERT dimension with a linear transformation and a residual connection added: Alignment of BERT and entity vectors As KnowBert does not place any restrictions on the entity embeddings, it is essential to align them with the pretrained BERT contextual representations.To encourage this alignment we initialize W proj 2 as the matrix inverse of W proj 1 (Eq.1).The use of dot product similarity (Eq. 3) and residual connection (Eq.7) further aligns the entity-span representations with entity embeddings.

Algorithm 1: KnowBert training method
Input: Pretrained BERT and J KBs Output: KnowBert for j = 1 . . .J do Compute entity embeddings for KB j if EL supervision available then Freeze all network parameters except those in (Eq.1-3) Train to convergence using (Eq.4) or (Eq.5) end Our training regime incrementally pretrains increasingly larger portions of KnowBert before fine-tuning all trainable parameters in a multitask setting with any available EL supervision.It is similar in spirit to the "chain-thaw" approach in Felbo et al. (2017), and is summarized in Alg. 1.
We assume access to a pretrained BERT model and one or more KBs with their entity candidate selectors.To add the first KB, we begin by pretraining entity embeddings (if not already provided from another source), then freeze them in all subsequent training, including task-specific finetuning.If EL supervision is available, it is used to pretrain the KB specific EL parameters, while freezing the remainder of the network.Finally, the entire network is fine-tuned to convergence by minimizing We apply gradient updates to homogeneous batches randomly sampled from either the unlabeled corpus or EL supervision.
To add a second KB, we repeat the process, inserting it in any layer above the first one.When adding a KB, the BERT layers above it will experience large gradients early in training, as they are subject to the randomly initialized parameters associated with the new KB.They are thus expected to move further from their pretrained values before convergence compared to parameters below the KB.minimize disruption of the network and decrease the likelihood that training will fail.See Sec.4.1 for details of where each KB was added.
The entity embeddings and selected candidates contain lexical information (especially in the case of WordNet), that will make the masked LM predictions significantly easier.To prevent leaking into the masked word pieces, we adopt the BERT strategy and replace all entity candidates from the selectors with a special [MASK] entity if the candidate mention span overlaps with a masked word piece. 3This prevents KnowBert from relying on the selected candidates to predict masked word pieces.

Experimental Setup
We used the English uncased BERT BASE model (Devlin et al., 2019) to train three versions of KnowBert: KnowBert-Wiki, KnowBert-WordNet, and KnowBert-W+W that includes both Wikipedia and WordNet.

KnowBert-Wiki
The entity linker in KnowBert-Wiki borrows both the entity candidate selectors and embeddings from Ganea and Hofmann (2017).The candidate selectors and priors are a combination of CrossWikis, a large, precomputed dictionary that combines statistics from Wikipedia and a web corpus (Spitkovsky and Chang, 2012), and the YAGO dictionary (Hoffart et al., 2011).The entity embeddings use a skipgram like objective (Mikolov et al., 2013b) to learn 300-dimensional embeddings of Wikipedia page titles directly from Wikipedia descriptions without using any explicit graph structure between nodes.As such, nodes in the KB are Wikipedia page titles, e.g., Prince (musician).Ganea and Hofmann (2017) provide pretrained embeddings for a subset of approximately 470K entities.Early experiments with embeddings derived from Wikidata relations4 did not improve results.
We used the AIDA-CoNLL dataset (Hoffart et al., 2011) for supervision, adopting the standard splits.This dataset exhaustively annotates entity links for named entities of person, organization and location types, as well as a miscellaneous type.It does not annotate links to common nouns or other Wikipedia pages.At both train and test time, we consider all selected candidate spans and the top 30 entities, to which we add the special NULL entity to allow KnowBert to discriminate between actual links and false positive links from the selector.As such, KnowBert models both entity mention detection and disambiguation in an end-to-end manner.Eq. 5 was used as the objective.
KnowBert-WordNet Our WordNet KB combines synset metadata, lemma metadata and the relational graph.To construct the graph, we first extracted all synsets, lemmas, and their relationships from WordNet 3.0 using the nltk interface.After disregarding certain symmetric relationships (e.g., we kept the hypernym relationship, but removed the inverse hyponym relationship) we were left with 28 synset-synset and lemma-lemma relationships.From these, we constructed a graph where each node is either a synset or lemma, and intro- duced the special lemma in synset relationship to link synsets and lemmas.The candidate selector uses a rule-based lemmatizer without partof-speech (POS) information. 5ur embeddings combine both the graph and synset glosses (definitions), as early experiments indicated improved perplexity when using both vs. just graph-based embeddings.
We used TuckER (Balazevic et al., 2019) to compute 200dimensional vectors for each synset and lemma using the relationship graph.Then, we extracted the gloss for each synset and used an off-theshelf state-of-the-art sentence embedding method (Subramanian et al., 2018) to produce 2048dimensional vectors.These are concatenated to the TuckER embeddings.To reduce the dimensionality for use in KnowBert, the frozen 2248dimensional embeddings are projected to 200dimensions with a learned linear transformation.
For supervision, we combined the SemCor word sense disambiguation (WSD) dataset (Miller et al., 1994) with all lemma example usages from WordNet6 and link directly to synsets.The loss function is Eq. 4. At train time, we did not provide gold lemmas or POS tags, so KnowBert must learn to implicitly model coarse grained POS tags to disambiguate each word.At test time when evaluating we restricted candidate entities to just those matching the gold lemma and POS tag, consistent with the standard WSD evaluation.
Training details To control for the unlabeled corpus, we concatenated Wikipedia and the Books Corpus (Zhu et al., 2015) and followed the data preparation process in BERT with the exception of heavily biasing our dataset to shorter sequences of 128 word pieces for efficiency.Both KnowBert-

System
AIDA-A AIDA-B Factual recall To test KnowBert's ability to recall facts from the KBs, we extracted 90K tuples from Wikidata (Vrandečić and Krötzsch, 2014) for 17 different relationships such as companyFoundedBy.Each tuple was written into natural language such as "Adidas was founded by Adolf Dassler" and used to construct two test instances, one that masks out the subject and one that masks the object.Then, we evaluated whether a model could recover the masked entity by computing the mean reciprocal rank (MRR) of the masked word pieces. of (frozen) parameters in the entity embeddings (Table 1).KnowBert is much faster than BERT LARGE .By taking advantage of the already high capacity model, the number of trainable parameters added by KnowBert is a fraction of the total parameters in BERT.The faster speed is partially due to the entity parameter efficiency in KnowBert as only as small fraction of parameters in the entity embeddings are used for any given input due to the sparse linker.Our candidate generators consider the top 30 candidates and produce approximately O(number tokens) candidate spans.For a typical 25 token sentence, approximately 2M entity embedding parameters are actually used.In contrast, BERT LARGE uses the majority of its 336M parameters for each input.
Integrated EL It is also possible to evaluate the performance of the integrated entity linkers inside KnowBert using diagnostic probes without any further fine-tuning.As these were trained in a multitask setting primarily with raw text, we do not a priori expect high performance as they must balance specializing for the entity linking task and learning general purpose representations suitable for language modeling.Table 2 displays fine-grained WSD F 1 using the evaluation framework from Navigli et al. (2017) and the ALL dataset (combing SemEval 2007, 2013, 2015 and Senseval 2 and 3).By linking to nodes in our WordNet graph and restricting to gold lemmas at test time we can recast the WSD task under our general entity linking framework.The ELMo and BERT baselines use a nearest neighbor approach trained on the SemCor dataset, similar to the evaluation in Melamud et al. (2016), which has previously been shown to be competitive with task-specific architectures (Raganato et al., 2017) match the performance of KnowBert-WordNet despite incorporating both Wikipedia and WordNet.Table 3 reports end-to-end entity linking performance for the AIDA-A and AIDA-B datasets.
Here, KnowBert's performance lags behind the current state-of-the-art model from Kolitsas et al. (2018), but still provides strong performance compared to other established systems such as AIDA (Hoffart et al., 2011) and DBpedia Spotlight (Daiber et al., 2013).We believe this is due to the selective annotation in the AIDA data that only annotates named entities.The CrossWikisbased candidate selector used in KnowBert generates candidate mentions for all entities including common nouns from which KnowBert may be learning to extract information, at the detriment of specializing to maximize linking performance for AIDA.

Downstream Tasks
This section evaluates KnowBert on downstream tasks to validate that the addition of knowledge improves performance on tasks expected to benefit from it.Given the overall superior performance of KnowBert-W+W on the intrinsic evaluations, we focus on it exclusively for evaluation in this section.The main results are included in this section; see the supplementary material for full details.
The baselines we compare against are BERT BASE , BERT LARGE , the pre-BERT state of the art, and two contemporaneous papers that add similar types of knowledge to BERT.ERNIE (Zhang et al., 2019) uses TAGME (Ferragina and Scaiella, 2010) (Choi et al., 2018).
Entity typing We also evaluated KnowBert-W+W using the entity typing dataset from Choi et al. (2018).To directly compare to ERNIE, we adopted the evaluation protocol in Zhang et al. (2019) which considers the nine general entity types. 7Our model marks the location of a target span with the special [E] and [/E] tokens and uses the representation of the [E] token to predict the type.As shown in Table 7, KnowBert-W+W shows an improvement of 0.6% F 1 over ERNIE and 2.5% over BERT BASE .

Conclusion
We have presented an efficient and general method to insert prior knowledge into a deep neural model.Intrinsic evaluations demonstrate that the addition of WordNet and Wikipedia to BERT improves the quality of the masked LM and significantly improves its ability to recall facts.Downstream evaluations demonstrate improvements for relationship extraction, entity typing and word sense disambiguation datasets.Future work will involve incorporating a diverse set of domain specific KBs for specialized NLP applications.

A.1 KnowBert training details
We generally followed the fine-tuning procedure in Devlin et al. (2019), using Adam (Kingma and Ba, 2015) with weight decay 0.1 and learning rate schedule that linearly increases then decreases.Similar to ULMFiT (Howard and Ruder, 2018), we found it beneficial to vary the learning rate in different layers when fine tuning with this simple schedule: the randomly initialized newly added layers in the KAR surrounding each KB had the largest learning rate α; all BERT layers below had learning rate 0.25α; and BERT layers above had 0.5α.KnowBert-Wiki was fine-tuned for a total of 750K gradient updates, KnowBert-WordNet for 500K updates, and KnowBert-W+W for 500K updates (after pretraining KnowBert-Wiki).Finetuning was done on a single Titan RTX GPU with batch size of 32 using gradient accumulation for long sequences, except for the final 250K steps of KnowBert-W+W which was trained with batch size of 64 using 4 GPUs.At the end of training, masked LM perplexity continued to decrease, suggesting that further training would improve the results.
Due to computational expense, we performed very little hyperparameter tuning during the pretraining stage, and none with the full KnowBert-W+W model.All tuning was performed with partial training runs by monitoring masked LM perplexity in the early portion of training and terminating the under performing configurations.For each KnowBert-WordNet and KnowBert-Wiki we ran experiments with two learning rates (maximum learning rate of 1e-4 and 2e-4) and chose the best value after a few hundred thousand gradient updates (2e-4 for KnowBert-WordNet and 1e-4 for KnowBert-Wiki).

A.2 Task fine-tuning details
This section details the fine tuning procedures and hyperparameters for each of the end tasks.All optimization was performed with the Adam optimizer with linear warmup of learning rate over the first 10% of gradient updates to a maximum value, then linear decay over the remainder of training.Gradients were clipped if their norm exceeded 1.0, and weight decay on all non-bias parameters was set to 0.01.Grid search was used for hyperparameter tuning (maximum values bolded below), using five random restarts for each hyperparameter setting for all datasets except TACRED (which used a single seed).Early stopping was performed on the development set.Batch size was 32 in all cases.
We used the provided semeval2010 task8 scorer-v1.2.pl script to compute F 1 .The maximum development F 1 averaged across the random restarts was 89.1 ± 0.77 (maximum value was 90.5 across the seeds).

A.3 Wikidata probing results
Figure 1: The Knowledge Attention and Recontextualization (KAR) component.BERT word piece representations (H i ) are first projected to H proj i

Table 1 :
By adding KBs from bottom to top, we Comparison of masked LM perplexity, Wikidata probing MRR, and number of parameters (in millions) in the masked LM (word piece embeddings, transformer layers, and output layers), KAR, and entity embeddings for BERT and KnowBert.The table also includes the total time to run one forward and backward pass (in seconds) on a TITAN Xp GPU (12 GB RAM) for a batch of 32 sentence pairs with total length 80 word pieces.Due to memory constraints, the BERT LARGE batch is accumulated over two smaller batches.

Table 4 :
Single model test set results on the TACRED relationship extraction dataset.† with MTB pretraining.

Table 5 :
. As can be seen, KnowBert provides competitive performance, and KnowBert-W+W is able to Test set F 1 for SemEval 2010 Task 8 relationship extraction.† with MTB pretraining.

Table 6 :
to link entities to Wikidata, retrieves the associated entity embeddings, and fuses them into BERT BASE by fine-tuning.Soares et al. (2019) learns relationship representations by fine-tuning BERT LARGE with large scale "matching the blanks" (MTB) pretraining using entity linked text.Test set results for the WiC dataset (v1.0).

Table 5 )
, KnowBert-W+W F 1 falls between the entity aware BERT BASE model from Wang et al. (2019b), and the BERT LARGE model from Soares et al. (2019).

Table 6 ,
KnowBert-W+W sets a new state of the art for this task, improving over BERT LARGE by 1.4% and reducing the relative gap to 80% human performance by 13.3%.

Table 7 :
Test set results for entity typing using the nine general types from

Table 8 :
Table8shows the results for the Wikidata probing task for all relationships.Full results on the Wikidata probing task including all relations.