Probing for Bridging Inference in Transformer Language Models (2021)

Abstract: We probe pre-trained transformer language models for bridging inference. We first investigate individual attention heads in BERT and observe that attention heads at higher layers prominently focus on bridging relations in-comparison with the lower and middle layers, also, few specific attention heads concentrate consistently on bridging. More importantly, we consider language models as a whole in our second approach where bridging anaphora resolution is formulated as a masked token prediction task (Of-Cloze test). Our formulation produces optimistic results without any fine-tuning, which indicates that pre-trained language models substantially capture bridging inference. Our further investigation shows that the distance between anaphor-antecedent and the context provided to language models play an important role in the inference.

## introduction bridging inference involves connecting conceptually related discourse entitiesanaphors and antecedents @xcite . a bridging anaphor shares non-identical relation with its antecedent and depends on it for complete interpretation. this differs from coreference resolution which links mentions that refer to the same entity (i.e., mentions in the same entity share identical relations). consider the following example -"in poland's rapid shift from socialism to an undefined alternative, environmental issues have become a cutting edge of broader movements to restructure the economy, cut cumbersome bureaucracies , and democratize local politics." bridging inference connects the anaphor "the economy" and its antecedent "poland" and deduces that "the economy" specifically refers to "the economy of poland". we want to investigate if the pre-trained transformer language models capture any bridging inference information. recently there has been an in-creasing interest in analyzing pre-trained language models' ability at capturing syntactic information @xcite , semantic information @xcite , as well as commonsense knowledge @xcite . there are also a few studies focusing on probing coreference information in pre-tained language models @xcite . so far, there has no work on analyzing bridging, which is an important type of entity referential information. we try to fill this gap in our work. we employ two different but complementary approaches for the probing of pre-trained transformer language models for bridging inference. in the first approach (section 4), we investigate the core internal part of transformer models -self-attention heads in vanilla bert @xcite . we look at the attention heads of each layer separately and measure the proportion of attention paid from anaphor to antecedent and vice versa. this captures the magnitude of bridging signal corresponding to each attention head. we observed that attention heads of higher layers are more active at attending at bridging relations as well as some of the individual attention heads prominently look at the bridging inference information. in the second approach (section 5), we treat pretrained transformer language models as a black box and form bridging inference as a masked token prediction task. this formulation takes into consideration the whole architecture and weights of the model rather than concentrating on individual layers or attention heads, thus, complementing our first approach where we looked at the individual parts of the transformer model. for each bridging anaphor, we provide input as "context anaphor of @xcite " to language models and get the scores of different antecedent candidates for mask tokens. we then select the highest scoring candidate as the predicted antecedent. surprisingly, the best variation of this approach produces a high accuracy score of 28.05% for bridging anaphora resolution on isnotes @xcite data without any task-specific fine-tuning of the model. on the same corpus, the current state-of-the-art bridging anaphora resolution model barqa @xcite achieves an accuracy of 50.08%, while a solid mention-entity pairwise model with carefully crafted semantic features @xcite produces an accuracy score of 36.35%. this shows that substantial bridging information is captured in the pre-trained transformer language models. bridging inference requires both commonsense world knowledge as well as context-dependent text understanding. the above-mentioned fill-in-thegap formulation for the antecedent selection task is flexible enough to easily explore the role of different types of context for bridging inference. our analysis shows that pre-trained language models capture bridging inference substantially however the overall performance depends on the context provided to the model. it is also observed that bigger language models are more accurate at capturing bridging information. this work has two main contributions. first, we thoroughly investigate bridging information encoded in pre-trained language models using two probing approaches (attention heads analysis and fill-in-the-gap). second, we provide a deeper understanding of the bridging referential capabilities in the current pre-trained language models. our experimental code is available at https://github. com/oapandit/probbertforbridging . ## methodology in this paper, we mainly investigate the following research questions: we designed a series of experiments to answer these questions which will be detailed in the coming sections. in these experiments, we used py-torch @xcite implementation of bertbase-cased, bert-large-cased, roberta-base and roberta-large pre-trained transformer language models with the standard number of layers, attention heads, and parameters. in the attention head-based experiments, we have limited our investigation only to the bert-base-cased model as it is relatively smaller compared to other models and findings of this model can be generalized to other models as well. probing dataset we used isnotes @xcite dataset for all experiments. we choose this corpus because it contains "unrestricted anaphoric referential bridging" annotations among all available english bridging corpora @xcite which covers a wide range of different relations. isnotes contains 663 bridging anaphors but only 622 anaphors have noun phrase antecedents. 1 in our experiments, we only consider these 622 anaphors for investigation. for any anaphor, the predicted antecedent is selected from the set of antecedent candidates. this set is formed by considering all the mentions which occur before the anaphor. we obtained the candidate set for each anaphor by considering "gold mentions" annotated in isnotes. further, we observed that only 531 anaphors have antecedents in either previous 2 sentences from the anaphor or the first sentence of the document. therefore, in the experiments when antecedent candidates are considered from the window of previous two sentences plus the document's first sentence, only 531 anaphors are considered. in all the experiments, accuracy is measured as the ratio between correctly linked anaphors to the total anaphors used in that particular experiment (not total 663 anaphors). ## probing individual attention heads attention heads are an important part of transformer based language models. each layer consists of a certain number of attention heads depending on the model design and each attention head assigns different attention weight from every token of the input sentence to all the tokens. in our approach, we measure the attention flow between anaphors and antecedents for each attention head separately. in this experiment we investigate all the attention heads of every layer one-by-one. specifically, the bert-base-cased model used for probing contains 12 layers and 12 attention heads at each layer. therefore, we investigate 144 attention heads for their ability to capture bridging signals. ## fill-in-the-gap probing: lms as bridging anaphora resolvers the transformer-based language models are trained with an objective to predict the masked tokens given the surrounding context. thus, they can also produce a score for a word which can be placed at the masked token in a given sentence. we make use of this property of the language models and propose a novel formulation to understand the bridging anaphora resolution capacity of the pre-trained language models. ## conclusions we investigated the effectiveness of pre-trained transformer language models in capturing bridging relation inference by employing two distinct but complementary approaches. in the first approach, we probed individual attention heads in bert and observed that attention heads from higher layers prominently captured bridging compared to the middle and lower layers and some specific attention heads consistently looked for bridging relation. in our second approach, we considered using language models for bridging anaphora resolution by formulating the task as a of-cloze test. we carefully designed experiments to test the influence of different types of context for language models to resolve bridging anaphors. our results indicate that pre-trained transformer language models encode substantial information about bridging. finally, in this work, we only focus on understanding the capacity of the pre-trained language models for bridging inference. based on the insights we gained from the current probing study, in the future, we plan to explore how to better use pretrained transformer language models for bridging resolution.