Language-Specific Neurons: The Key to Multilingual Capabilities in Large Language Models (2024)

Abstract: Large language models (LLMs) demonstrate remarkable multilingual capabilities without being pre-trained on specially curated multilingual parallel corpora.It remains a challenging problem to explain the underlying mechanisms by which LLMs process multilingual texts.In this paper, we delve into the composition of Transformer architectures in LLMs to pinpoint language-specific regions.Specially, we propose a novel detection method, language activation probability entropy (LAPE), to identify language-specific neurons within LLMs.Based on LAPE, we conduct comprehensive experiments on several representative LLMs, such as LLaMA-2, BLOOM, and Mistral. Our findings indicate that LLMs’ proficiency in processing a particular language is predominantly due to a small subset of neurons, primarily situated in the models’ top and bottom layers.Furthermore, we showcase the feasibility to “steer” the output language of LLMs by selectively activating or deactivating language-specific neurons. Our research provides important evidence to the understanding and exploration of the multilingual capabilities of LLMs.

## introduction the brain has its own language for testing the structure and consistency of the world. ## experiments in this section, we present empirical evaluation to substantiate the efficacy of our proposed lape method and elucidate the impact of languagespecific neurons on multilingual capacities. ## related work multilingual ability. multilingual ability has been widely studied since the emergence of pretrained language models @xcite . recently, llms @xcite showcase more excellent multilingual capabilities even without explicit language alignment @xcite . extensive research has been made to investigate the factors that influence models' multilingual ability @xcite . for example, linguistic similarity has been examined @xcite @xcite , which is generally believed to correlate with models' cross-lingual ability. specially, "word order" shows some contradictions about whether it really affects multilingual ability @xcite . not only limited to language property, training settings have also been considered @xcite . existing work has explored language-agnostic (or language-shared) components within multilingual models. for example, researchers concentrate on shared knowledge across various languages @xcite @xcite . however, the exploration of language-specific components within llms remains an under-investigated area. neuron analysis. neuron analysis has gained significant attention in recent years, paralleling research in neurobiological studies of the human brain @xcite . originating from vision models @xcite , neuron analysis views neuron activation as the recall of learned knowledge @xcite . researchers widely adopt these methods to analyze the sources of specific abilities or skills in language models, including sentiment analysis @xcite , knowledge storage @xcite , and task-solving @xcite . recent studies have also discovered that certain neurons can convey specialized contexts @xcite , such as positional information @xcite and linguistic properties @xcite @xcite . moreover, @xcite utilize pearson correlation to calculate neuron similarity, identifying some universal neurons across models. in contrast to previous research, we have developed a method applicable to llms that unveils the mechanism of their multilingual abilities. this approach offers a more practical and effective solution for neuron analysis in multilingual scenarios. ## conclusion despite the impressive multilingual capabilities demonstrated by llms, the understanding of how these abilities develop and function remains nascent. in this paper, we introduced a novel detection method, i.e., language activation probability entropy (lape), to pinpoint language-specific neurons within llms. lape assesses the response of individual neurons to various languages, selecting those with a propensity for activation when exposed to one or two languages. based on lape, we further conducted extensive experiments to investigate the multilingual capabilities of llms. specially, we have found that an llm's proficiency in processing different languages is significantly influenced by a small subset of neurons, which are mainly located in the model's top and bottom layers. we have further demonstrated that the output language of llms can be directed by selectively enabling or disabling these language-specific neurons. for future work, we aim to leverage these findings to enhance knowledge transfer between major and minor languages and devise efficient strategies for continual pre-training to better accommodate specific languages.