Table of Contents
Fetching ...

Unveiling Language-Specific Features in Large Language Models via Sparse Autoencoders

Boyi Deng, Yu Wan, Yidan Zhang, Baosong Yang, Fuli Feng

TL;DR

This work tackles the challenge of understanding multilingual capabilities in large language models by moving beyond neuron-based and pure activation analyses to a Sparse Autoencoder (SAE) framework that decomposes layer activations into sparse, interpretable features. It introduces a monolinguality metric $\nu^L_s$ to quantify language-specificity of SAE features, identifies language-specific features that influence targeted languages, and shows that ablating these features yields language-specific performance drops while preserving other languages. The study also demonstrates synergistic interactions among language features and leverages SAE-derived signals to improve steering vectors, enabling more reliable language control in generation and cross-lingual tasks. Collectively, these findings provide a practical, interpretable lens on multilinguality and a pathway to more robust, language-aware steering in LLMs.

Abstract

The mechanisms behind multilingual capabilities in Large Language Models (LLMs) have been examined using neuron-based or internal-activation-based methods. However, these methods often face challenges such as superposition and layer-wise activation variance, which limit their reliability. Sparse Autoencoders (SAEs) offer a more nuanced analysis by decomposing the activations of LLMs into a sparse linear combination of SAE features. We introduce a novel metric to assess the monolinguality of features obtained from SAEs, discovering that some features are strongly related to specific languages. Additionally, we show that ablating these SAE features only significantly reduces abilities in one language of LLMs, leaving others almost unaffected. Interestingly, we find some languages have multiple synergistic SAE features, and ablating them together yields greater improvement than ablating individually. Moreover, we leverage these SAE-derived language-specific features to enhance steering vectors, achieving control over the language generated by LLMs. The code is publicly available at https://github.com/Aatrox103/multilingual-llm-features.

Unveiling Language-Specific Features in Large Language Models via Sparse Autoencoders

TL;DR

This work tackles the challenge of understanding multilingual capabilities in large language models by moving beyond neuron-based and pure activation analyses to a Sparse Autoencoder (SAE) framework that decomposes layer activations into sparse, interpretable features. It introduces a monolinguality metric to quantify language-specificity of SAE features, identifies language-specific features that influence targeted languages, and shows that ablating these features yields language-specific performance drops while preserving other languages. The study also demonstrates synergistic interactions among language features and leverages SAE-derived signals to improve steering vectors, enabling more reliable language control in generation and cross-lingual tasks. Collectively, these findings provide a practical, interpretable lens on multilinguality and a pathway to more robust, language-aware steering in LLMs.

Abstract

The mechanisms behind multilingual capabilities in Large Language Models (LLMs) have been examined using neuron-based or internal-activation-based methods. However, these methods often face challenges such as superposition and layer-wise activation variance, which limit their reliability. Sparse Autoencoders (SAEs) offer a more nuanced analysis by decomposing the activations of LLMs into a sparse linear combination of SAE features. We introduce a novel metric to assess the monolinguality of features obtained from SAEs, discovering that some features are strongly related to specific languages. Additionally, we show that ablating these SAE features only significantly reduces abilities in one language of LLMs, leaving others almost unaffected. Interestingly, we find some languages have multiple synergistic SAE features, and ablating them together yields greater improvement than ablating individually. Moreover, we leverage these SAE-derived language-specific features to enhance steering vectors, achieving control over the language generated by LLMs. The code is publicly available at https://github.com/Aatrox103/multilingual-llm-features.
Paper Structure (40 sections, 4 equations, 42 figures, 1 table)

This paper contains 40 sections, 4 equations, 42 figures, 1 table.

Figures (42)

  • Figure 1: The values of $\nu$, as referenced in Eq. \ref{['eq:ablation']}, where a larger $\nu$ indicates stronger monolingualism, are reported for the top-4 features and a random feature across various languages in layer 20 of Gemma 2 2B. The values of $\nu$ for the top-4 features are greater than those of a random feature. In most languages, the top-1 feature possesses a significantly larger $\nu$. Additional results for other layers and LLMs are in Appendix \ref{['Appendix:nu']}, exhibiting similar patterns. The value of the random feature (feature 2000) is too small to be visible.
  • Figure 2: The mean activation of feature 13788 across different languages in layer 10 of Gemma 2 2B. The high mean activation in Chinese suggests that feature 13788 might be related to Chinese.
  • Figure 3: The mean activation values for the Spanish feature with various noun and prefix combinations. Adding a Spanish prefix enhances the Spanish feature activation for non-Spanish nouns, enabling the LLM to process them as if they were "Spanish tokens."
  • Figure 4: The mean activation values for the French and Korean features with various noun and prefix combinations. Introducing a different language prefix decreases the original language feature activation of nouns.
  • Figure 5: The changes in CE loss on texts in the target language and texts in other languages after ablating language-specific features. Ablating language-specific features has a much larger impact on the CE loss of texts in the target language compared to texts in other languages. We provide results for Gemma 2 2B here, additional results can be found in Appendix \ref{['Appendix:Directional_Ablation']}.
  • ...and 37 more figures