Unveiling Linguistic Regions in Large Language Models (2024)

Abstract: Large Language Models (LLMs) have demonstrated considerable cross-lingual alignment and generalization ability. Current research primarily focuses on improving LLMs’ cross-lingual generalization capabilities. However, there is still a lack of research on the intrinsic mechanisms of how LLMs achieve cross-lingual alignment. From the perspective of region partitioning, this paper conducts several investigations on the linguistic competence of LLMs. We discover a core region in LLMs that corresponds to linguistic competence, accounting for approximately 1% of the total model parameters. Removing this core region by setting parameters to zero results in a significant performance decrease across 30 different languages. Furthermore, this core region exhibits significant dimensional dependence, perturbations to even a single parameter on specific dimensions leading to a loss of linguistic competence. Moreover, we discover that distinct monolingual regions exist for different languages, and disruption to these specific regions substantially reduces the LLMs’ proficiency in those corresponding languages. Our research also indicates that freezing the core linguistic region during further pre-training can mitigate the issue of catastrophic forgetting (CF), a common phenomenon observed during further pre-training of LLMs. Overall, exploring the LLMs’ functional regions provides insights into the foundation of their intelligence.

## introduction over the years, the field of natural language processing (nlp) has been at the forefront of understanding the core principles of intelligence. the emergence of large language models (llms) such as @xcite , palm 2 (anil et al., 2023) and llama 2 @xcite , showcase a significant breakthrough. thanks to unparalleled scales of model architecture and the vastness of training data, these llms now exhibit exceptional linguistic competence and can execute complex tasks requiring abstract knowledge @xcite and reasoning @xcite . previous research has revealed that llms naturally capture cross-linguistic similarities in their representation space, facilitating zero-shot crosslingual transfer @xcite @xcite . the model is fine-tuned on one language, enabling the acquisition of comparable capabilities in another language @xcite , and exhibits the phenomenon of code-switching when generating context @xcite . attempts to improve llms' cross-lingual generalization abilities have been successful through parameter and information transfer learning @xcite , aligning languages compulsorily @xcite and utilizing in-context learning techniques @xcite . however, a detailed investigation into the internal mechanisms of how llms possess crosslinguistic alignment capability remains elusive. to delve deeper into the intrinsic mechanisms of llms' linguistic competence, this paper focuses on the llms' parameter importance and investigate the linguistic regions of llms based on 30 distinct languages' performance, with the purpose of figuring out the following questions: q1: does a core linguistic region exist within llms that facilitates cross-lingual alignment and generalization? by conducting further pretraining across six languages and evaluating models' parameter importance (section 2.2), we discover a region in llms corresponding to the core linguistic competence, which accounts for approximately 1% of the model's total parameters. as shown at the top of figure 1 , removing this region (setting parameters to zero) consistently leads to a significant decline in performance across 30 test languages (section 3.2). furthermore, by visualizing the core linguistic region (figure 2 ), we observe that the linguistic core region of llms exhibits significant dimensional dependence. in certain dimensions, only perturbing a single parameter could lead to the model losing its linguistic competence (section 3.3). additionally, ablation study in 3.3 shows that beyond outlier dimensions, other non-outlier dimensions in this region are also critical. q2: beyond the core linguistic region within llms , do distinct monolingual regions exist that specifically influence individual languages? while llms possess strong multilingual capabilities, we discover that each individual language (or language with similar compositional elements or grammatical structures) encompasses independent regions within the llms. as shown in the middle of figure 1 , the analysis of the russian sentences identifies a particular linguistic region that likewise exerts influence both on the russian and ukrainian language, both of which belong to the slavic group (section 3.4). q3: if and how core linguistic regions affect further pre-training, how to utilize it to optimize further pre-training? after pre-training, core linguistic parameter regions of the llms are established for multilingual alignment. notable shifts in these regions potentially lead to a decline in model lingual capabilities. our findings reveal that freezing this core region can mitigate the issue of catastrophic forgetting @xcite , a common phenomenon observed during further pre-training of llms. as shown at the bottom of figure 1 , we investigate the impact of selectively freezing 5% key parameters of all parameters during further pre-training, compared to the full-scale fine-tuning technique. findings indicate that this method facilitates comparable learning of the target language while concurrently decelerating the rate of language attrition for previously learned languages (section 3.5). significantly, our methodology is compatible with the data-replay techniques @xcite , with no necessity for integrating extra components into the model. unlike regularization methods @xcite , our approach restricts to a minimal core region in llms. the main contributions of our work are summarized as follows: ## experiments 3.1 experimental setup to localize the functional regions corresponding to linguistic competence within llms and analyze their nature, we perform language further pre-training (next token prediction) on various languages and observe the relationship between internal parameter removal and external output quality. we utilize llama-2-7b/13b @xcite as our model instance, as it stands out as one of the most notable state-of-the-art open-source llms in current academia. our experimental dataset comprises materials from chinese platforms like zhihu and wechat, english sources from arxiv and falcon, and a corpus including books from 28 languages, totaling 30 languages in all. six languages, namely arabic, spanish, russian, chinese, korean, and vietnamese, are chosen for language further pre-training and region localization, with 100, 000 samples for each (distinct from the samples in the test set). all 30 languages are employed for model testing and functional region analysis, with the specific languages and token count detailed in a. we use perplexity (ppl) as the criterion for evaluating the linguistic competence of a language model. ## related work intrinsic regions prior works aimed to extract a sub-network capable of executing specific downstream tasks @xcite or task-specific subspaces to limit parameter fine-tuning within it @xcite . for parameter importance estimation, an effective metric is to use parameter magnitude @xcite @xcite . another metric involves estimating the sensitivity of parameters @xcite @xcite . in this work, we employ the latter method to select the most crucial parameters to unveil linguistic regions. unlike @xcite , which extracted a complete sub-network for downstream tasks, as exemplified by the optimal scale of the lottery network at 21.2%, our findings indicate that the linguistic region is a much smaller (1%) functional region. cross-lingual transfer multilingual language models exhibit significant zero-shot and few-shot cross-lingual transferability across diverse tasks @xcite . fine-tuned on one language enables model to obtain comparable capabilities in another language @xcite , often displaying codeswitching behavior in context generation (khanuja et al. @xcite . while enhancements in cross-lingual generalization through parameter and information transfer learning @xcite , compulsory language alignment @xcite and in-context learning techniques @xcite have been effective, a comprehensive understanding of the internal mechanisms enabling cross-linguistic alignment in llms is still lacking. ## conclusion this paper explores the pivotal role of certain parameters in large language models (llms), identifying a core region essential for multilingual alignment and generalization. removing this region causes a complete loss of linguistic competence in llms. furthermore, we discover that this core region is concentrated in specific dimensions, perturbing only one dimension can cause a significant decrease in linguistic ability. moreover, beyond the core linguistic regions, we observe that monolingual regions exist within llms that affect specific languages. importantly, we note that the catastrophic forgetting phenomenon during further pretraining may be related to drastic changes in core linguistic regions, as freezing this part during further pre-training alleviates the issue substantially. our analysis and findings provide new perspectives and explanations for llms' linguistic competence.