On the Multilingual Ability of Decoder-based Pre-trained Language Models: Finding and Controlling Language-Specific Neurons (2024)

Abstract: Current decoder-based pre-trained language models (PLMs) successfully demonstrate multilingual capabilities. However, it is unclear how these models handle multilingualism.We analyze the neuron-level internal behavior of multilingual decoder-based PLMs, Specifically examining the existence of neurons that fire “uniquely for each language” within decoder-only multilingual PLMs.We analyze six languages: English, German, French, Spanish, Chinese, and Japanese, and show that language-specific neurons are unique, with a slight overlap (< 5%) between languages. These neurons are mainly distributed in the models’ first and last few layers. This trend remains consistent across languages and models.Additionally, we tamper with less than 1% of the total neurons in each model during inference and demonstrate that tampering with a few language-specific neurons drastically changes the probability of target language occurrence in text generation.

## introduction recent studies have frequently demonstrated the excellent multilingual abilities of pre-trained language models (plms). some plms explicitly mix multilingual language corpus for pre-training @xcite , whereas others mainly use an english-dominant text corpus, with the unintentional inclusion of a low percentage of multiple language texts, which results in the acquisition of multilingual skills, such as llama2 @xcite . how do they exhibit multilingual abilities? prior studies have focused on language-universal neurons activated across multilingual inputs, mainly focusing on encoder-based plms @xcite @xcite @xcite figure 1 : overview of our proposal. (left) finding language-specific neurons that tend to be activated for a target language. (right) controlling the detected language-specific neurons by forcing their activation during inference to manipulate the probability of target language occurrence. @xcite . in contrast to encoder-based models, which might be sufficient to abstract inputs, decoder-based plms need to recover the languagespecific information in the later part of the generation. therefore, language-specific processing within these models should be a more complex and essential functionality compared to the encoderbased ones. however, few studies have focused on the existence and activity of language-specific neurons in decoder-based plms (see section 2). this study examines the behavior of languagespecific neurons in decoder-based plms. specifically, we analyze multiple decoder-based plms, including xglm (564m, 1.7b, 2.9b), bloom (560m, 1.7b, 3b), and llama2 (7b, 15b), for six languages (english, german, french, spanish, chinese, and japanese). to investigate languagespecific neurons, we adopt an approach proposed by @xcite , which finds neurons that activate on a certain group of sentences (positive sentences) but do not activate on other groups (negative sentences). we treat the target language texts as positive and any other language as negative, iden-tifying language-specific neurons that statistically activate positive sentences (see section 3). the experimental results demonstrate that the identified language-specific neurons are mainly distributed in the first and last few layers of the model. this trend remains consistent across multiple languages and model variants. to verify the effect of the neurons, we intervene in language-specific neurons in the model during inference, showing that they can drastically change the probability of the target language occurrence during text generation (see section 4). ## related work previous studies analyzed the internal behavior of plms for multilingual tasks by observing the activation of their neurons. several studies have found that language-universal neurons are activated across multilingual inputs in encoder-based plms (mainly m-bert, see @xcite ) for various task settings, including syntactic or factual knowledge tasks @xcite @xcite @xcite . however, studies of encoder-based plms have not focused on the identification of language-specific neurons. @xcite ; @xcite studied decoder-based language models to find the multilingually shared neurons. similar to the encoderbased plms, limited research has focused on the existence and activity of language-specific neurons in decoder-based language models. various methods can be used to identify and control neurons @xcite . several studies have identified and intervened in neurons for effective word editing or classification @xcite @xcite @xcite . in contrast, few studies have investigated the identification and intervention of neurons for full-text generation for a desired concept, for example, @xcite for lstm models and cuadros et al. (2022) for pretrained transformer models. @xcite have proposed an approach for controlling text generation on transformer-based decoder models, and proven its effectiveness. therefore, we use it as an analytical tool in our experiments with decoderbased plms. ## method we identified and controlled neurons specific to each language based on the approach of cuadros et al. (2022), with appropriate modifications for our experiments. this approach was originally developed to identify and control neurons that respond to specific word-level concepts, such as homographs or gender biases. however, we aimed to find neurons that grasp broader sentence-level and language-specific concepts; therefore, we modified the original approach for our purpose. ## results and discussion the experimental results are summarized in this section. ## conclusion this study provides new insights into the activity of language-specific neurons in decoder-based multilingual pre-trained language models: the existence of neurons that fire uniquely for each language. the experimental results demonstrate that language-specific neurons mainly exist in the first and last few layers, regardless of the language, model size, and model variants. we further analyzed the effectiveness of the identified neurons by intervening in the neurons, that is, by replacing the output values with fixed activation values at inference with both unconditional and conditional settings. using this approach, we can change the probability of the target language occurrence. we hope that this study facilitates a deeper understanding of decoder-based plms and provides new insights for future research on multilingual decoderbased plms. future research should include proposing language-specific model-compression methods. future research also includes proposing new fine-tuning methods for downstream tasks to facilitate generalization to languages that are not included in the training dataset. for example, only fine-tuning the middle-layer parameters in decoderbased plms.