---
title: Language Activation Probability Entropy
url: https://www.emergentmind.com/topics/language-activation-probability-entropy-lape
type: topic
---

# Language Activation Probability Entropy

Searching arXiv for papers on Language Activation Probability Entropy and entropy-aligned decoding.
Language Activation Probability Entropy (LAPE) is an entropy-based measure for quantifying concentration versus dispersion in activation behavior. In its original and most explicit formulation for multilingual large language models, LAPE identifies language-specific neurons by converting a neuron’s activation probabilities across languages into a probability distribution and measuring its Shannon entropy: low entropy indicates that the neuron activates predominantly for one or a few languages, while high entropy indicates language-agnostic behavior [2402.16438]. Later work applies the same idea to sparse autoencoder features, programming languages, and language-specific subnetworks, while a separate decoding literature uses the term or an equivalent mapping for the entropy of the LM’s token activation probability distribution at each generation step [2507.11230], [2506.01074], [2601.01714]. Across these literatures, the common principle is unchanged: entropy is used as a compact scalar summary of selectivity, uncertainty, or specialization.

## 1. Core definition and mathematical form

In the multilingual neuron literature, LAPE is defined over feed-forward network neurons. For a neuron \(n \equiv (i,j)\) and language \(\ell\), the activation probability is the expected fraction of token positions in that language at which the neuron is active:
\[
p_{n}(\ell) \equiv p^{\ell}_{i,j} \;=\; \mathbb{E}\big[ \ \mathbb{I}\{\mathrm{act\_fn}\!\big(\tilde{\bm{h}^{i}}\bm{W}^{i}_{1}\big)_{j} > 0\} \ \big| \ \text{language } \ell \ \big].
\]
Because the raw \(p_n(\ell)\) values do not necessarily sum to 1 across languages, the vector is L1-normalized:
\[
\bm{p}_{n}' \;=\; \frac{\bm{p}_{n}}{\|\bm{p}_{n}\|_{1}},
\]
and the LAPE score is then the entropy of \(\bm{p}_n'\):
\[
\mathrm{LAPE}(n) \;=\; H\!\big(\bm{p}_{n}'\big) \;=\; -\sum_{\ell=1}^{L} p_{n}'(\ell) \, \log \big(p_{n}'(\ell)\big).
\]
In implementation, the natural logarithm is used and no additional smoothing or bias correction is applied [2402.16438].

This same formal pattern recurs in later work. For language-specific neurons in multilingual LLMs, one commonly writes
\[
p_l(h) = \mathbb{E}_{x \sim D_l} [ I(a_h(x) > 0) ],
\qquad
P_l(h) = p_l(h) / \sum_{l'} p_{l'}(h),
\]
followed by
\[
LAPE(h) = -\sum_{l=1}^k P_l(h) \log P_l(h).
\]
A normalized variant,
\[
\hat{H}(h) = H(h) / \log k,
\]
is sometimes used for interpretability, mapping entropy to \([0,1]\) [2503.17456].

The intuition is stable across papers. A low-LAPE neuron is interpreted as language-specific; a high-LAPE neuron is interpreted as language-agnostic. This same intuition is later transferred from dense neurons to sparse features, and from natural languages to programming languages [2507.11230], [2506.01074].

## 2. Original multilingual-neuron formulation

“Language-Specific Neurons: The Key to Multilingual Capabilities in Large Language Models” introduced LAPE as a novel detection method to identify language-specific neurons within LLMs [2402.16438]. The study evaluates LLaMA‑2 (7B, 13B, 70B) and BLOOM (7.1B), uses Wikipedia corpora in seven languages—English, Simplified Chinese, French, Spanish, Vietnamese, Indonesian, and Japanese, with Japanese excluded for BLOOM-specific analyses—and samples 100 million tokens per language for LAPE estimation [2402.16438].

The paper labels neurons language-specific by two criteria. First, it applies low entropy selection: the bottom 1% of neurons by LAPE are selected as candidates. Second, for a neuron to be assigned to a particular language \(\ell\), it must have \(p_n(\ell)\) above a global threshold \(P_{\mathrm{th}}\), set to the 95th percentile of all activation probabilities across neurons and languages for the model. For LLaMA‑2‑70B, \(P_{\mathrm{th}} = 0.515\). A neuron can be shared by multiple languages if it exceeds \(P_{\mathrm{th}}\) for each [2402.16438].

The main empirical pattern is a pronounced U-shaped distribution. Language-specific neurons concentrate at the bottom and top of the network, with middle layers containing far fewer such neurons. In LLaMA‑2‑70B, approximately 23k neurons are flagged as language-specific by LAPE, and the second layer alone accounts for roughly 7,000 language-specific neurons across languages, while the final four layers each exceed 1,000 [2402.16438]. The paper interprets this as bottom layers transforming diverse scripts and segmentations into a shared semantic space, and top layers projecting semantics into language-specific vocabularies.

The paper also reports causal evidence. Deactivating language-specific neurons identified by LAPE induces a strong diagonal pattern of performance degradation: turning off Chinese-specific neurons primarily increases perplexity on Chinese, with much smaller effects on other languages. In open-ended multilingual generation on Vicuna-derived prompts, activating language-specific neurons improves the likelihood that the model responds in the intended language. For LLaMA‑2‑70B, language accuracy improves from \(0.87 \rightarrow 0.99\) for Chinese, \(0.73 \rightarrow 0.90\) for French, \(0.81 \rightarrow 0.93\) for Spanish, \(0.60 \rightarrow 0.97\) for Vietnamese, \(0.40 \rightarrow 0.99\) for Indonesian, and \(0.79 \rightarrow 1.00\) for Japanese [2402.16438]. The same study notes that Chinese and Japanese exhibit cross-impact, consistent with shared characters, and reports that approximately 25% of Chinese and Japanese neurons overlap [2402.16438].

## 3. Variants, thresholds, and extensions beyond dense FFN neurons

Subsequent work preserves the entropy-over-languages template but modifies the activation event, thresholds, or representational basis. In “Sparse Autoencoders Can Capture Language-Specific Concepts Across Diverse Languages,” SAE-LAPE applies LAPE to sparse autoencoder features rather than raw neurons [2507.11230]. For a feature \(f\) and language \(l\),
\[
p_{f,l} = P(a_f > 0 \mid \text{language } l),
\qquad
\tilde{p}_{f,l} = p_{f,l} / \sum_{l'} p_{f,l'},
\]
and
\[
H(f) = - \sum_{l \in \mathcal{L}} \tilde{p}_{f,l} \ln \tilde{p}_{f,l}.
\]
Because TopK SAEs explicitly zero non-top-k values, the indicator \(I(a_f > 0)\) coincides with “feature selected in top-k for that token.” The paper identifies 540 language-specific features out of approximately 2 million features across layers, with most low-entropy features concentrating in layers roughly 8–15, and reports that low-LAPE features are more interpretable [2507.11230].

The thresholds had to be modified for sparsity. The original neuron LAPE threshold used by Tang et al. was not suitable for SAEs, so SAE-LAPE first applies a High-Frequency Latents filter: a feature must be active for more than 10% of tokens and at least 98% of examples in at least one language-specific corpus. A feature is then called specific to language \(l\) if
\[
p_{f,l} \ge 0.5 \cdot \max_{l'} p_{f,l'},
\]
and language-specific features are selected only when they are specific to just one language [2507.11230].

“Multilingual Language Models Encode Script Over Linguistic Structure” extends LAPE to both dense neurons and sparse features while using it to study romanization and word-order shuffling [2604.05090]. For raw neurons, the paper filters by the global 95th percentile of activation probabilities across all neurons and languages, discards neurons whose activation probability never exceeds this threshold in any language, and selects the top 1% lowest-entropy neurons. For SAE latents, it imposes minimum example rate \(\ge 0.98\), high-frequency latent rate \(\ge 0.10\), and a relative top-k membership rule,
\[
P(f \mid l) \ge 0.8 \times \max_{l'} P(f \mid l').
\]
The paper finds that romanization induces near-disjoint representations that align with neither native-script inputs nor English, while word-order shuffling has limited effect on unit identity [2604.05090].

The same entropy logic has also been applied to programming languages. “How Programming Concepts and Neurons Are Shared in Code Language Models” adapts LAPE from natural languages to English and 11 programming languages, defining per-neuron language activation probabilities over code corpora and then measuring entropy across languages [2506.01074]. The paper reports that most selected language-specific neurons are concentrated in bottom layers, but neurons exclusive to each programming language tend to appear in the top layers. For programming languages that are highly aligned with multiple other programming languages, identifying language-specific neurons is not feasible [2506.01074].

## 4. Steering, adaptation, and the limits of neuron-level control

LAPE-based neuron sets have been used for inference-time steering, parameter-efficient adaptation, and causal analyses. “Language Arithmetics: Towards Systematic Language Neuron Identification and Manipulation” studies Llama-3.1-8B, Mistral-Nemo-12B, and Aya-Expanse-8B & 32B across 21 languages and reports that these neurons cluster in deeper layers, with non-Latin scripts showing greater specialization [2507.22608]. In Llama-3.1 at top-1% selection, the paper reports \(zh = 681\), \(bo = 1492\), \(hi = 781\), versus \(en = 61\), \(de = 284\), \(fr = 269\). It then performs “language arithmetics,” defined as systematic activation addition and multiplication, and finds that additive Deactivate+Activate improves Llama-3.1-8B language-forcing success from \(19.88\%\) at top-1% to \(28.12\%\) at top-5%, outperforming replacement-based methods [2507.22608].

A more adaptation-oriented use appears in “Sparse Subnetwork Enhancement for Underrepresented Languages in Large Language Models” [2510.13580]. That paper computes LAPE on FFN neurons using a positivity threshold of \(0\), selects the lowest \(K = 5\%\) of LAPE scores, imposes activity thresholds of \(0.95\), and then fine-tunes only the weights associated with the selected neurons for a target language. On Llama-3.1-8B, averaged over 12 mid- and low-resource languages, the reported target-language performance average is \(33.02\) for target neurons, compared with \(29.56\) for the base model, \(11.88\) for full fine-tuning, \(21.81\) for FFN-only fine-tuning, \(28.41\) for LoRA, and \(29.89\) for a random subset. At the same time, general capabilities average is \(63.00\) for target neurons versus \(63.07\) for the base model, while full fine-tuning drops to \(25.51\) [2510.13580]. The paper states that the approach updates only up to 1% of model parameters.

The most important counterpoint comes from “Language-specific Neurons Do Not Facilitate Cross-Lingual Transfer” [2503.17456]. That study evaluates LAPE-selected neurons and activation probability-based thresholding on Llama 3.1 and Mistral Nemo for zero-shot XNLI and XQuAD. Its conclusion is negative: test-time interventions based on LAPE or Act Prob 90p generally do not help, and neuron-specific LoRA fine-tuning did not improve zero-shot transfer. The paper attributes this to polysemanticity/superposition, distributed language signals and cross-layer interactions, and methodological sensitivity to the chosen language set [2503.17456].

Taken together, these findings do not support a single universal claim about LAPE-selected units. The positive results concern steering of output language, monolingual enhancement, and causal manipulation of language behavior [2402.16438], [2507.22608], [2510.13580]. The negative results concern zero-shot cross-lingual NLU transfer [2503.17456]. This suggests that LAPE can isolate useful language-associated structure without implying that those units are a reliable lever for cross-lingual generalization.

## 5. Decoding-time reinterpretation: entropy of token activation probabilities

A separate line of work uses “Language Activation Probability Entropy” to denote the entropy of the model’s conditional distribution over the vocabulary at each generation step. In the context of language model decoding, “activation probability” refers to the model’s conditional distribution over the vocabulary at generation step \(t\), given the input \(x\) and past tokens \(y_{<t}\). The corresponding per-step entropy is
\[
H\big(p_\theta(y_t \mid x, y_{<t})\big) = -\sum_i p_\theta(i \mid x, y_{<t}) \log p_\theta(i \mid x, y_{<t}).
\]
This quantity is exactly “the entropy of the LM’s token activation probability distribution at each step” [2601.01714].

“Entropy-Aligned Decoding of LMs for Better Writing and Reasoning” visualizes this quantity over 15 generation steps and highlights a “typical” entropy band roughly between \(1.0\) and \(2.5\) nats [2601.01714]. The figure associates entropy collapse with repetitive output, entropy rising well above the typical band with incoherent output, and moderate, stable entropy with coherent, fluent text. The paper introduces EPIC, a hyperparameter-free decoding approach that incorporates the entropy of future trajectories into LM decoding, explicitly regulates the amount of uncertainty expressed at every step of generation, and aligns the sampling distribution’s entropy to the aleatoric uncertainty. Through Entropy-Aware Lazy Gumbel-Max sampling, EPIC is described as exact and efficient, requiring only a sublinear number of entropy evaluations per step [2601.01714].

A related training-time use appears in “Entropy Regularizing Activation,” where the paper defines LAPE for token distributions as
\[
H(p) = -\sum_{i=1}^{V} p_i \log p_i
\]
and, for LLM reinforcement learning, focuses on “response entropy” \(H_{\mathrm{resp}}\), the average entropy over the top 20% highest-entropy tokens in the generated response [2510.08549]. ERA regulates \(H_{\mathrm{resp}}\) to stay within \([\omega_{\mathrm{low}}, \omega_{\mathrm{high}}]\) during training. For Qwen2.5-Math-7B, the paper reports a two-stage schedule, and on AIME’25 reports \(16.9\%\) for ERA versus \(12.3\%\) for GRPO, a \(+37.4\%\) relative gain [2510.08549].

The broader entropy picture is complemented by “Entropy in Large Language Models,” which treats LLM output as an information source and estimates entropy rates from generated text [2602.20052]. That paper reports lower entropy for LLM-generated text than for OANC written and spoken language, with reported values of \(0.716\) for OANC written, \(1.255\) for OANC spoken, \(0.618\) for “LLM accumulated, \(T_{\max}=1.0\),” and \(0.574\) for “LLM accumulated, \(T_{\max}=1.5\)” [2602.20052]. In this decoding-oriented usage, LAPE functions as a diagnostic of uncertainty, diversity, and collapse rather than as a cross-language selectivity measure.

## 6. Broader entropy frameworks and conceptual significance

Outside multilingual-neuron analysis and decoding, LAPE has been generalized to other activation distributions. In “Mathematically Modeling the Lexicon Entropy of Emergent Language,” LAPE is interpreted as the Shannon entropy of the activation probability distribution over messages or words produced by agents in an emergent communication system [2211.15783]. With a lexicon of size \(S\) and message probabilities \(p = (p_1,\dots,p_S)\),
\[
H(p) = -\sum_{i=1}^{S} p_i \log p_i.
\]
The paper’s FiLex stochastic process predicts directional effects of training steps, lexicon size, learning rate, rollout buffer size, and Gumbel-Softmax temperature on entropy, and the reported outcome is that 20 out of 20 environment–hyperparameter combinations match the predicted sign [2211.15783].

A language-level extension appears in “Entropy2Vec: Crosslingual Language Modeling Entropy as End-to-End Learnable Language Representations” [2509.05060]. That work does not define LAPE explicitly, but it constructs a cross-lingual entropy matrix \(E_{i,j}\) from monolingual language models and defines a language vector
\[
Z^{L_i} = [E_{i,1}, E_{i,2}, \dots, E_{i,n}].
\]
The paper states that LAPE follows naturally by mapping per-language entropies into activation probabilities and computing their entropy [2509.05060]. This suggests a shift from unit-level selectivity toward language-level uncertainty profiles.

A longer information-theoretic background is provided by “The word entropy of natural languages,” which estimates block and source entropy across parallel texts and across 1001 languages [1606.06996]. That paper is not a LAPE paper, but it supplies the language-entropy tradition on which later entropy-based multilingual analyses build. It reports approximately normally distributed block entropies with mean \(9.26\) and SD \(1.24\), source entropies with mean \(5.97\) and SD \(1.07\), and a strong correlation between block and source entropies with Pearson \(r = 0.96\) [1606.06996].

Across these literatures, the significance of LAPE is not that it names one invariant metric with a single object of measurement. Rather, it designates a recurrent information-theoretic construction: define an activation probability distribution over a relevant support—languages, tokens, features, or messages—and use Shannon entropy to measure how concentrated or uncertain that distribution is. In multilingual mechanistic interpretability, this yields a tractable criterion for language-specific neurons and features [2402.16438], [2507.11230]. In decoding, it becomes a measure of local uncertainty and a control target for generation [2601.01714], [2510.08549]. In emergent communication and cross-lingual entropy modeling, it becomes a compact description of symbolic or language-level uncertainty [2211.15783], [2509.05060]. The resulting body of work shows that entropy can serve as a common currency for specialization, selectivity, and uncertainty, even when the underlying object of “activation probability” changes across domains.

Source: https://www.emergentmind.com/topics/language-activation-probability-entropy-lape