Same Neurons, Different Languages: Probing Morphosyntax in Multilingual Pre-trained Models (2022)

Abstract: The success of multilingual pre-trained models is underpinned by their ability to learn representations shared by multiple languages even in absence of any explicit supervision. However, it remains unclear how these models learn to generalise across languages. In this work, we conjecture that multilingual pre-trained models can derive language-universal abstractions about grammar. In particular, we investigate whether morphosyntactic information is encoded in the same subset of neurons in different languages. We conduct the first large-scale empirical study over 43 languages and 14 morphosyntactic categories with a state-of-the-art neuron-level probe. Our findings show that the cross-lingual overlap between neurons is significant, but its extent may vary across categories and depends on language proximity and pre-training data size.

## introduction massively multilingual pre-trained models @xcite @xcite , inter alia) display an impressive ability to transfer knowledge between languages as well as to perform zero-shot learning @xcite @xcite . nevertheless, it remains unclear how pre-trained models actually manage to learn multilingual representations despite the lack of an explicit signal through parallel texts. hitherto, many have speculated that the overlap of sub-words between cognates in related languages plays a key role in the process of multilingual generalisation @xcite @xcite @xcite . in this work, we offer a concurrent hypothesis to explain the multilingual abilities of various pretrained models; namely, that they implicitly align morphosyntactic markers that fulfil a similar grammatical function across languages, even in absence of any lexical overlap. more concretely, we conjecture that they employ the same subset of neurons to encode the same morphosyntactic information (such as gender for nouns and mood for verbs). 1 to test the aforementioned hypothesis, we employ @xcite latent variable probe to identify the relevant subset of neurons in each language and then measure their cross-lingual overlap. we experiment with two multilingual pre-trained models, m-bert @xcite and xlm-r @xcite , probing them for morphosyntactic information in 43 languages from universal dependencies @xcite . based on our results, we argue that pre-trained models do indeed develop a cross-lingually entangled representation of morphosyntax. we further note that, as the number of values of a morphosyntactic category increases, cross-lingual alignment decreases. finally, we find that language pairs with high proximity (in the same genus or with similar typological features) and with vast amounts of pre-training data tend to exhibit more overlap between neurons. identical factors are known to affect also the empirical performance of zero-shot cross-lingual transfer @xcite , which suggests a connection between neuron overlap and transfer abilities. ## intrinsic probing intrinsic probing aims to determine exactly which dimensions in a representation, e.g., those given by m-bert, encode a particular linguistic property @xcite . formally, let π be the inventory of values that some morphosyntactic category can take in a particular language, for example π = {fem, msc, neu} for grammatical gender in russian. moreover, let in this paper, we make use of a latent-variable model recently proposed by @xcite for intrinsic probing. the idea is to train a probe with latent variable c indexing the subset of the dimensions d of the representation h that should be used to predict the property π: in practice, this combinatorial optimisation problem is intractable. hence, we solve it using greedy search. ## experimental setup we now describe the experimental methodology of the paper, including the data, training procedure and statistical testing. data. we select 43 treebanks from universal dependencies 2.1 (ud; @xcite , which contain sentences annotated with morphosyntactic information in a wide array of languages. afterwards, we compute contextual representations for every individual word in the treebanks using multilingual bert (m-bert-base) and the base and large versions of xlm-roberta (xlm-rbase and xlm-r-large). we then associate each word with its parts of speech and morphosyntactic features, which are mapped to the unimorph schema @xcite . 4 the selected treebanks include all languages supported by both m-bert and xlm-r which are available in ud. rather than adopting the default ud splits, we re-split word representations based on lemmata ending up with disjoint vocabularies for the train, development, and test set. this prevents a probe from achieving high performance by sheer memorising. moreover, for every category-language pair statistically significant overlap after holm-bonferroni family-wise error correction @xcite , with α = 0.05, is marked with an orange square. training. we first train a probe for each morphosyntactic category-language combination with the objective in eq. ( 2 ). in line with established practices in probing, we parameterise p θ (•) as a linear layer followed by a softmax. afterwards, we identify the top-k most informative neurons in the last layer of m-bert, xlm-r-base, and xlm-rlarge. specifically, following torroba hennigen et al. (2020), we use the log-likelihood of the probe on the test set as our greedy selection criterion. we single out 50 dimensions for each combination of morphosyntactic category and language. foot_4 next, we measure the pairwise overlap in the top-k most informative dimensions between all pairs of languages where a morphosyntactic cat-egory is expressed. this results in matrices such as fig. 2 , where the pair-wise percentages of overlapping dimensions are visualised as a heat map. statistical significance. suppose that two languages have @xmath0, . . . , k} overlapping neurons when considering the top-k selected neurons for each of them. to determine whether such overlap is statistically significant, we compute the probability of an overlap of at least m neurons under the null hypothesis that the sets of neurons are sampled independently at random. we estimate these probabilities with a permutation test. in this paper, we set a threshold of α = 0.05 for significance. family-wise error correction. finally, we use holm-bonferroni @xcite family-wise error correction. hence, our threshold is appropriately adjusted for multiple comparisons, which makes incorrectly rejecting the null hypothesis less likely. in particular, the individual permutation tests are ordered in ascending order of their p-values. the test with the smallest probability undergoes the holm-bonferroni correction @xcite . if already the first test is not significant, the procedure stops; otherwise, the test with the second smallest p-value is corrected for a family of t -1 tests, where t denotes the number of conducted tests. the procedure stops either at the first non-significant test or after iterating through all p-values. this sequential approach guarantees that the probability that we incorrectly reject one or more of the hypotheses is at most α. ## results we first consider whether multilingual pre-trained models develop a cross-lingually entangled notion of morphosyntax: for this purpose, we measure the overlap between subsets of neurons encoding similar morphosyntactic categories across languages. further, we debate whether the observed patterns are dependent on various factors, such as morphosyntactic category, language proximity, pretrained model, and pre-training data size. neuron overlap. the matrices of pairwise overlaps for each of the 14 categories, such as fig. 2 for number and case, are reported in app. b. we expand upon these results in two ways. first, we report the cross-lingual distribution for each category in fig. 1 for m-bert and xlm-r-base, and in an equivalent plot comparing xlm-r-base and xlm-r-large in fig. 3 . second, we calculate how many overlaps are statistically significant out of the total number of pairwise comparisons in tab. 1. from the above results, it emerges that ≈ 20% of neurons among the top-50 most informative ones overlap on average, but this number may vary dramatically across categories. ## conclusions in this paper, we hypothesise that the ability of multilingual models to generalise across languages results from cross-lingually entangled representations, where the same subsets of neurons encode universal morphosyntactic information. we validate this claim with a large-scale empirical study on 43 languages and 3 models, m-bert, xlm-r-base, and xlm-r-large. we conclude that the overlap is statistically significant for a notable amount of language pairs for the considered attributes. however, the extent of the overlap varies across morphosyntactic categories and tends to be lower for categories with large inventories of possible values. moreover, we find that neuron subsets are shared mostly between languages in the same genus or with similar typological features. finally, we discover that the overlap of each language grows proportionally to its pre-training data size, but it also decreases in larger model architectures.