Changing the Basis of Contextual Representations with Explicit Semantics (2021)

Abstract: The application of transformer-based contextual representations has became a de facto solution for solving complex NLP tasks. Despite their successes, such representations are arguably opaque as their latent dimensions are not directly interpretable. To alleviate this limitation of contextual representations, we devise such an algorithm where the output representation expresses human-interpretable information of each dimension. We achieve this by constructing a transformation matrix based on the semantic content of the embedding space and predefined semantic categories using Hellinger distance. We evaluate our inferred representations on supersense prediction task. Our experiments reveal that the interpretable nature of transformed contextual representations makes it possible to accurately predict the supersense category of a word by simply looking for its transformed coordinate with the largest coefficient. We quantify the effects of our proposed transformation when applied over traditional dense contextual embeddings. We additionally investigate and report consistent improvements for the integration of sparse contextual word representations into our proposed algorithm.

## introduction in recent years, contextual word representations -such as bert @xcite or @xcite -have dominated the nlp landscape on leaderboards such as superglue @xcite as well as on real word applications @xcite . these models gain their semantics-related capabilities during the pre-training process, which can be then fine-tuned towards downstream tasks, including question answering @xcite or text summarization @xcite . representations obtained by transformer-based language models carry context-sensitive semantic information. although the semantic information is present in the embedding space, the interpretation and exact information it carries is convoluted. hence understanding and drawing conclusions from them are a cumbersome process for humans. here we devise such a transformation where we explicitly express the semantic information in the basis of the embedding space. in particular, we express the captured semantic information as finite sets of linguistic properties, which are called semantic categories. a semantic category can represent any arbitrary concept. in this paper, we define them according to wordnet @xcite lex-names (sometimes also referred as supersenses). even though we present our work on supersense prediction task, our proposed methodology can also be naturally extended to settings that exploit a different inventory of semantic categories. our results also provide insights into the inner workings of the original embedding space, since we infer the semantic information from embedding spaces in a transparent manner. therefore, amplified information can be assigned to the basis of the original embedding space. sparse representations convey the encoded semantic information in a more explicit manner, which facilitates the interpretability of such representations @xcite . feature norming studies also illustrated the sparse nature of human feature descriptions, i.e. humans tend to describe objects and concepts with only a handful of properties @xcite . hence, we also conduct experiments utilizing sparse representations obtained from dense contextualized embeddings. the transformation that we propose in this paper was inspired by @xcite , but it has been extended in various important aspects, as we • also utilize sparse representations to amplify semantic information, we also publish our source code on github: contextual word representations provide a solution for context-aware word vector generation. these deep neural language models -such as elmo (peters et al., 2018), bert (devlin et al., 2019) or gpt-3 (brown et al., 2020) -are pre-trained on unsupervised language modelling tasks, and later finetuned for downstream nlp tasks. several variants were proposed to address one or more issue corresponding to the bert model. some of which we exploited in this paper. liu et al. (2019) proposed a better pre-training process, sanh et al. (2019) reduced the number of parameters, conneau et al. another approach is to incorporate external knowledge into language models. @xcite devised sensebert by integrating supersense information into the training of bert. k m et al. @xcite showed a method where an arbitrary knowledge graph can be incorporated into their lstm based model. external knowledge incorporation is getting a popular approach to improve already existing state-of-the-art solutions in a domain or task specific environment @xcite @xcite @xcite . since we deemed to investigate the effect of incorporated knowledge towards the semantic content of embedding space, sensebert serves a good basis for that. @xcite investigated the importance of anisotropic property of the contextual embeddings, which is a different kind of investigation than we aim to do. it still gives a good insight into the inner workings of the layers. s ¸enel et al. (2018) showed a method where they measured the interpretability of glove embeddings, and later showed a method to manipulate and improve the interpretability of a given static word representation @xcite . our approach resembles @xcite , however, we apply different pre-and post-processing steps and more importantly, we replaced the usage of the bhattacharyya distance with the hellinger distance, which is closely related to it but operates in a bounded and continuous manner. our approach also differs from @xcite in that we deal with contextualited language models instead of static word embeddings and we also rely on sparse contextualized word vectors. the intuition behind sparse vectors is related to the way humans describe concepts, which has been extensively studied in various feature norming studies @xcite . additionally, generating sparse features @xcite @xcite has proved to be useful in several areas, including pos tagging @xcite ), text classification @xcite and dependency parsing @xcite . therefore, several sparse static representations were presented, such as @xcite proposed non-negative sparse embeddings to represent interpretable sparse word vectors. @xcite showed a rotation-based method and @xcite suggested an approach using a denoising k-sparse auto-encoder to generate sparse word vectors. @xcite showed that sparse representations can outperform their dense counterparts in certain nlp tasks, such as ner, or pos tagging. additionally, berend (2020) illustrated how applying sparse representations can boost the performance of contextual embeddings for word sense disambiguation, which we also desire to exploit. ## our approach we first define necessary notations. we denote the embedding space with @xmath0. we denote the number of input words and their dimensionality by v and d, respectively. furthermore, we denote the transformation matrix with @xmath1, which always denotes the interpretable representation of e (e) . additionally, we denote the semantic categories with s. ## conclusion in this paper, we demonstrated our approach to obtain interpretable representations from contextual representations, which represents semantic information in the basis with high coefficients. we demonstrated its capabilities by applying it on supersense prediction task. however, it can be utilized on other problems as well such as term expansion and knowledge base completion. we additionally explored the application of sparse representations, which successfully amplified the examined semantic information. we also considered the effect of incorporated prior knowledge in the form of applying sensebert embeddings, which showed that its additional objective during pre-training can amplify those features. furthermore, explored the space of condensed (distil-bert) and multilingual (xlm-roberta) spaces. we examined the improvements come by roberta from a semantic standpoint. note that our classification decision is currently made by simply finding the coordinate with the largest magnitude. in conclusion, our experiments showed that it is possible to extract and succinctly represent humaninterpretable information about words in transformed spaces with much lower dimensions than their original representations. additionally, it allows us to make decisions about word vectors in a more transparent manner, where some kind of explanation is already assigned to the basis of a representation, which can lead us to more transparent machine learning models.