Abstract Contextual word representations derived from large-scale neural language models are successful across a diverse set of NLP tasks, suggesting that they encode useful and transferable features of language. To shed light on the linguistic knowledge they capture, we study the representations produced by several recent pretrained contextualizers (variants of ELMo, the OpenAI transformer language model, and BERT) with a suite of sixteen diverse probing tasks. We find that linear models trained on top of frozen contextual representations are competitive with state-of-the-art task-specific models in many cases, but fail on tasks requiring fine-grained linguistic knowledge (e.g., conjunct identification). To investigate the transferability of contextual word representations, we quantify differences in the transferability of individual layers within contextualizers, especially between recurrent neural networks (RNNs) and transformers. For instance, higher layers of RNNs are more task-specific, while transformer layers do not exhibit the same monotonic trend. In addition, to better understand what makes contextual word representations transferable, we compare language model pretraining with eleven supervised pretraining tasks. For any given task, pretraining on a closely related task yields better performance than language model pretraining (which is better on average) when the pretraining dataset is fixed. However, language model pretraining on more data gives the best results. Pretrained word representations (Mikolov et al., 2013; Pennington et al., 2014) are a key component of state-of-the-art neural NLP models. Traditionally, these word vectors are statica single * Work done while at the Allen Institute for Artificial Intelligence. vector is assigned to each word. Recent work has explored contextual word representations (hence-forth: CWR s), which assign each word a vector that is a function of the entire input sequence; this enables them to model the use of words in context. CWR s are typically the outputs of a neural network (which we call a contextualizer ) trained on tasks with large datasets, such as machine translation (McCann et al., 2017) and language modeling (Peters et al., 2018a). CWR s are extraordinarily effectiveusing them in place of traditional static word vectors within the latest models leads to large gains across a variety of NLP tasks. The broad success of CWR s indicates that they encode useful, transferable features of language. However, their linguistic knowledge and transferability are not yet well understood. Recent work has explored the linguistic knowledge captured by language models and neural machine translation systems, but these studies often focus on a single phenomenon, e.g., knowledge of hierarchical syntax (Blevins et al., 2018) or morphology (Belinkov et al., 2017a). We extend prior work by studying CWR s with a diverse set of sixteen probing tasks designed to assess a wide array of phenomena, such as coreference, knowledge of semantic relations, and entity information, among others. The result is a broader view of the linguistic knowledge encoded within CWR s. With respect to transferability, pretraining contextualizers on the language modeling task has had the most empirical success, but we can also consider pretraining contextualizers with other supervised objectives and probing their linguistic knowledge. We examine how the pretraining task affects the linguistic knowledge learned, considering twelve pretraining tasks and assessing transferability to nine target tasks. Better understanding the linguistic knowledge and transferability of CWR s is necessary for their principled enhancement through new encoder architectures and pretraining tasks that build upon their strengths or alleviate their weaknesses (Linzen, 2018). This paper asks and answers: 1. What features of language do these vectors capture, and what do they miss? (  4) 2. How and why does transferability vary across representation layers in contextualizers? (  5) 3. How does the choice of pretraining task affect the vectors' learned linguistic knowledge and transferability? (  6) We use probing models 1 (Shi et al., 2016b; Adi et al., 2017; Hupkes et al., 2018; Belinkov and Glass, 2019) to analyze the linguistic information within CWR s. Concretely, we generate features for words from pretrained contextualizers and train a model to make predictions from those features alone (Figure 1). If a simple model can be trained to predict linguistic information about a word (e.g., its part-of-speech tag) or a pair of words (e.g., their semantic relation) from the CWR (s) alone, we can reasonably conclude that the CWR (s) encode this information. Our analysis reveals interesting insights such as: 1. Linear models trained on top of frozen CWR s are competitive with state-of-the-art task-specific models in many cases, but fail on tasks requiring fine-grained linguistic knowledge. In these cases, we show that task-trained contextual features greatly help with encoding the requisite knowledge. 2. The first layer output of long short-term memory (LSTM) recurrent neural networks is consistently the most transferable, whereas it is the middle layers for transformers. 3. Higher layers in LSTMs are more task-specific (and thus less general), while the transformer layers do not exhibit this same monotonic increase in task-specificity. 4. Language model pretraining yields representations that are more transferable in general than eleven other candidate pretraining tasks, though pretraining on related tasks yields the strongest results for individual end tasks. We construct a suite of sixteen diverse English probing tasks and use it to better understand the linguistic knowledge contained within CWR s. In contrast to previous studies that analyze the properties and task performance of sentence embeddings (Adi et al., 2017; Conneau et al., 2018, inter alia ), we specifically focus on understanding the CWR s of individual or pairs of words. We release this analysis toolkit to support future work in probing the contents of representations. 2 See Appendix A for details about task setup. The majority of past work in probing the internal representations of neural models has examined various token labeling tasks, where a decision is made independently for each token (Belinkov et al., 2017a,b; Blevins et al., 2018, inter alia ). We synthesize these disparate studies and build upon them by proposing additional probing tasks. The part-of-speech tagging (POS) task assesses whether CWR s capture basic syntax. We experiment with two standard datasets: the Penn Treebank (PTB; Marcus et al., 1993) and the Universal Dependencies English Web Treebank (UD-EWT; Silveira et al., 2014). The CCG supertagging (CCG) task assesses the vectors' fine-grained information about the syntactic roles of words in context. It is considered almost parsing (Bangalore and Joshi, 1999), since a sequence of supertags maps a sentence to a small set of possible parses. We use CCGbank (Hockenmaier and Steedman, 2007), a conversion of the PTB into CCG derivations. The syntactic constituency ancestor tagging tasks are designed to probe the vectors' knowledge of hierarchical syntax. For a given word, the probing model is trained to predict the constituent la-2 http://nelsonliu.me/papers/ contextual-repr-analysis Figure 2: Annotated sentences from the STREUSLE 4.0 corpus, used in the preposition supersense disambiguation task. In the semantic tagging task ( ST ), tokens are assigned labels that reflect their semantic role in context. These semantic tags assess lexical semantics, and they abstract over redundant POS distinctions and disambiguate useful cases within POS tags. We use the dataset of Bjerva et al. (2016); the tagset has since been developed as part of the Parallel Meaning Bank (Abzianidze et al., 2017). Preposition supersense disambiguation is the task of classifying a preposition's lexical semantic contribution (the function; PS-fxn ) and the semantic role or relation it mediates (the role; PS-role ). This task is a specialized kind of word sense disambiguation, and examines one facet of lexical semantic knowledge. In contrast to the tagging tasks above, the model is trained and evaluated on single-token prepositions (rather than making a decision for every token in a sequence). We use the STREUSLE 4.0 corpus (Schneider et al., 2018); example sentences appear in Figure 2. The event factuality (EF) task involves labeling phrases with the factuality of the events they describe (Saur and Pustejovsky, 2009, 2012; de Marneffe et al., 2012). For instance, in the following example reproduced from Rudinger et al. (2018), (1a) conveys that the leaving didn't happen, while the superficially similar (1b) does not. We use the Universal Decompositional Semantics It Happened v2 dataset (Rudinger et al., 2018), and the model is trained to predict a (non)factuality value in the range [  3 , 3] . Unlike the tagging tasks above, this task is treated as a regression problem, where a prediction is made only for tokens corresponding to events (rather than every token in a sequence). Performance is measured using Pearson correlation ( r ); we report ( r  100 ) so metrics for all tasks fall between 0 and 100. Several of our probing tasks involve segmentation using BIO or IO tags. Here the model is trained to predict labels from only a single word's CWR . Syntactic chunking (Chunk) tests whether CWR s contain notions of spans and boundaries; the task is to segment text into shallow constituent chunks. We use the CoNLL 2000 shared task dataset (Tjong Kim Sang and Buchholz, 2000). Named entity recognition (NER) examines whether CWR s encode information about entity types. We use the CoNLL 2003 shared task dataset (Tjong Kim Sang and De Meulder, 2003). Grammatical error detection (GED) is the task of identifying tokens which need to be edited in order to produce a grammatically correct sentence. Given that CWR s are extracted from models trained on large amounts of grammatical text, this task assesses whether embeddings encode features that indicate anomalies in their input (in this case, ungrammaticality). We use the First Certificate in English (Yannakoudakis et al., 2011) dataset, converted into sequence-labeling format by Rei and Yannakoudakis (2016). The conjunct identification (Conj) task challenges the model to identify the tokens that comprise the conjuncts in a coordination construction. Doing so requires highly specific syntactic knowledge. The data comes from the coordination-annotated PTB of Ficler and Goldberg (2016). We also design probing tasks that examine whether relationships between words are encoded in CWR s. In these tasks, given a word pair w 1 , w 2 , we input [ w 1 , w 2 , w 1 (cid:12) w 2 ] into the probing model; it is trained to predict information about the relation between the tokens (Belinkov, 2018). We distinguish between arc prediction and arc classification tasks. Arc prediction is a binary classification task, where the model is trained to identify whether a relation exists between two tokens. Arc classification is a multiclass classification task, where the model is provided with two tokens that are linked via some relationship and trained to identify how they are related. For example, in the syntactic dependency arc prediction task, the model is given the representations of two tokens ( w a , w b ) and trained to predict whether the sentence's syntactic dependency parse contains a dependency arc with w a as the head and w b as the modifier. The syntactic dependency arc classification task presents the model with the representations of two tokens ( w head , w mod ) , where w mod is the modifier of w head , and the model is trained to predict the type of syntactic relation that link them (the label on that dependency arc). We use the PTB (converted to UD) and the UD-EWT. Similarly, semantic dependency arc prediction trains the model to predict whether two tokens are connected by a semantic dependency arc, while the semantic dependency arc classification task trains models to classify the semantic relations between tokens. We use the dataset from the SemEval 2015 shared task (Oepen et al., 2015) with the DELPH-IN MRS-Derived Semantic Dependencies (DM) target representation. The syntactic and semantic dependency arc prediction and classification tasks are closely related to state-of-the-art models for semantic and syntactic dependency parsing, which score pairs of CWR s to make head attachment and arc labeling decisions (Dozat and Manning, 2016, 2018). To generate negative examples for the dependency arc prediction tasks, we take each positive example ( w head , w mod ) and generate a new negative example ( w rand , w mod ) . w rand is a random token in the sentence that is not the head of w mod . Thus, the datasets used in these tasks are balanced. We also consider a coreference arc prediction task, where the model is trained to predict whether two entities corefer from their CWR s. We use the dataset from the CoNLL 2012 shared task (Prad-han et al., 2012). To generate negative examples, we follow a similar procedure as the dependency arc prediction tasks: given a positive example ( w a , w b ) , where w b occurs after w a and the two tokens share a coreference cluster, we create a negative example ( w random entity , w b ) , where w random entity is a token that occurs before w b and belongs to a different coreference cluster. Probing Model We use a linear model as our probing model; limiting its capacity enables us to focus on what information can be easily extracted from CWR s. See Appendix B for probing model training hyperparameters and other details. Contextualizers We study six publicly-available models for contextualized word representation in English. ELMo (Peters et al., 2018a) concatenates the output of two contextualizers independently trained on the bidirectional language modeling (biLM) task. ELMo (original) uses a 2-layer LSTM for contextualization. We also study two variations from Peters et al. (2018b): ELMo (4-layer) uses a 4-layer LSTM, and ELMo (trans-former) uses a 6-layer transformer (Vaswani et al., 2017). Each of these models is trained on 800M tokens of sentence-shuffled newswire text (the 1 Billion Word Benchmark; Chelba et al., 2014). The OpenAI transformer (Radford et al., 2018) is a left-to-right 12-layer transformer language model trained on 800M tokens of contiguous text from over 7,000 unique unpublished books (BookCorpus; Zhu et al., 2015). BERT (Devlin et al., 2018) uses a bidirectional transformer jointly trained on a masked language modeling task and a next sentence prediction task. The model is trained on BookCorpus and the English Wikipedia, a total of approximately 3300M tokens. We study BERT (base, cased) , which uses a 12-layer transformer, and BERT (large, cased) , which uses a 24-layer transformer. To better understand the linguistic knowledge captured by pretrained contextualizers, we analyze each of their layers with our set of probing tasks. These contextualizers differ in many respects, and it is outside the scope of this work to control for all differences between them. We focus on probing the models that are available to us, leaving a more systematic comparison of training regimes and model architectures to future work. Our probing models are trained on the representations produced by the individual layers of each contextualizer. We also compare to a linear probing model trained on noncontextual vectors (300-dimensional GloVe trained on the cased Common Crawl; Pennington et al., 2014) to assess the gains from contextualization. 3,4 With just a linear model, we can readily extract much of the information needed for high performance on various NLP tasks. In all cases, CWR s perform significantly better than the noncontextual baseline. Indeed, we often see probing models rivaling or exceeding the performance of (of-ten carefully tuned and task-specific) state-of-the-art models. In particular, the linear probing model surpasses the published state of the art for grammatical error detection and preposition supersense identification (both role and function). Comparing the ELMo-based contextualizers, we see that ELMo (4-layer) and ELMo (original) are essentially even, though both recurrent models outperform ELMo (transformer). We also see that the OpenAI transformer significantly under-performs the ELMo models and BERT. Given that it is also the only model trained in a unidirectional (left-to-right) fashion, this reaffirms that bidirec-tionality is a crucial component for the highest-quality contextualizers (Devlin et al., 2018). In addition, the OpenAI transformer is the only model trained on lowercased text, which hinders its performance on tasks like NER. BERT significantly improves over the ELMo and OpenAI models. Our probing task results indicate that current methods for CWR do not capture much transfer-3 See Appendix C for references to the previous state of the art (without pretraining). 4 For brevity, in this section we omit probing tasks that cannot be compared to prior work. See Appendix D for pretrained contextualizer performance for all layers and all tasks. able information about entities and coreference phenomena in their input (e.g., the NER results in Table 1 and the coreference arc prediction results in Appendix D). To alleviate this weakness, future work could augment pretrained contextualizers with explicit entity representations (Ji et al., 2017; Yang et al., 2017; Bosselut et al., 2017). Probing Failures While probing models are at or near state-of-the-art performance across a number of tasks, they also do not perform as well on several others, including NER, grammatical error detection, and conjunct identification. This may occur because (1) the CWR simply does not encode the pertinent information or any predictive correlates, or (2) the probing model does not have the capacity necessary to extract the information or predictive correlates from the vector. In the former case, learning task-specific contextual features might be necessary for encoding the requisite task-specific information into the CWR s. Learning task-specific contextual features with a contextual probing model also helps with (2), but we would expect the results to be comparable to increasing the probing model's capacity. To better understand the failures of our probing model, we experiment with (1) a contextual probing model that uses a task-trained LSTM (unidi-rectional, 200 hidden units) before the linear output layer (thus adding task-specific contextualization) or (2) replacing the linear probing model with a multilayer perceptron (MLP; adding more parameters to the probing model: a single 1024d hidden layer activated by ReLU). These alternate probing models have nearly the same number of parameters (LSTM + linear has slightly fewer). We also compare to a full-featured model to Probing Model NER GED Conj GGParent Linear 82.85 29.37 38.72 67.50 MLP (1024d) 87.19 47.45 55.09 78.80 LSTM (200d) + Linear 88.08 48.90 78.21 84.96 BiLSTM (512d) + MLP (1024d) 90.05 48.34 87.07 90.38 Table 2: Comparison of different probing models trained on ELMo (original); best-performing probing model is bolded. estimate an upper bound on performance for our probing setup. In this model, the CWR s are inputs to a 2-layer BiLSTM with 512 hidden units, and the output is fed into a MLP with a single 1024-dimensional hidden layer activated by a ReLU to predict a label. A similar model, augmented with a conditional random field (CRF; Lafferty et al., 2001), achieved state-of-the-art results on the CoNLL 2003 NER dataset (Peters et al., 2018a). We remove the CRF, since other probing models have no global context. For this experiment, we focus on the ELMo (original) pretrained contextualizer. Table 2 presents the performance of the best layer within each alternative probing model on the two tasks with the largest gap between the linear probing model and state-of-the-art methods: NER and grammatical error detection. We also include great-grandparent prediction and conjunct identification, two tasks that require highly specific syntactic knowledge. In all cases, we see that adding more parameters (either by replacing the linear model with a MLP, or using a contextual probing model) leads to significant gains over the linear probing model. On NER and grammatical error detection, we observe very similar performance between the MLP and LSTM + Linear modelsthis indicates that the probing model simply needed more capacity to extract the necessary information from the CWR s. On conjunct identification and great-grandparent prediction, two tasks that probe syntactic knowledge unlikely to be encoded in CWR s, adding parameters as a task-trained component of our probing model leads to large gains over simply adding parameters to the probing model. This indicates that the pretrained contextualizers do not capture the information necessary for the task, since such information is learnable by a task-specific contextualizer. This analysis also reveals insights about contextualizer fine-tuning, which seeks to specialize the CWR s for an end task (Howard and Ruder, 2018; Radford et al., 2018; Devlin et al., 2018). Our results confirm that task-trained contextualization is important when the end task requires specific information that may not be captured by the pretraining task (  4). However, such end-task specific contextualization can come from either fine-tuning CWR s or using fixed output features as inputs to a task-trained contextualizer; Peters et al. (2019) begins to explore when each approach should be applied. We quantify the transferability of CWR s by how well they can do on the range of probing tasks representations that are more transferable will perform better than alternatives across tasks. When analyzing the representations produced by each layer of pretrained contextualizers, we observe marked patterns in layerwise transferability (Fig-ure 3). The first layer of contextualization in recurrent models (original and 4-layer ELMo) is consistently the most transferable, even outperforming a scalar mix of layers on most tasks (see Appendix D for scalar mix results). Schuster et al. (2019) see the same trend in English dependency parsing. By contrast, transformer-based contextualizers have no single most-transferable layer; the best performing layer for each task varies, and is usually near the middle. Accordingly, a scalar mix of transformer layers outperforms the best individual layer on most tasks (see Appendix D). Pretraining encourages the model to encode pretraining-taskspecific information; they learn transferable features incidentally. We hypothesize that this is an inherent trade-offsince these models used fixed-sized vector representations, task-specificity comes at the cost of generality and transferability. To investigate the task-specificity of the representations generated by each contextualizer layer, we assess how informative each layer of representation is for the pretraining task, essentially treating it as a probe. We focus on the ELMo-based models, since the authors have released code for training their con-(a) ELMo (original) Layer 0 Layer 2 textualizers. Furthermore, the ELMo-based models facilitate a controlled comparisonthey only differ in the contextualizer architecture used. We evaluate how well CWR features perform the pretraining taskbidirectional language modeling. Specifically, we take the pretrained representations for each layer and relearn the language model softmax classifiers used to predict the next and previous token. The ELMo models are trained on the Billion Word Benchmark, so we retrain the softmax classifier on similar data to mitigate any possible effects from domain shift. We split the held-out portion of the Billion Word Benchmark into train (80%, 6.2M tokens) and evaluation (20%, 1.6M tokens) sets and use this data to retrain and evaluate the softmax classifiers. We expect that biLM perplexity will be lower when training the softmax classifiers on representations from layers that capture more information about the pretraining task. Figure 4 presents the performance of softmax classifiers trained to perform the bidirectional language modeling task, given just the CWR s as input. We notice that higher layers in recurrent models consistently achieve lower perplexities. Interestingly, we see that layers 1 and 2 in the 4-layer ELMo model have very similar performancethis warrants further exploration. On the other hand, the layers of the ELMo (transformer) model do not exhibit such a monotonic increase. While the topmost layer is best (which we expected, since this is the vector originally fed into a softmax classifier during pretraining), the middle layers show varying performance. Across all models, the representations that are better-suited for language modeling are also those that exhibit worse probing task performance (Figure 3), indicating that contextualizer layers trade off between encoding general and task-specific features. These results also reveal a difference in the layerwise behavior of LSTMs and transformers; moving up the LSTM layers yields more task-specific representations, but the same does not hold for transformers. Better understanding the differences between transformers and LSTMs is an active area of research (Chen et al., 2018; Tang et al., 2018), and we leave further exploration of these observations to future work. These observations motivate the gradual unfreezing method of Howard and Ruder (2018), where the model layers are progressively unfrozen (starting from the final layer) during the fine-tuning process. Given our observation that higher-level LSTM layers are less general (and more pretraining task-specific), they likely have to be fine-tuned a bit more in order to make them appropriately task specific. Meanwhile, the base layer of the LSTM already learns highly transferable features, and may not benefit from fine-tuning. Successful pretrained contextualizers have used self-supervised tasks such as bidirectional language modeling (Peters et al., 2018a) and next sentence prediction (Devlin et al., 2018), which enable the use of large, unannotated text corpora. However, contextualizers can also be pretrained on explicitly supervised objectives, as done in pretrained sentence embedding methods (Con-neau et al., 2017). To better understand how the choice of pretraining task affects the linguistic knowledge within and transferability of CWR s, we compare pretraining on a range of different explicitly-supervised tasks with bidirectional language model pretraining. To ensure a controlled comparison of different pretraining tasks, we fix the contextualizer's architecture and pretraining dataset. All of our contextualizers use the ELMo (original) architecture, and the training data from each of the pretraining tasks is taken from the PTB. Each of the (identi-cal) models thus see the same tokens, but the supervision signal differs. 5 We compare to (1) a noncontextual baseline (GloVe) to assess the effect of contextualization, (2) a randomly-initialized, untrained ELMo (original) baseline to measure the effect of pretraining, and (3) the ELMo (original) model pretrained on the Billion Word Benchmark to examine the effect of training the bidirectional language model on more data. Table 3 presents the average target task performance of each layer in contextualizers pretrained on twelve different tasks (biLM and the eleven tasks from  2 with PTB annotations). Bidirectional language modeling pretraining is the most effective on average. However, the settings that achieve the highest performance for individual target tasks often involve transferring between related tasks (not shown in Table 3; see Appendix E). For example, when probing CWR s on 5 We omit the OpenAI transformer and BERT from this comparison, since code for pretraining these contextualizers is not publicly available. the syntactic dependency arc classification (EWT) task, we see the largest gains from pretraining on the task itself, but with a different dataset (PTB). However, pretraining on syntactic dependency arc prediction (PTB), CCG supertagging, chunking, the ancestor prediction tasks, and semantic dependency arc classification all give better performance than bidirectional language model pretraining. Although related task transfer is beneficial, we naturally see stronger results from training on more data (the ELMo original BiLM trained on the Billion Word Benchmark). This indicates that the transferability of pretrained CWR s relies on pretraining on large corpora, emphasizing the utility and importance of self-supervised pretraining. Furthermore, layer 0 of the BiLM is the highest-performing single layer among PTB-pretrained contextualizers. This observation suggests that lexical information is the source of the language model's initial generalizability, since layer 0 is the output of a character-level convolutional neural network with no token-level contextual information. Methodologically, our work is most similar to Shi et al. (2016b), Adi et al. (2017), and Hupkes et al. (2018), who use the internal representations of neural models to predict properties of interest. Conneau et al. (2018) construct probing tasks to study the linguistic properties of sentence embedding methods. We focus on contextual word representations, which have achieved state-of-the-art results on a variety of tasks, and examine a broader range of linguistic knowledge. In contemporaneous work, Tenney et al. (2019) evaluate CoVe (McCann et al., 2017), ELMo (Pe-ters et al., 2018a), the OpenAI Transformer (Rad-ford et al., 2018), and BERT (Devlin et al., 2018) on a variety of sub-sentence linguistic analysis tasks. Their results also suggest that the aforementioned pretrained models for contextualized word representation encode stronger notions of syntax than higher-level semantics. They also find that using a scalar mix of output layers is particularly effective in deep transformer-based models, aligned with our own probing results and our observation that transformers tend to encode transferable features in their intermediate layers. Furthermore, they find that ELMo's performance cannot be explained by a model with access to only local context, indicating that ELMo encodes linguistic features from distant tokens. Several other papers have examined how architecture design and choice of pretraining task affect the quality of learned CWR s. Peters et al. (2018b) study how the choice of neural architecture influences the end-task performance and qualitative properties of CWR s derived from bidirectional language models (ELMo). Bowman et al. (2018) compare a variety of pretraining tasks and explore the the impact of multitask learning. Prior work has employed a variety of other methods to study the learned representations in neural models, such as directly examining the activations of individual neurons (Karpathy et al., 2015; Li et al., 2015; Shi et al., 2016a, inter alia ), ablating components of the model and dataset (Kuncoro et al., 2017; Gaddy et al., 2018; Khandelwal et al., 2018), or interpreting attention mechanisms (Bahdanau et al., 2015); see Belinkov and Glass (2019) for a recent survey. One particularly relevant line of work involves the construction of synthetic tasks that a model can only solve if it captures a particular phenomenon (Linzen et al., 2016; Jumelet and Hupkes, 2018; Wilcox et al., 2018; Futrell and Levy, 2019, inter alia ). Zhang and Bowman (2018) compare the syntactic knowledge of language models and neural machine translation systems. We widen the range of pretraining tasks and target probing model tasks to gain a more complete picture. We also focus on a stronger contextualizer architecture, ELMo (origi-nal), that has produced state-of-the-art results. Several studies have sought to intrinsically evaluate noncontextual word representations with word similarity tasks, such as analogies (Mikolov et al., 2013). These methods differ from our approach in that they require no extra parameters and directly assess the vectors, while our probing models must be trained. In this regard, our method is similar to QVEC (Tsvetkov et al., 2015). We study the linguistic knowledge and transferability of contextualized word representations with a suite of sixteen diverse probing tasks. The features generated by pretrained contextualizers are sufficient for high performance on a broad set of tasks. For tasks that require specific information not captured by the contextual word representation, we show that learning task-specific contextual features helps to encode the requisite knowledge. In addition, our analysis of patterns in the transferability of contextualizer layers shows that the lowest layer of LSTMs encodes the most transferable features, while transformers' middle layers are most transferable. We find that higher layers in LSTMs are more task-specific (and thus less gen-eral), while transformer layers do not exhibit this same monotonic increase in task-specificity. Prior work has suggested that higher-level contextualizer layers may be expressly encoding higher-level semantic information. Instead, it seems likely that certain high-level semantic phenomena are incidentally useful for the contextualizer's pretraining task, leading to their presence in higher layers. Lastly, we find that bidirectional language model pretraining yields representations that are more transferable in general than eleven other candidate pretraining tasks. We thank Johannes Bjerva for sharing the semantic tagging dataset used in Bjerva et al. (2016). We also thank the members of the Noah's ARK group at the University of Washington, the researchers at the Allen Institute for Artificial Intelligence, and the anonymous reviewers for their valuable feedback. NL is supported by a Washington Research Foundation Fellowship and a Barry M. Goldwater Scholarship. YB is supported by the Harvard Mind, Brain, and Behavior Initiative.
abstain method result objective abstain method abstain abstain abstain abstain abstain abstain method abstain abstain abstain abstain objective abstain objective method abstain abstain objective objective objective method method method result result objective objective objective method abstain abstain abstain abstain abstain abstain method abstain abstain method abstain other abstain abstain abstain abstain abstain abstain method abstain method abstain method method abstain abstain method abstain method abstain abstain method abstain abstain abstain method method abstain abstain abstain abstain abstain method abstain method abstain abstain abstain abstain method method method method abstain method abstain abstain method abstain abstain abstain abstain method method abstain method method method method abstain method abstain method method abstain abstain abstain method method abstain abstain abstain abstain abstain abstain method method abstain method method abstain abstain method method abstain method method method method abstain abstain method abstain method abstain abstain abstain abstain abstain abstain abstain abstain method abstain abstain abstain method method method method method abstain result result abstain result abstain abstain abstain abstain abstain abstain abstain abstain method method method abstain method abstain abstain abstain abstain result abstain result abstain abstain abstain method other abstain other other abstain other other other other other other other abstain abstain other objective abstain method abstain result result result abstain abstain result other other other other