Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
72 tokens/sec
GPT-4o
61 tokens/sec
Gemini 2.5 Pro Pro
44 tokens/sec
o3 Pro
8 tokens/sec
GPT-4.1 Pro
50 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

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

Published 26 Feb 2024 in cs.CL

Abstract: 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.

The paper "Language-Specific Neurons: The Key to Multilingual Capabilities in LLMs" (Tang et al., 26 Feb 2024 ) addresses the challenge of understanding how LLMs process multilingual texts without explicit multilingual parallel corpora pre-training. The research introduces a methodology to identify language-specific neurons within Transformer architectures, offering insights into the compositional mechanisms that underpin multilingual capabilities.

LAPE Methodology for Identifying Language-Specific Neurons

The cornerstone of the paper is the Language Activation Probability Entropy (LAPE) method. This technique is designed to pinpoint neurons that exhibit a strong preference for activation by specific languages. The LAPE calculation involves feeding multilingual corpora into the LLM and observing the activation probabilities of individual neurons. For each neuron, the LAPE score is computed to quantify its language activation reaction. A low LAPE score indicates that a neuron is language-specific, exhibiting a pronounced preference for activation in response to one or a small set of languages. Mathematically, the LAPE score can be expressed as:

LAPEi=l=1LP(ai,l)log(P(ai,l))LAPE_i = - \sum_{l=1}^{L} P(a_{i,l}) log(P(a_{i,l}))

Where LAPEiLAPE_i represents the LAPE score for the ii-th neuron, LL is the total number of languages, and P(ai,l)P(a_{i,l}) is the activation probability of the ii-th neuron in response to the ll-th language. Neurons demonstrating minimal entropy in their activation probabilities across languages are flagged as language-specific.

Experimental Design and Evaluation Metrics

The paper employed LLaMA-2 (7B, 13B, and 70B) and BLOOM (7.1B) to evaluate the impact of language-specific neurons on multilingual capabilities. The evaluation encompassed two primary tasks: LLMing and open-ended generation. LLMing performance was assessed using perplexity (PPL) scores on Wikipedia corpora. The open-ended generation task utilized a translated version of the Vicuna dataset, with GPT-4 serving as the judge to evaluate the quality of the generated text. Ablation studies were conducted, involving the deactivation of identified language-specific neurons, and the resulting performance degradation was measured. Alternative identification methods, including Language Activation Value Entropy (LAVE), Parameter Variation (PV) based on monolingual instruction tuning, and Random Selection (RS), were used for comparison.

Key Findings: Location and Impact of Language-Specific Neurons

The experimental results indicated that a small proportion of neurons exert a disproportionately large influence on an LLM's ability to process a specific language. Deactivating these neurons resulted in a significant decline in both understanding and generation capabilities for the targeted language. The analysis revealed that language-specific neurons are predominantly located in the bottom and top layers of LLMs. The bottom layers are responsible for processing inputs from different languages into a unified semantic space, while the top layers project the semantic content into the corresponding vocabulary of each language. Specifically, the impact of deactivating language-specific neurons was quantified through perplexity increases and GPT-4 based quality scores, demonstrating a tangible reduction in language processing proficiency.

Steering LLM Outputs Through Neuron Manipulation

The paper demonstrated the potential for controlling the output language of LLMs by selectively activating or deactivating language-specific neurons. This was achieved by manually activating language-specific neurons, increasing their activation value to the average for that language, which increased the likelihood that the model would respond in the language of the prompt. Additionally, cross-lingual generation was achieved by deactivating neurons associated with the source language and activating neurons associated with the target language, resulting in responses generated in the desired target language, even when prompted in a different language.

Language Dominance and Resource Allocation

The analysis uncovered a dominance relationship between high-resource languages (e.g., English in LLaMA-2) and low-resource languages. This suggests that low-resource languages are aligned with high-resource languages within the model's representation space, which has implications for transfer learning and cross-lingual adaptation strategies. This dominance was observed through the degree of overlap in language-specific neuron activation patterns, with high-resource languages exhibiting more distinct and robust activation profiles.

