Introducing Orthogonal Constraint in Structural Probes (2021)

Abstract: With the recent success of pre-trained models in NLP, a significant focus was put on interpreting their representations. One of the most prominent approaches is structural probing (Hewitt and Manning, 2019), where a linear projection of word embeddings is performed in order to approximate the topology of dependency structures. In this work, we introduce a new type of structural probing, where the linear projection is decomposed into 1. iso-morphic space rotation; 2. linear scaling that identifies and scales the most relevant dimensions. In addition to syntactic dependency, we evaluate our method on two novel tasks (lexical hypernymy and position in a sentence). We jointly train the probes for multiple tasks and experimentally show that lexical and syntactic information is separated in the representations. Moreover, the orthogonal constraint makes the Structural Probes less vulnerable to memorization.

## introduction latent representations of neural networks encode specific linguistic features. recently, a lot of focus was devoted to interpret these representations and analyze structures captured by the deep models. one of the most popular analysis methods is probing @xcite @xcite . the pre-trained model's foot_0 parameters are fixed, and its latent states or outputs are then fed into a simple neural network optimized to solve an auxiliary task, e.g., semantic, syntactic parsing, anaphora resolution, morphosyntactic tagging, etc. the amount of language information stored in the representations can be evaluated by measuring the specific language task's performance. probing experiments usually involve classification tasks. lately, @xcite proposed structural probes, which use regression as an optimization objective. they train a linear projection layer to approximate: 1. dependency tree distances between words foot_1 by the euclidean distance between transformed vectors; 2. the tree depth of a word by the norm of its vector. in figure 1 , we visualize our orthogonal structural probe. a linear transformation is replaced by an orthogonal transformation (rotation of the embedding space), and product-wise multiplication of rotated vectors by a scaling vector to get the final projections. our motivation is to obtain an embedding space that is isomorphic with the original one, and the impact of each dimension can be evaluated by analyzing scaling vector's weights. we elaborate on mathematical properties and training details in section 3. in addition to dependency trees used by @xcite , we introduce new structural tasks related to lexical hypernymy and word's position in the sentence. we also employ a control task, in which we evaluate the memorization of randomly generated trees. orthogonal structural probes let us optimize for multiple objectives jointly by keeping a shared orthogonal transformation matrix and changing task-specific scaling vectors. we will answer the following questions: ## related work basic linguistic features can be easily extracted from the contextual representations @xcite . probing was intensively used to investigate the representation of morphological information (mainly pos tags) in hidden states of machine translation systems and language models @xcite @xcite . besides the work of @xcite , probing for dependency syntax was performed by @xcite and @xcite . they utilize a binary classifier to predict dependency edges. in work contemporary to ours, @xcite employ a softmax classifier to show that bert can be successfully probed for hypernymy. there is an ongoing debate on which probe architectures offer a good insight into underlying representations. @xcite showed that a pos tagger on top of a frozen randomly initialized lstm model achieves unexpectedly high results. in the work of @xcite , the multilayer perceptron probes display similar accuracy for predicting pos tags as for randomly assigned tags. these symptoms underscore how crucial it is to carefully consider the probe's architecture to avoid reaching spurious conclusions. it is good practice to monitor additional aspects of the probe beyond performance on a linguistic task, such as selectivity @xcite , or complexity @xcite . the recent state of knowledge is summarized in surveys on probing @xcite and interpretation of bert's representations @xcite . orthogonality has been applied broadly in the field of deep learning, especially to cope with exploding/vanishing gradient problem in recurrent neural networks @xcite @xcite . in this work, we use regularization to enforce the orthogonality of a dense layer. in literature, such an approach is called "soft constraint" @xcite . alternatively, "hard constraint" assumes parameterization of a network such that the transformation of latent states is orthogonal by definition @xcite . there are a few examples of orthogonality applications in nlp: in rnn language model @xcite ; in performer @xcite , which is a more efficient counterpart of transformer @xcite . best to our knowledge, we are the first to use orthogonal transformation in probing. ## method in this section, we first review the structural probing proposed by @xcite and then introduce our orthogonal structural probe. ## experiments we train probes on top of each of 24 layers of english bert large cased model @xcite implemented by huggingface @xcite . we optimize for the approximation of depth and distance in four types of structures: syntactic dependency, lexical hypernymy, absolute position in a sentence, and randomly generated trees. in the following subsection, we expand upon these structures. ## results we compare spearman's correlations between predicted values and gold tree depths and distances in in fig. 2 (upper), we observe that the performance varies throughout the layers, confirming previous observations by @xcite and @xcite . the mid-upper layers tend to be more syntactic, and the mid-lower ones are more lexical. predicting word position is more accurate in the lower layers, dropping significantly toward the last layers. it is due to the fact that in bert, positional embeddings are added before the first layer. random structure probes maintain steady results across all the layers. ## discussion the introduction of an orthogonal constraint is a core element of our analysis. the constraint assures that no dimension is enhanced or diminished in the transformation and allows interpreting the magnitude of values in the scaling vector as the relevance of each dimension for the objectives. hence, the dimensions of distinct scaling vectors do not correspond to each other. ## conclusions we have expanded structural probing to new types of auxiliary tasks and introduced a new setting, orthogonal structural probe, in which probes can be optimized jointly. we found out that: 2. in addition to syntactic dependencies orthogonal structural probes can be efficiently trained to approximate dependency and depth in wordnet hypernymy trees and positional order.