Controlling the Imprint of Passivization and Negation in Contextualized Representations (2020)

Abstract: Contextualized word representations encode rich information about syntax and semantics, alongside specificities of each context of use. While contextual variation does not always reflect actual meaning shifts, it can still reduce the similarity of embeddings for word instances having the same meaning. We explore the imprint of two specific linguistic alternations, namely passivization and negation, on the representations generated by neural models trained with two different objectives: masked language modeling and translation. Our exploration methodology is inspired by an approach previously proposed for removing societal biases from word vectors. We show that passivization and negation leave their traces on the representations, and that neutralizing this information leads to more similar embeddings for words that should preserve their meaning in the transformation. We also find clear differences in how the respective features generalize across datasets.

## introduction contextualized representations extracted from pretrained language models reflect the syntactic and semantic properties of words @xcite @xcite as well as variation in their context of use. we propose to explore the impact of context variation on word representations. we specifically address representations generated by the bert model @xcite , trained using a language modeling objective, and translation models involving one or more language pairs @xcite . we run a series of controlled experiments using sentences illustrating both meaning preserving and meaning altering transformations from the sick dataset @xcite , and examples automatically generated using a template-based method @xcite . we explore the impact of specific alternations on the representations, namely passivization and negation. examples in our datasets consist of sentences that only differ in terms of the specific alternation addressed. in order to detect the imprint of these transformations on the representations, we employ methodology inspired by work on linguistic bias detection in embedding representations @xcite @xcite . furthermore, we investigate the impact of removing the encoding of such alternations on word similarity. intuitively, we would expect the representations of words present in sentences that have undergone passivization (pas) to be highly similar despite the differences in syntactic structure. consider, for example, the words mafia, millionaire and kidnapped in the examples 1 and 2 . pas changes the words' syntactic roles but their thematic roles remain the same. the meaning shift that results from this operation is mainly discursive, 1 shifting the focus from the theme to the agent, but the content words in the two sentences still refer to the same event and entities. 2 their representations should thus be highly similar. we also address a meaning altering transformation which involves inserting (or removing) the negation particle to produce contradictions, as in 3 and 4 . the effect of negation (neg) at the sentence level is obvious. however, the meaning of specific words (boy, playing, piano) should remain the same despite of the whole sentence having the opposite meaning. below, we explore the extent to which this type of context variation affects the similarity of the representations of word instances in the two sentences. we show that passivization and negation 3 have a significant imprint on the representations, and that their removal can improve word similarity estimation. our results also highlight that this type of context variation is differently marked in representations generated by models trained with different objectives. specifically, we find that variation in the embeddings produced by models trained with a translation objective generalize better than those derived from models trained with a masked language modeling objective, across datasets, in the sense that they seem to be encoded in features that are independent of the specific dataset. 1 note, however, that the impact of the alternation on the framing of the sentence can be significant. passive avoids identifying a causal agent and therefore conceals the responsibility for an event @xcite . 2 in sentence 1 , the mafia is the agent and is in subject position, while the millionaire is the theme in direct object position. in 2 , the semantic relationship of the mafia and the millionaire to the kidnapping event is the same but their syntactic roles have changed. ## related work the analysis and interpretation of the linguistic knowledge present in contextualized representations has recently been the focus of a large amount of work @xcite @xcite . the bulk of this interpretation work relies on probing tasks which serve to predict linguistic properties from the representations generated by the models @xcite . these might involve structural aspects of language, such as syntax, word order, or number agreement @xcite @xcite , or semantic phenomena such as semantic role labeling and coreference @xcite . in our work, we shift the focus from interpreting the knowledge about language encoded in the representations, to exploring the imprint of two specific transformations, passivization and negation, on word representations. the majority of the above mentioned works address representations generated by models trained with a language modeling objective, such as lstm rnns @xcite , elmo @xcite and bert @xcite . @xcite propose to study the representations obtained from models trained with a different objective. we take the same stance and investigate the impact of context on representations generated by bert, and by the encoder of neural machine translation (nmt) models involving one or more language pairs. in order to detect the information related to the two studied transformations that is encoded in the representations, we employ methodology initially proposed for identifying and removing linguistic and other kinds of biases from representations. such methods fall in two main paradigms: projection and adversarial methods. projection methods identify specific directions in word embedding space that correspond to the protected attribute, and remove them. @xcite identify a gender subspace by exploring gendered word lists. @xcite propose to train debiased word embeddings from scratch by altering the loss of the glove model @xcite to concentrate specific information (e.g., about gender) in a dedicated coordinate of each vector. @xcite propose a simple linear projection method to reduce the bias in word embed-dings. @xcite develop a variation of this method that introduces more flexibility in the formation of the debiasing vector used in the projection. adversial methods extend the main task objective with a component that competes with the encoder trying to extract the protected information from its representation @xcite @xcite . these models cannot, however, completely remove the protected information, and their training is difficult @xcite . @xcite propose a null-space cleaning operator as a privacy mechanism to minimize the exposure of confidential information in a dataset. given a model pre-trained for a given task, they remove from the input a subspace that contains the null-space, hence removing information that is not used for the main task. @xcite propose a similar method, iterative null-space projection (inlp), for removing information regarding a certain property from representations. it is based on the mathematical notion of linear projection and is data-driven in the directions it removes, like adversarial methods. in our experiments, we repurpose the inlp method for identifying and removing traces of the passivization and negation transformations from contextualized representations. ## experimental setup in our experiments, we use contextualized representations generated by the bert language model and two transformer-based machine translation models (section 3.1). we generate representations for words in two datasets with sentence pairs illustrating passivization and negation (section 3.2). we focus on the main verb, and the nouns found in subject and object positions in the sentence pairs. we study the effect of the transformations on the representations using binary classification and iterative nullspace projection (section 3.3). foot_0 ## results in this section, we present various analyses of the original data and the effects of the transformations on contextualized word representations. first, we provide a visualization of embeddings before and after null-space projection. next, we study the classification results which demonstrate the success of inlp and, finally, we investigate the impact of the neutralization procedure on word similarity. we also provide evidence regarding the generalization capability of the algorithm and the projections it discovers. in all results, with the exception of visualizations, we report the average of 20 runs. ## conclusion we have shown that transformations such as passivization and negation leave a strong imprint on contextualized representations. we demonstrate that leveraging this information, it is possible to build classifiers that successfully identify word instances falling in either category. the traces of these transformations also affect the similarity of word instances that refer to the same entities and events. repurposing a method initially proposed for identifying and removing societal biases from representations, we show that it is possible to neutralize the trace of such transformations from contextualized representations, and preserve the similarity of word instances having the same reference. interestingly, the features that predict the transformation variant seem to be more generalizable in the embeddings generated by an mt encoder than in the bert embeddings, implying that the bert embeddings contain more surface-level information specific to each dataset. figures 6 and 7 provide the complete mds visualizations for templ-pas and templ-neg. for templ-pas, we see a significant imprint for the nouns also. for templ-neg, the imprint is mostly visible for the verbs, however note that this does not mean the nouns are unclassifiable, since the inlp classifier is able to find a good classification for them as well (