In summary, the paper provides a detailed examination of language-specific neurons in LLMs, offering insights into their location, impact, and potential for manipulating multilingual outputs. The LAPE method and the experimental findings contribute to a deeper understanding of how LLMs achieve multilingual capabilities.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (52)
  1. Gpt-4 technical report. arXiv preprint arXiv:2303.08774.
  2. Multi task learning for zero shot performance prediction of multilingual models. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 5454–5467, Dublin, Ireland. Association for Computational Linguistics.
  3. Palm 2 technical report. arXiv preprint arXiv:2305.10403.
  4. Identifying and controlling important neurons in neural machine translation. arXiv preprint arXiv:1811.01157.
  5. Understanding the role of individual units in a deep neural network. Proceedings of the National Academy of Sciences, 117(48):30071–30078.
  6. Language models can explain neurons in language models. URL https://openaipublic. blob. core. windows. net/neuron-explainer/paper/index. html.(Date accessed: 14.05. 2023).
  7. Towards monosemanticity: Decomposing language models with dictionary learning. Transformer Circuits Thread. Https://transformer-circuits.pub/2023/monosemantic-features/index.html.
  8. Multilingual alignment of contextual word representations. arXiv preprint arXiv:2002.03518.
  9. Journey to the center of the knowledge neurons: Discoveries of language-independent knowledge neurons and degenerate knowledge neurons. arXiv preprint arXiv:2308.13198.
  10. MultilingualSIFT: Multilingual Supervised Instruction Fine-tuning.
  11. Vicuna: An open-source chatbot impressing gpt-4 with 90%* chatgpt quality.
  12. Unsupervised cross-lingual representation learning at scale. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 8440–8451, Online. Association for Computational Linguistics.
  13. Emerging cross-lingual structure in pretrained language models. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 6022–6034, Online. Association for Computational Linguistics.
  14. Knowledge neurons in pretrained transformers. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 8493–8502, Dublin, Ireland. Association for Computational Linguistics.
  15. What is one grain of sand in the desert? analyzing individual neurons in deep nlp models. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 6309–6317.
  16. Analyzing redundancy in pretrained transformer models. arXiv preprint arXiv:2004.04010.
  17. When is BERT multilingual? isolating crucial ingredients for cross-lingual transfer. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 3610–3623, Seattle, United States. Association for Computational Linguistics.
  18. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171–4186, Minneapolis, Minnesota. Association for Computational Linguistics.
  19. Philipp Dufter and Hinrich Schütze. 2020. Identifying elements essential for BERT’s multilinguality. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4423–4437, Online. Association for Computational Linguistics.
  20. Angela D Friederici. 2011. The brain basis of language processing: from structure to function. Physiological reviews, 91(4):1357–1392.
  21. Improved zero-shot neural machine translation via ignoring spurious correlations. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 1258–1268, Florence, Italy. Association for Computational Linguistics.
  22. Universal neurons in gpt2 language models. arXiv preprint arXiv:2401.12181.
  23. Finding neurons in a haystack: Case studies with sparse probing. arXiv preprint arXiv:2305.01610.
  24. Dan Hendrycks and Kevin Gimpel. 2016. Gaussian error linear units (gelus). arXiv preprint arXiv:1606.08415.
  25. Single-neuronal elements of speech production in humans. Nature, pages 1–8.
  26. Cross-lingual alignment methods for multilingual bert: A comparative study. arXiv preprint arXiv:2009.14304.
  27. From zero to hero: On the limitations of zero-shot language transfer with multilingual Transformers. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 4483–4499, Online. Association for Computational Linguistics.
  28. Jesse Mu and Jacob Andreas. 2020. Compositional explanations of neurons. Advances in Neural Information Processing Systems, 33:17153–17163.
  29. Vinod Nair and Geoffrey E. Hinton. 2010. Rectified linear units improve restricted boltzmann machines. In Proceedings of the 27th International Conference on International Conference on Machine Learning, ICML’10, page 807–814, Madison, WI, USA. Omnipress.
  30. Seallms–large language models for southeast asia. arXiv preprint arXiv:2312.00738.
  31. Active inference: the free energy principle in mind, brain, and behavior. MIT Press.
  32. Towards a common understanding of contributing factors for cross-lingual transfer in multilingual language models: A review. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 5877–5891, Toronto, Canada. Association for Computational Linguistics.
  33. How multilingual is multilingual BERT? In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 4996–5001, Florence, Italy. Association for Computational Linguistics.
  34. Learning to generate reviews and discovering sentiment. arXiv preprint arXiv:1704.01444.
  35. Neuron-level interpretation of deep NLP models: A survey. Transactions of the Association for Computational Linguistics, 10:1285–1303.
  36. Bloom: A 176b-parameter open-access multilingual language model. arXiv preprint arXiv:2211.05100.
  37. Mitigating hallucinations and off-target machine translation with source-contrastive and language-contrastive decoding. arXiv preprint arXiv:2309.07098.
  38. Noam Shazeer. 2020. Glu variants improve transformer. arXiv preprint arXiv:2002.05202.
  39. Same neurons, different languages: Probing morphosyntax in multilingual pre-trained models. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 1589–1598, Seattle, United States. Association for Computational Linguistics.
  40. Stanford alpaca: An instruction-following llama model. https://github.com/tatsu-lab/stanford_alpaca.
  41. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971.
  42. Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288.
  43. Attention is all you need. In Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc.
  44. Neurons in large language models: Dead, n-gram, positional. arXiv preprint arXiv:2309.04827.
  45. Finding skill neurons in pre-trained transformer-based language models. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 11132–11152, Abu Dhabi, United Arab Emirates. Association for Computational Linguistics.
  46. Cross-lingual ability of multilingual bert: An empirical study. arXiv preprint arXiv:1912.07840.
  47. What part of the neural network does this? understanding lstms by measuring and dissecting neurons. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 5823–5830.
  48. Language representation projection: Can we transfer factual knowledge across languages in multilingual language models? In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 3692–3702, Singapore. Association for Computational Linguistics.
  49. mT5: A massively multilingual pre-trained text-to-text transformer. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 483–498, Online. Association for Computational Linguistics.
  50. Unveiling a core linguistic region in large language models. arXiv preprint arXiv:2310.14928.
  51. A survey of large language models. arXiv preprint arXiv:2303.18223.
  52. Judging llm-as-a-judge with mt-bench and chatbot arena. arXiv preprint arXiv:2306.05685.
User Edit Pencil Streamline Icon: https://streamlinehq.com
Authors (8)
  1. Tianyi Tang (30 papers)
  2. Wenyang Luo (6 papers)
  3. Haoyang Huang (27 papers)
  4. Dongdong Zhang (79 papers)
  5. Xiaolei Wang (44 papers)
  6. Xin Zhao (160 papers)
  7. Furu Wei (291 papers)
  8. Ji-Rong Wen (299 papers)
Citations (36)