Universal and Independent: Multilingual Probing Framework for Exhaustive Model Interpretation and Evaluation (2022)

Abstract: Linguistic analysis of language models is one of the ways to explain and describe their reasoning, weaknesses, and limitations. In the probing part of the model interpretability research, studies concern individual languages as well as individual linguistic structures. The question arises: are the detected regularities linguistically coherent, or on the contrary, do they dissonate at the typological scale? Moreover, the majority of studies address the inherent set of languages and linguistic structures, leaving the actual typological diversity knowledge out of scope. In this paper, we present and apply the GUI-assisted framework allowing us to easily probe massive amounts of languages for all the morphosyntactic features present in the Universal Dependencies data. We show that reflecting the anglo-centric trend in NLP over the past years, most of the regularities revealed in the mBERT model are typical for the western-European languages. Our framework can be integrated with the existing probing toolboxes, model cards, and leaderboards, allowing practitioners to use and share their familiar probing methods to interpret multilingual models. Thus we propose a toolkit to systematize the multilingual flaws in multilingual models, providing a reproducible experimental setup for 104 languages and 80 morphosyntactic features.

## introduction probing methods shed light on the black box of the neural models in unearthing the linguistic features encoded in them. probing sets a standard setup with various internal representations from the model and uses an auxiliary classifier to predict linguistic information captured in the representation. as probing research results have come up with contradictory results on different languages and language models, there appears to be a methodological need for a meta-study of the accumulated knowledge and a need to standardize the experimental setup. at the same time, the fixation of the setup and hyperparameters should allow the reproduction of a wide range of experiments, such as multilingual probing, like x-probe @xcite and @xcite , layer-wise probing @xcite , chronological probing @xcite . often, data for probing experiments is based on already known competition data, benchmarks, and gold standards. to obtain consistent results, such data must be high-quality, manually validated, and carefully include multiple languages. for this reason, in this work, we use the universal dependencies data @xcite as a source of multilingual data with a validated and standardized complete morphological and syntactic annotation, which will allow us to accumulate the assimilation of specific linguistic phenomena in many languages at once. probing these languages on the respective annotated linguistic categories would reveal how models seize the typological proximity of languages. therefore, the general probing methodology should include (according to @xcite ) 1) a fixed set of evaluations based on what appears to be community consensus; 2) a fixed evaluation pipeline with standard hyperparameters; 3) a straightforward python interface. this paper aims to extrapolate the multilingual linguistic diversity on the proven and tested senteval-like methodology. we state our contribution as follows: performing probing studies on such a large scale addresses the vision outlined in @xcite and contribute to a new dimension to linguistic typology research, as the revealed structures are encapsulated in tools and data inseparably tied to nowadays linguistic nature. our framework provides users from different fields, including linguists, with a new point of view on the typological proximity of languages and categories. ## related work different attempts were made to interpret behavior and hidden learned representation of language models. for example, @xcite investigated the attention-heads of the bert model on word tokens connectivity level. @xcite presented an interpretation framework where they improved a visual component of the model prediction process on several nlp tasks for the end-user. flourishing after the acl debates on semantic parsing foot_0 , the probing methodology has developed its own model interpretation tools. thus, senteval framework @xcite includes various types of linguistically-motivated tasks: surface tasks probe for sentence length (sentlen) and for the presence of words in the sentence (wc); syntactic tasks test for sensitivity to word order (bshift), the depth of the syntactic tree (treedepth) and the sequence of top-level constituents in the syntax tree (topconst); semantic tasks check for the tense (tense), the subject (resp. direct object) number in the main clause (subjnum, resp. ob-jnum), the sensitivity to random replacement of a noun/verb (somo) and the random swapping of coordinated clausal conjuncts (coordinv). linspector @xcite includes 15 probing tasks for 24 languages by taking morphosyntactic language properties into account, including case, verb mood, and tense, syntactic correctness, and the semantic impossibility of an example. while lacking the simplicity of the senteval approach, the framework provides both a linguistically-grounded and multilingual setup. we are significantly expanding both the list of languages and properties being examined. probe-x (ravishankar et al., 2019b) has expanded senteval setup with 5 additional languages, while neurox framework @xcite also introduced novelty, but proposed to enrich the methodology to allow for cross-model analysis of the results, supporting neuron-level inspection. ## framework design this section describes the probing framework and the experimental setup part. the main goal is to probe how well a model assimilates language constructions during training. for the framework, we want to form an end-to-end solution that can be applied to different models, work on diverse data, and simplify the process of getting insights from the results. based on that, the challenges we have are the following: thus, we can represent our framework as a tool with different instruments. the first one is aimed at pre-processing data for probing, which is commonly a classification task. the second one is a probing engine supporting popular probing techniques such as diagnostic classification. and the last one is a visualization instrument which should ease the process of interpreting the findings. ## evaluation setup to present the whole procedure of our probing framework working process, we decided to run the experiments only for two multilingual transformer encoder-based models: the 12-layer mbert model @xcite foot_4 and the 24-layer xlm-roberta model @xcite foot_5 . we used embeddings from "[cls]" token for each text sample as it is widely accepted. as the classifier, while supporting logreg and mlp, we choose logistic regression due to its higher selectivity @xcite . the classifier was trained on 10 epochs using cross-entropy loss and adamw @xcite optimizer. a separate classifier was trained for each feature of all languages and each layer. to eliminate the problem of different sizes of the datasets, we run the classifier five times and then take an average result to avoid the classifier bias. the results were evaluated by f 1 weighted score because of the unbalanced data for most probing tasks. from universal dependencies, using our senteval converter, we obtained 1927 probing tasks for 104 languages. during the training, we noticed that some samples contain long sentences with token numbers of more than 512. we propose two options for handling it correctly: truncate sentences to 512 tokens or dispose of all of these sentences. ## future work as part of future work, we plan to include syntactic markup in research and an interface with a cqllike foot_6 query language for authors. the ability to set conditions on a subcorpus of examples will give the researchers the freedom to create custom and linguistically motivated probing tasks while the rest of the experiment parameters will be fixed. one can imagine, e.g., the probing of the model on the [@xmath0, exploring the results specifically on the noun phrases. we believe that, in this respect, the tasks of probing and interpreting the results of the model become close to the tasks of corpus linguistics and searching through corpora for statistical testing of hypotheses. ## conclusion the typological variety of linguistic features composes the general nature of language. to address the lower-abstract parts of this nature, we introduced the universal probing framework, which allows the researchers to run and aggregate massive amounts of probing experiments in a fixed and reproducible setup. the current framework version includes an experimental setup from 104 languages and 80 grammatical features. the framework can be used for language model interpretation with various architectures, and the results can also be easily incorporated into the model cards checklist. it can be used in more language-wise transfer learning and typological studies with multilingual models. we hope that the community will use our work in order to interpret, evaluate and compare the language models, leading to better and more explainable nlp. the framework and all the data are open-source under apache 2.0 license https://github.com/airi-institute/ probing_framework .