Bird’s Eye: Probing for Linguistic Graph Structures with a Simple Information-Theoretic Approach (2021)

Abstract: NLP has a rich history of representing our prior understanding of language in the form of graphs. Recent work on analyzing contextualized text representations has focused on hand-designed probe models to understand how and to what extent do these representations encode a particular linguistic phenomenon. However, due to the inter-dependence of various phenomena and randomness of training probe models, detecting how these representations encode the rich information in these linguistic graphs remains a challenging problem. In this paper, we propose a new information-theoretic probe, Bird’s Eye, which is a fairly simple probe method for detecting if and how these representations encode the information in these linguistic graphs. Instead of using model performance, our probe takes an information-theoretic view of probing and estimates the mutual information between the linguistic graph embedded in a continuous space and the contextualized word representations. Furthermore, we also propose an approach to use our probe to investigate localized linguistic information in the linguistic graphs using perturbation analysis. We call this probing setup Worm’s Eye. Using these probes, we analyze the BERT models on its ability to encode a syntactic and a semantic graph structure, and find that these models encode to some degree both syntactic as well as semantic information; albeit syntactic information to a greater extent.

## introduction graphs have served as a predominant representation for various linguistic phenomena in natural language @xcite @xcite @xcite @xcite . these graph based representations have served our intuition for representing both language structure @xcite as well as meaning @xcite . with the growing popularity of pretrained language models that build contextualized text representations @xcite , various probing models have been introduced to understand if and how our linguistic intuitions are encoded in these representations. these probes train supervised models to predict pieces of linguistic information such as pos (partof-speech), morphology, syntactic and semantic relations, and other local or long-range phenomena in language @xcite @xcite @xcite . however, it is still an open question if these representations somehow encode entire linguistic graph structures such as dependency and constituency parse trees or graph structured meaning representations such as amr (abstract meaning representation), ucca (universal conceptual cognitive annotation), etc. a popular recent work, the structural probe (hewitt and manning, 2019), has investigated how contextualized representations encode syntax trees. they tested if a linear transformation of the network's word representation space can predict particular features of the syntax tree, namely, the distance between words and depth of words in the tree. thus, the structural probe cannot by itself answer the question if these representations encode entire linguistic graph structures. moreover, the structural probe is only designed for tree structures and cannot be extended to general graphs. in this work, we introduce a new probing approach, bird's eye, which can be used to detect if contextualized text representations encode entire linguistic graphs. bird's eye is a simple information-theoretic probe @xcite which first encodes the linguistic graph into a con-figure 1 : methodology of bird's eye: to probe pretrained language models, linguistic graphs are embedded in a continuous space and the mutual information between graph embeddings and word representations is calculated. in our experiments, we first illustrate the reliability of our probe methods and show the randomness of previous probe methods that use accuracy. then, we use bird's eye to detect syntactic and semantic structures in bert, showing that much syntactic and some semantic structure are encoded in bert. besides, we also use worm's eye to probe for specific linguistic information in syntactic trees and semantic graphs respectively to see which kinds of localized linguistic information is encoded in bert. our probing results are consistent with previous probe methods @xcite @xcite @xcite . we also discuss limitations of our probe and how future work can build upon our foundation. ## bird's eye probe in this section, we introduce our informationtheoretic approach for probing linguistic graph structures in word representations. the mi estimate is used to understand how much of the information in the linguistic graph structure has been learnt by the pretrained models. let @xmath0, . . . , x t } denote an input sentence (each x i is the contextual embedding of a token in the given vocabulary v) and g denote the cor-responding linguistic graph. furthermore, let x denote a random variable that takes values ranging over all possible token sequences in v. correspondingly, let g denote a random variable that ranges over all possible corresponding linguistic graphs. we use i(x ; g) to denote the linguistic structure information that is included in the given word representations. note that the mi value i(x ; g) is always non-negative, and a large mi implies that more of the structure information is encoded in the word representations. in order to make the mi computation easier, we additionally assume alignments between the nodes v in the graph g and the words in x. this alignment is one to one, for example, in dependency parsing @xcite but an aligner might be needed in some cases @xcite . there are three main challenges in estimating mi in our setting. first, the mi estimation of discrete graphs and continuous features has been an elusive problem @xcite @xcite , since there is no widely accepted definition of mutual information in this setting. second, the dimensionality of the contextualized word representations is very high. traditional methods @xcite @xcite for mi estimation do not scale well with large sample size or dimension @xcite . getting accurate estimates of mutual information in the high dimension is not easy. third, graphs across different linguistic formalisms could have different entropy values, and thus the mi value i(x ; g) may be uncomparable across the different linguistic graph formalisms. for example, if syntactic trees g and semantic graphs g have the same mi value with x i.e. i(x ; g) = i(x ; g ) while the entropy values are fairly different i.e. i(x ; g) ≈ h(g) << h(g ), it is not proper to conclude that x contains the same amount of information from structures g and g , since they correspond to different percentages of the amount of uncertainty. thus, the mi values must be inter-preted carefully. bird's eye tackles the aforementioned difficulties by transforming the linguistic graphs into a continuous space using a graph embedding approach. then the mi between graph embeddings and word representations is estimated using a recently proposed method @xcite which performs well even in high dimensions. finally, we also estimate a lower and upper bound of the mi, which is used to interpret the mi value. we describe various stages of bird's eye below: ## experiments our experiments mainly comprise of two parts: 1. verification of the probe: the first part is for verification of the probing methodology and ensuring that the graph embeddings retain information about the linguistic graphs i.e eq. 1 holds. we do this by testing if the graph embeddings can be used to restore the original graph. ## limitations and future work in this paper we propose a general informationtheoretic probe method, which is capable of probing for linguistic graph structures and avoids the randomness of training a model. in the experiments, we use our probe method to show the extent to which syntax trees and semantic graphs are encoded in pretrained bert models. further, we perform a simple perturbation analysis to show that with small modifications, the probe can also be used to probe for specific linguistic sub-structures. there are some limitations of our probe. first, a graph embedding is used, and some structure information could be lost in this process. we provide simple ways to test this. second, training a mi estimation model is difficult. future work can consider building on our framework by exploring better graph embedding and mi estimation techniques.