betaFeedback

WorksComputer Science

Massive Activation Gating Channel in Large Language Models

Abstract

Massive activations, a phenomenon in which a small number of hidden channels exhibit exceptionally large magnitudes, are pervasive in large language models (LLMs). However, the mechanism by which a token develops massive activations as it propagates through a pretrained LLM remains poorly understood. In this paper, we find that the emergence of massive activations is controlled by a single channel in the input embedding to a spike feed-forward network (FFN). The position of this channel is fixed for a particular LLM. We name this channel the massive activation gating channel (MAGC). When the value of the MAGC is sufficiently large (or small, depending on the LLM), the output of the spike FFN exhibits massive activations. Examining six LLMs across four model families and different model sizes, we verify the existence and effect of MAGC. We further provide a theoretical explanation of the mechanism by which MAGC induces massive activations. When the value of MAGC is sufficiently large (or small), the output of a spike FFN asymptotically reduces to a quadratic form that mixes a few columns of the down-projection matrix of the FFN. Since these columns exhibit the shape of massive activations, the output therefore exhibits massive activations.

Introduction

Large Language Models (LLMs) have demonstrated strong capabilities on various tasks [3]. While the majority of existing work focuses on external behaviors of LLMs, it is also important to understand the internal mechanisms of LLMs. Among them, attention sink [14] and massive activations [10] have been found in modern LLMs across different model families. Specifically, attention sink refers to the phenomenon in which the first token (or other tokens with little semantic importance) in a sequence receives a disproportionately large amount of attention from subsequent tokens [16, 2], typically in the middle transformer blocks. The cause of attention sink is usually attributed to massive activations [10, 15], where a few channels (dimensions) in the hidden representation of the first token (or other tokens with little semantic importance) exhibit large activation magnitudes before attention computation. It is important to unveil the mechanism underlying massive activations and attention sink, as these phenomena have been widely employed in various critical tasks, including KV-cache optimization [5], inference [14], quantization [9], and hallucination mitigation [7].

In this study, we focus on massive activations. Although existing research has extensively demonstrated the phenomenon of massive activations, research on the mechanism underlying massive activations remains limited. We address this problem by asking: how does a token develop massive activations as it propagates a pretrained transformer? We refer to tokens that exhibit massive activations as spike tokens [11].

As LLMs are powered by billions of parameters, our analysis draws attention to the computation of each sub-module (attention and feed-forward networks) in transformers. Existing work [18, 11] has demonstrated that massive activations emerge after certain feed-forward networks (FFNs) and are maintained in the middle transformer blocks through the residual layer (see § 2 for more details). For example, in LLaMA-2-7B, massive activations of a spike token emerge after the FFN in the second transformer block [10, 11] and are maintained until reaching the last FFN. We refer to the FFN that produces massive activations as the spike FFN. The magnitudes of massive activations remain similar in the middle transformer blocks, indicating that only the residual layer maintains massive activations and that no further massive activations are triggered during the middle computation.

Sun et al. [11] assume that the SiLU activation function in the spike FFN behaves as a near-identity function for spike tokens. Under this assumption, each output channel kk of the spike FFN can be expressed as a quadratic form characterized by a channel-specific coefficient matrix SkS_k. The magnitude of output channel kk is determined by the dominant eigenvalue of SkS_k. Since the dominant eigenvalues associated with a few channels are substantially larger than those of other channels, massive activation emerges.

However, our empirical results show that the near-identity assumption on which Sun et al. [11] rely to explain massive activations is only valid for a small number of models. Among the six models examined in this study, only one model approximately satisfies the assumption (see Appendix § 9 for more details). Moreover, their explanation overlooks the properties of input embeddings to the spike FFN. Instead, we find that the emergence of massive activations is controlled by a single channel in the input embeddings of a spike token to the spike FFN: massive activations appear once the value of this channel is sufficiently large (or small, depending on the LLM). For a given LLM, the position of this channel is fixed. We refer to this channel as the massive activation gating channel (MAGC). Unlike massive activations, whose magnitudes can reach approximately 400 in LLaMA-3.2-1B, the MAGC in the embedding of a spike token has an average value of only around 8.8. Although this value is substantially larger than those of the other channels in the embedding, its magnitude remains moderate because the embedding is layer-normalized before being fed into the FFN.

We verify this finding across multiple decoder-only LLM families, including LLaMA, Qwen, DeepSeek, and Mistral, with model sizes ranging from 1B to 32B parameters. Moreover, our theoretical analysis shows that massive activations can be attributed to the alignment between MAGC and certain rows and columns of the spike FFN weight matrices. Similarly, we empirically demonstrate that this alignment occurs in different LLMs. We summarize our contributions as follows.

  1. The emergence of massive activations is controlled by a single channel in the input embedding to a spike FFN, and the position of this channel is fixed for a particular LLM. We name this channel the massive activation gating channel (MAGC). When the value of the MAGC is sufficiently large (or small, depending on the LLM), the output of the spike FFN exhibits massive activations. Examining six LLMs across four model families and different model sizes, we verify the existence and effect of MAGC.

  1. We provide a theoretical explanation of the mechanism by which MAGC induces massive activations. When the value of MAGC is sufficiently large (or small), the output of a spike FFN asymptotically reduces to a quadratic form that mixes a few columns of the down-projection matrix of the FFN. Since these columns exhibit the shape of massive activations, the output therefore exhibits massive activations.

Transformer Architecture

A dense transformer model consists of LL transformer blocks, each of which can be further decomposed into modules. Taking LLaMA as an example [12], denote the input to the ll-th transformer block as Xl=⟨x0l,x1l,⋯ ,xTl⟩X^l = \langle x_0^l, x_1^l, \cdots, x_T^l \rangle. Without further specification, xtlx_t^l denotes an embedding of the tt-th token in the ll-th transformer block. Since our following analysis focuses on the single spike FFN, we omit the superscript ll for notational simplicity. Each block of LLaMA consists of an attention sub-module and an FFN sub-module, each of which uses pre-normalization (RMSNorm [17]) and includes a residual layer after its computation.

The input embedding is first normalized by an RMSNorm, referred to as input layer norm. Formally, if xt=⟨xt(0),xt(1),⋯ ,xt(d−1)⟩x_t = \langle x_t(0), x_t(1), \cdots, x_t(d-1) \rangle, where dd is the dimension of the embedding, then

nt=RMSNorm⁡(xt):nt(j)=xt(j)⋅wjRMS⁡(xt),RMS⁡(xt)=∑jxt(j)2d+ϵ,(1)n_t = \operatorname{RMSNorm}(x_t) : n_t(j) = \frac{x_t(j) \cdot w_j}{\operatorname{RMS}(x_t)}, \quad\operatorname{RMS}(x_t) = \sqrt{\frac{\sum_j x_t(j)^2}{d} + \epsilon}, \tag*{(1)}

where wjw_j are trainable parameters and ϵ\epsilon is a predefined small number. We denote ⋅(j)\cdot^{(j)} as the jj-th channel of the embedding. Next, the normalized embedding ntn_t is transformed by multi-head attention (MHA, or more specifically, grouped-query attention Ainslie et al. [1]):

(u0,u1,⋯ ,uT)=MHA⁡(n0,n1,⋯ ,nT),(u_0,u_1,\cdots,u_T)=\operatorname{MHA}(n_0,n_1,\cdots,n_T),

where utu_t is the embedding output of MHA. Usually, a transformer includes a residual layer after the multi-head attention Vaswani et al. [13]. Next, the FFN sub-module follows a similar configuration with another RMSNorm of different parameters.

ht=RMSNorm⁡(xt+ut).h_t=\operatorname{RMSNorm}(x_t+u_t).

A feed-forward network (FFN) is then applied to hth_t. In LLaMA, the FFN consists of a SwiGLU gated activation function Shazeer [8] with three weight matrices:

yt=FFN⁡(ht),yt=Wdown⋅(SiLU⁡(Wgateht)⊙(Wupht)),(2)y_t=\operatorname{FFN}(h_t),\quad y_t=W_{\mathrm{down}}\cdot\left(\operatorname{SiLU}\left(W_{\mathrm{gate}}h_t\right)\odot\left(W_{\mathrm{up}}h_t\right)\right), \tag*{(2)}

where ⊙\odot is the element-wise product and y\mathbf{y} is the output of FFN. Wgate,Wup∈Rm×dW_{\mathrm{gate}}, W_{\mathrm{up}}\in\mathbb{R}^{m\times d} and Wdown∈Rd×mW_{\mathrm{down}}\in\mathbb{R}^{d\times m} are pretrained weight matrices, where m>dm>d is the FFN intermediate dimension. Finally, another residual layer follows the FFN. That is, the output of a transformer block is xt+ut+ytx_t+u_t+y_t.

Massive Activation Gating Channel

Experimental Setup. In this section, we utilize a small but advanced LLM, LLaMA-3.2-1B Dubey et al. [4]. We verify the findings discovered in this section on other model families with larger model sizes in § 5.1. In LLaMA-3.2-1B, d=2,048d=2{,}048 and m=8,192m=8{,}192. We generate token sequences (without the BOS token) completely randomly to avoid the influence of semantics. Specifically, we randomly sample five tokens in the vocabulary set V\mathcal{V} and construct an input token sequence to the LLM. Note that the input tokens can be multilingual as well as completely meaningless. We conduct this sampling 5 times.

Existence of MAGC in the Input to Spike FFN

Following Sun et al. [11], we demonstrate the top-3 channel magnitudes of the transformer block outputs x+u+yx+u+y in Figure A1 in Appendix § 10. Similarly, we show that massive activations are first triggered by the FFN in an early layer, and are then preserved and propagated along the residual stream across layers. As depicted, we identify that in LLaMA-3.2-1B, the FFN in the second transformer block (i.e., block 1) produces massive activations. We name this FFN the spike FFN and focus our analysis on it.

Top-3 channel magnitudes and differences of transformer block outputs

Figure A1. Top-3 channel magnitudes of transformer block outputs x+u+yx+u+y in Llama-3.2-1B and their differences.

A straightforward method for analyzing the causes of massive activations is to trace their inputs. To this end, we directly visualize the embeddings of the inputs and outputs of the spike FFN for different tokens in Figure 1, using a token sequence example. We demonstrate other examples in Figure A2 in Appendix § 10.§ 2. As shown in Figure 1b, the first token (“stejne”) exhibits massive activations, whereas other tokens do not. Comparing their inputs to the FFN, we find that the input hh for the first token has a single outlier value, as shown in Figure 1a. Specifically, the 894th channel of the first token has a value of 8.807, while the absolute values of the other channels are all less than 2. The 894th channel of the other tokens has values of 0.814, -0.763, 0.335, and 1.029, respectively. In the next subsection, we will show that this single channel controls the emergence of massive activations, and we name this channel the massive activation gating channel (MAGC).

Inputs and outputs of the spike FFN

Figure 1. (a) Value of input hh to the spike FFN. We highlight the massive activation gating channel (894) in red. (b) Magnitude of output yy of the spike FFN. Token 0 exhibits massive activations. We depict magnitudes instead of actual values for better visualization.

Inputs and Outputs of the Spike FFN

Figure A2. Inputs and Outputs of the Spike FFN.

MAGC Triggers Massive Activations

Next, we show that this single-channel spike triggers massive activations through the computation of the spike FFN. To empirically validate this claim, we conduct the following experiment. Specifically, we randomly generate the input embedding to the spike FFN from a Pareto distribution with random signs: each channel value of the input embedding is i.i.d. drawn as X=random⁡(±)ZX = \operatorname{random}(\pm)Z with Z∼Pareto⁡(a)Z \sim\operatorname{Pareto}(a), Z≥0Z \ge0, where each element takes +Z+Z and −Z-Z with equal probability 0.5, and aa is a fixed shape parameter. Next, we swap the input value of the 894th channel with the maximum input value. We then input this randomly generated embedding into the spike FFN. Meanwhile, we conduct a controlled experiment. Specifically, we used the same randomly sampled input embedding but swapped the input value of a randomly selected channel other than the 894th, such as the 0th or 1742nd, with the maximum value. We report the results for a=1a = 1 in this section and present the results for a=3a = 3 and a=5a = 5 in Appendix B.3.

Figure 2 depicts the randomly generated inputs and their corresponding outputs after the spike FFN. It can be observed that when swapping the value of the 894th channel with the maximum value, the outputs of the spike FFN demonstrate massive activations. Since the randomly generated inputs carry no semantic meaning, this phenomenon mainly indicates that the FFN learns to recognize MAGC. However, swapping the value of any other channel, such the 0th or 1742nd channel, with the maximum value does not lead to the output of massive activations. We therefore conclude that MAGC controls the emergence of massive activations.

Six plots showing input Pareto distributions and Block 1 FFN outputs

Figure 2. From top to bottom, the figure shows the output of the spike FFN when the input vector values are randomly sampled from a Pareto distribution (a=1a = 1), with the input value of the 894th (MAGC), 0th, or 1742nd channel swapped with the maximum input value, respectively.

Moreover, as shown in Figure A3 and A4 in Appendix § 10.§ 3, decreasing aa increases the maximum value generated by the Pareto distribution. More importantly, assigning a larger maximum value to the 894th channel of the spike FFN input results in a correspondingly larger activation magnitude in its output. Specifically, as aa decreases from 5 to 1, the largest output activation magnitude increases from approximately 40 to 400. These results demonstrate that the spike FFN is highly sensitive to the value of the 894th input channel, with a larger value in this channel inducing more “massive” activations.

Pareto input vectors and spike FFN outputs

Figure A3. From top to bottom, the figure shows the output of the spike FFN when the input vector values are randomly sampled from a Pareto distribution (a=3a = 3), with the input value of the 894th (MAGC), 0th, or 1742nd channel swapped with the maximum input value, respectively.

Key Takeaway 1: There exists a massive activation gating channel (MAGC) in the hidden representation of a spike token, whose position is fixed for a specific LLM. When the hidden representation is used as the input to the spike FFN, the FFN output exhibits massive activations when the value of the MAGC in the hidden representation is sufficiently large (or small, depending on the LLM).

From MAGC to Massive Activations

In this section, we examine how a large value of MAGC induces massive activations in LLMs. Since a large value of MAGC corresponds to a large magnitude in a certain channel of the input to the FFN, we begin by analyzing the asymptotic property of the FFN with respect to any input channel. Recall the FFN computation in Equation (2): y(h)=Wdown(SiLU⁡(Wgateh)⊙Wuph)y(h) = W_{\mathrm{down}}\left(\operatorname{SiLU}(W_{\mathrm{gate}}h) \odot W_{\mathrm{up}}h\right). We show that, when a fixed channel has a large magnitude (in either direction), the mechanism of the FFN can be simplified as mixing columns of WdownW_{\mathrm{down}}. Note that the mixing mechanism depends on the direction of the channel value (x→+∞x \to+\infty or x→−∞x \to-\infty), which explains why MAGC also has a fixed gating direction.

Asymptotic Property of an FFN w.r.t. an Input Channel

Figure 1a demonstrates the phenomenon that the input to the FFN contains a large magnitude in a certain channel for spike tokens. We begin by analyzing the asymptotic property of any FFN with respect to any input channel. Consider a gated FFN in Equation (2), for input h∈Rdh \in\mathbb{R}^{d},

FFN⁡(h)=g(h)=Wdown(SiLU⁡(Wgateh)⊙Wuph).(3)\operatorname{FFN}(h) = g(h) = W_{\mathrm{down}}\left(\operatorname{SiLU}(W_{\mathrm{gate}}h) \odot W_{\mathrm{up}}h\right). \tag*{(3)}

where Wup∈Rm×dW_{\mathrm{up}} \in\mathbb{R}^{m \times d}, Wgate∈Rm×dW_{\mathrm{gate}} \in\mathbb{R}^{m \times d}, and Wdown∈Rd×mW_{\mathrm{down}} \in\mathbb{R}^{d \times m} are parameter matrices, SiLU⁡(x):=x⋅σ(x)\operatorname{SiLU}(x) := x \cdot\sigma(x) with the logistic sigmoid function σ(x):=11+exp⁡(−x)\sigma(x) := \frac{1}{1+\exp(-x)}, and ⊙\odot is the element-wise product.

We focus on the input hh controlled by a fixed single channel ii. For any value x∈Rx \in\mathbb{R} in the fixed channel ii, the input can be written as,

h(x)=x⋅ei+hˉ.(4)h(x) = x \cdot e_i + \bar{h}. \tag*{(4)}

Here, hˉ∈Rd\bar{h} \in\mathbb{R}^{d} is the representation outside the focused channel ii with hˉ(i)=0\bar{h}(i) = 0, and eie_i is the unit vector at position ii. Next, we analyze the asymptotic property of g(h(x))g(h(x)) for x→+∞x \to+\infty without loss of generality. Let ωj=Wdown(:,j)/∥Wdown(:,j)∥2\omega_j = W_{\mathrm{down}}^{(:,j)} / \lVert W_{\mathrm{down}}^{(:,j)} \rVert_2 be the normalized jj-th column of WdownW_{\mathrm{down}}. The following theorem shows the closed form of y(h(x))y(h(x)) when x→+∞x \to+\infty.

Theorem 4.1. Given input h(x)=x⋅ei+hˉh(x) = x \cdot e_i + \bar{h}, when x→+∞x \to+\infty, the output of an FFN has a quadratic form y(h(x))=x2⋅y∗+o(x2)y(h(x)) = x^2 \cdot y^* + o(x^2) with constant y∗∈Rdy^* \in\mathbb{R}^d equal to

y∗=∑j=1mαj⋅ωj,(5)y^* = \sum_{j=1}^{m} \alpha_j \cdot\omega_j, \tag*{(5)}

where α=(α1,…,αm)\boldsymbol{\alpha} = (\alpha_1, \ldots, \alpha_m) is the combination of coefficients in the weight matrices:

αj={Wgate(j,i)Wup(j,i)∥Wdown(:,j)∥2Wgate(j,i)>00Wgate(j,i)≤0.(6)\alpha_j = \begin{cases} W_{\mathrm{gate}}^{(j,i)} W_{\mathrm{up}}^{(j,i)} \lVert W_{\mathrm{down}}^{(:,j)} \rVert_2 & W_{\mathrm{gate}}^{(j,i)} > 0 \\ 0 & W_{\mathrm{gate}}^{(j,i)} \le0 \end{cases}. \tag*{(6)}

Proof. See Appendix C.1.

Specifically, for any input channel ii in hh, SiLU⁡(Wgateh)\operatorname{SiLU}(W_{\mathrm{gate}}h) acts as a gating function, choosing column jj only when Wgate(j,i)x>0W_{\mathrm{gate}}^{(j,i)}x > 0, and αj\alpha_j controls the sensitivity to each ωj\omega_j. From Theorem 4.1, when xx is large enough, the output y(h(x))=x2⋅y∗+o(x2)y(h(x)) = x^2 \cdot y^* + o(x^2) exhibits a pattern of massive activations only if y∗y^* has the same pattern. Similarly, an analogous result holds as x→−∞x \to-\infty.

From MAGC to Massive Activations

We introduce several metrics below to quantify the degree of massive activations. Since massive activations describe the phenomenon in which certain activations exhibit large magnitudes, we utilize the energy distribution to characterize their magnitude distribution.

Definition 4.2 (Energy Distribution). Given vector v=(v1,…,vd)∈Rd\boldsymbol{v} = (v_1, \ldots, v_d) \in\mathbb{R}^d, let its energy distribution be p(v)=(p1(v),…,pd(v))\boldsymbol{p}(\boldsymbol{v}) = (p_1(\boldsymbol{v}), \ldots, p_d(\boldsymbol{v})), where

pi(v)=vi2∥v∥22,∀i=1,…,d.(7)p_i(\boldsymbol{v}) = \frac{v_i^2}{\lVert\boldsymbol{v} \rVert_2^2}, \qquad\forall i = 1, \ldots, d. \tag*{(7)}

The energy distribution is a probability distribution. Moreover, if y\boldsymbol{y} exhibits massive activations, p(y)\boldsymbol{p}(\boldsymbol{y}) should be highly concentrated. We define the degree of concentration as the negative entropy of p(y)\boldsymbol{p}(\boldsymbol{y}) plus a constant. Formally,

Definition 4.3 (Concentration Degree). Given vector v∈Rd\boldsymbol{v} \in\mathbb{R}^d, let its concentration degree be

R(v)=log⁡d+∑i=1dpi(v)log⁡pi(v)(8)R(\boldsymbol{v}) = \log d + \sum_{i=1}^{d} p_i(\boldsymbol{v}) \log p_i(\boldsymbol{v}) \tag*{(8)}

where p(v)=(p1(v),…,pd(v))\boldsymbol{p}(\boldsymbol{v}) = (p_1(\boldsymbol{v}), \ldots, p_d(\boldsymbol{v})) is the energy distribution defined in Definition 4.2.

The concentration degree R(v)∈[0,log⁡d]R(\boldsymbol{v}) \in[0, \log d] is exactly the negative entropy plus a constant log⁡d\log d. A larger R(v)R(\boldsymbol{v}) means v\boldsymbol{v} is more concentrated. R(v)=0R(\boldsymbol{v}) = 0 means v\boldsymbol{v} is uniform, while R(v)=log⁡dR(\boldsymbol{v}) = \log d means v\boldsymbol{v} has only one non-zero entry.

We now fix MAGC as the focused channel i∗i^* and analyze the relationship between the concentration degree of the output y∗y^* and those of ωj\omega_j and α\boldsymbol{\alpha}. We first find that the following assumption is empirically satisfied.

Assumption 4.4. When MAGC is the focused channel, α\boldsymbol{\alpha} has a high concentration degree, i.e., R(α)≥log⁡m−ϵR(\boldsymbol{\alpha}) \ge\log m - \epsilon for a small ϵ\epsilon. Let j∗=arg⁡max⁡jpj(α)j^* = \arg\max_j p_j(\boldsymbol{\alpha}) be the dominant column index; then

R(α)≥log⁡m−ϵ⇒pj∗(α)≥e−ϵ.(9)R(\boldsymbol{\alpha}) \ge\log m - \epsilon\Rightarrow p_{j^*}(\boldsymbol{\alpha}) \ge e^{-\epsilon}. \tag*{(9)}

Empirical verification. Rather than assuming this property, we verify it directly by scanning all d=2,048d = 2{,}048 input channels of the spike FFN in LLaMA-3.2-1B: for each channel ii we form the coefficient vector α\boldsymbol{\alpha} from Theorem 4.1 and measure its concentration R(α)R(\boldsymbol{\alpha}), dominant energy share pj∗(α)p_{j^*}(\boldsymbol{\alpha}), and norm ∥α∥2\lVert\boldsymbol{\alpha} \rVert_2. MAGC (i∗=894i^* = 894) attains the largest concentration among all channels, with R(α)=9.009R(\alpha) = 9.009 against log⁡m=9.011\log m = 9.011 (i.e. ϵ≈1.9×10−3\epsilon\approx1.9 \times10^{-3}) and pj∗(α)=0.9998p_{j^*}(\alpha) = 0.9998, whereas the mean over all channels is only R(α)=2.908R(\alpha) = 2.908. This confirms that MAGC is a significant outlier in α\alpha-concentration.

A high concentration degree R(α)R(\alpha) indicates that a few pj(α)p_j(\alpha) are extremely large. We empirically demonstrate α\alpha when i∗=894i^* = 894 for LLaMA-3.2-1B in Figure 3a and highlight the largest magnitude in the vector. As shown, α\alpha is highly concentrated with j∗=1417j^* = 1417. That is, the output yy of the FFN is largely controlled by the j∗j^*-th column of WdownW_{\mathrm{down}}. Theoretically, based on the high concentration of α\alpha, we next quantify the contribution of the remaining columns.

Visualization results for LLaMA-3.2-1B

Figure 3. (a) α\alpha vector when i∗=894i^* = 894 for LLaMA-3.2-1B. (b) ω1417\boldsymbol{\omega}_{1417} for LLaMA-3.2-1B. (c) ω0\boldsymbol{\omega}_0 for LLaMA-3.2-1B. (d) ω1\boldsymbol{\omega}_1 for LLaMA-3.2-1B. Figure 3: Visualization results for LLaMA-3.2-1B.

Definition 4.5. Given j∗=arg⁡max⁡jpj(α)j^* = \arg\max_j p_j(\alpha), define the residual amplification factor

κ=∥∑j≠j∗αjωj∥2∑j≠j∗αj2.\kappa= \frac{\left\lVert\sum_{j\ne j^*} \alpha_j \boldsymbol{\omega}_j \right\rVert_2}{\sqrt{\sum_{j\ne j^*} \alpha_j^2}}.

The residual amplification factor κ\kappa quantifies the contribution of other channels after removing the dominant column j∗j^*. In the following proposition, κ\kappa controls how strongly the non-dominant columns can perturb the energy distribution of the output.

Proposition 4.6. Let

τ=κ1−pj∗(α)pj∗(α).(10)\tau= \kappa\sqrt{\frac{1-p_{j^*}(\alpha)}{p_{j^*}(\alpha)}}. \tag*{(10)}

We have

∣R(y∗)−R(ωj∗)∣≤Δ(∣sin⁡∠(y∗,ωj∗)∣)≤Δ(τ),(11)\left|R(y^*) - R(\boldsymbol{\omega}_{j^*})\right| \le\Delta\left(\left|\sin\angle(y^*,\boldsymbol{\omega}_{j^*})\right|\right) \le\Delta(\tau), \tag*{(11)}

where for t∈(0,1−1d)t \in\left(0,1-\frac{1}{d}\right), the function Δ\Delta is defined as Δ(t)=−tlog⁡t−(1−t)log⁡(1−t)+tlog⁡(d−1)\Delta(t)=-t\log t-(1-t)\log(1-t)+t\log(d-1).

Proof. See Appendix § 11.§ 2.

Proposition 4.6 indicates that when pj∗(α)p_{j^*}(\alpha) is large (i.e., close to 1), we have τ≈0\tau\approx0, and there is almost no gap between the concentration degree of y∗y^* and that of ωj∗\omega_{j^*}.

In the case of LLaMA-3.2-1B, the output yy of the FFN is largely controlled by the j∗j^*-th (1417th) column of Wdown\mathbf{W}_{\mathrm{down}}. We next depict ωj∗\omega_{j^*} in Figure 3b. Comparing Figure 3b to Figure 1b, we find that these two vectors are highly co-linear, empirically with ∣sin⁡∠(y∗,ωj∗)∣=0.0055|\sin\angle(y^*,\omega_{j^*})| = 0.0055. For other columns such as columns 0 and 1 in Figure 3c and Figure 3d, the parameters have lower maximum magnitudes and do not contain the pattern of massive activations. Note that both y∗y^* and ωj∗\omega_{j^*} are computed only from the pretrained weight matrices. We show that when the value of channel i∗i^* is large enough, the actual output yy is dominated by ωj∗\omega_{j^*}, which leads to y≈x2y∗≈x2αj∗ωj∗y \approx x^2 y^* \approx x^2 \alpha_{j^*}\omega_{j^*}. If αj∗\alpha_{j^*} has a large magnitude and ωj∗\omega_{j^*} is highly concentrated (i.e., contains the pattern of massive activations), the output yy should exhibit the same pattern. Below, we summarize the mechanism by which the MAGC in the input to a spike FFN leads to its output that exhibits massive activations.

Key Takeaway 2: When the MAGC of an input embedding to the spike FFN takes a sufficiently large (or small) value, the output of the FFN asymptotically approaches x2∑j=1mαjωjx^2 \sum_{j=1}^{m}\alpha_j\omega_j, where ωj\omega_j is the normalized jj-th column of Wdown\mathbf{W}_{\mathrm{down}} of the FFN and xx is the value of the MAGC. Moreover, the coefficients α=(α1,…,αm)\alpha= (\alpha_1,\ldots,\alpha_m) concentrate on one (or a few) dimensions. As a result, the FFN output is reduced to one normalized column of Wdown\mathbf{W}_{\mathrm{down}} or a combination of a few normalized columns of Wdown\mathbf{W}_{\mathrm{down}}, multiplied by their respective coefficient and x2x^2. Since these columns exhibit the shape of massive activations, the output therefore exhibits massive activations.

Extension

Extension to Other LLMs

In this section, we examine the generality of our findings across LLMs of different model families and sizes. Specifically, we study LLaMA-2-7B, Qwen2.5-1.5B, QwQ-32B, Ministral-3-3B-Instruct-2512, and DeepSeek-R1-Distill-Llama-8B. Together with LLaMA-3.2-1B, these models cover four model families and range from 1B to 32B parameters. Based on our empirical findings, we propose an empirical method to identify the MAGC as detailed in Appendix D. For each model, we repeat the procedure in the preceding sections: we localize the spike FFN, identify MAGC i∗i^* and its gating direction, and find the dominant column(s) JJ of Wdown\mathbf{W}_{\mathrm{down}}. Table 1 summarizes the results, and the corresponding visualizations are provided in Appendix D.

Model NameSpike FFN BlockMAGC(i∗i^*)DirectionConcentrated Columns(JJ)
LLaMA-3.2-1B1894+1417
LLaMA-2-7B1310+10411, 7890
Qwen2.5-1.5B11395-5601, 3295, 3750
QwQ-32B44626-11696, 1368
Ministral-3-3B22-0, 2
Deepseek-R1-8B1717+2427, 198

Table 1. MAGC in different models. The spike FFN block, MAGC i∗i^*, and concentrated column ids are counted from 0. The concentrated columns are identified by first selecting the three columns ωj\omega_j of the down-projection matrix with the largest absolute αj\alpha_j values and then filtering out the selected columns that do not satisfy ∣cos⁡(ωj,y0)∣>0.9|\cos(\omega_j,y_0)| > 0.9.

We highlight the following findings. First, the spike FFN consistently occurs near the beginning of the network. Notably, even for QwQ-32B with 64 transformer blocks, the spike FFN is located at block 4. Second, the position i∗i^* of MAGC is fixed for a specific model but differs across models, as does the gating direction. Third, the dominant column is not always unique. For LLaMA-3.2-1B, the energy distribution pj(α)p_j(\alpha) is dominated by a single column of Wdown\mathbf{W}_{\mathrm{down}}. For the remaining models, however, two or three columns share the dominant energy. As shown in Appendix D, the columns in JJ exhibit highly similar shapes and concentrate their mass on the same small set of output channels, so their weighted combination y∗y^* remains concentrated and reproduces the pattern of massive activations. In contrast, a randomly selected column distributes its mass much more broadly across channels.

Relation to Attention Sink

Attention sink is commonly attributed to massive activations [10, 15]. Our previous results show that massive activations can be controlled by MAGC. We now extend this finding to adjust attention sink using MAGC.

Experimental Setup. We feed ten natural sentences to LLaMA-3.2-1B and intervene only on MAGC of the first token: at the input to the spike FFN (block 1), we overwrite h0(i∗)h_0(i^*) with a prescribed value cc and leave all other channels and all other tokens unchanged. We then measure the attention sink of the first token in the following block (block 2) using the sink score [6],

s0=1H(T+1)∑h=0H−1∑t=0TAt,0h,(12)s_0 = \frac{1}{H(T+1)} \sum_{h=0}^{H-1} \sum_{t=0}^{T} A_{t,0}^{h}, \tag*{(12)}

where At,0hA_{t,0}^{h} denotes the post-softmax attention that the tt-th query assigns to the first token in the hh-th head, T+1T+1 is the sequence length, and HH is the number of attention heads. Since the first token is visible to all queries under the causal mask, s0s_0 is the average fraction of attention that the first token receives, and s0s_0 close to 1 indicates a dominant attention sink.

Results. Figure 4 reports the sink score s0s_0 as a function of MAGC value cc. Without intervention, the original MAGC value is 8.81, at which the first token attracts s0=0.89s_0 = 0.89 of the attention mass. As cc varies, the sink score shows a sharp step-like transition. For c≥−2.5c \ge-2.5, s0s_0 stays near 0.89, together with massive activations, as shown at c=+25c = +25. For sufficiently negative cc, the sink collapses. The sink score drops to about 0.46 for c≤−7.5c \le-7.5, while the massive activations disappear, as shown at c=−25c = -25. The transition is consistent across sentences, with standard deviation below 0.03 throughout the sweep. Therefore, adjusting the MAGC value in the embedding of an input spike token to the spike FFN can adjust the sink mass on the token.

Sink score and FFN output for the first token

Figure 4. Sink score of the first token in LLaMA-3.2-1B, measured in the attention of block 2, as a function of the value assigned to MAGC (i∗=894i^* = 894) of the first token at the input of the spike FFN (block 1). Thin curves correspond to the ten individual sentences, the thick curve to their mean, and the shaded area to one standard deviation. The unmodified average value of MAGC is 8.81.

Conclusion and Future Work

In this study, we show how tokens develop massive activations in pretrained transformers and identify the massive activation gating channel (MAGC): a channel in the input to an early FFN whose value gates the emergence of massive activations. We show both empirically and theoretically that once MAGC is large or small enough, the spike FFN asymptotically collapses into a quadratic mixing of a few highly concentrated columns of the down-projection matrix, which reproduces the massive-activation pattern. This finding holds across six LLMs from four families ranging from 1B to 32B parameters.

Our analysis has several limitations that suggest directions for future work. First, it focuses on decoder-only LLMs with gated (such as SwiGLU) FFNs; extending the framework to mixture-of-experts architectures is a natural next step. Second, we localize a single spike FFN and a single gating channel per model, whereas a few models exhibit more diffuse behavior across several channels or columns; a multi-channel account may be needed for such cases. Finally, our study is purely mechanistic at inference time and does not explain why a particular channel becomes MAGC during pretraining, which we leave for future investigation.

AI Use Statement

In this work, we used generative AI tools for paper proofreading and code writing. We have not used generative AI tools for literature review, idea formalization, and drafting the manuscript. We have reviewed all AI-assisted work. For example, LLM-generated code was verified by the authors. We take responsibility for the originality of this work.

Reproducibility Statement

We have released all code needed to reproduce the results in this work at GitHub1. It includes scripts for identifying the MAGC, running the intervention experiments, and generating figures. All experiments use publicly available pretrained models.

Generalization of Near Identity Assumption for SiLU

Following Sun et al. [11], we compute the cosine similarity between the gate pre-activation WgatehtW_{\mathrm{gate}}h_t and its activation SiLU⁡(Wgateht)\operatorname{SiLU}(W_{\mathrm{gate}}h_t), and the ratio of their ℓ2\ell_2 norms for spike tokens. Using the randomly generated sequences described in § 3, we report in Table A1 both metrics averaged over the first tokens of these sequences. For SiLU to behave approximately as an identity function, both metrics should be close to 1. Among the models examined, this condition is approximately satisfied only by LLaMA-2-7B.

ModelMetricToken 0
LLaMA-2-7BCosine sim.0.9719
LLaMA-2-7BNorm ratio0.8103
LLaMA-3.2-1BCosine sim.0.8623
LLaMA-3.2-1BNorm ratio0.6232
Qwen2.5-1.5BCosine sim.0.2276
Qwen2.5-1.5BNorm ratio0.1564
QwQ-32BCosine sim.0.2990
QwQ-32BNorm ratio0.1186
Ministral-3-3BCosine sim.0.7895
Ministral-3-3BNorm ratio0.7897
Deepseek-R1-8BCosine sim.0.9215
Deepseek-R1-8BNorm ratio0.7720

Table A1. Input-output characteristics of SiLU in the spike FFN across models.

Additional Experiments for LLaMA-3.2-1B

Massive Activations

Figure A1 shows the block-wise differences of the top-3 channel magnitudes of the transformer block outputs x+u+yx + u + y in LLaMA-3.2-1B. As depicted, the differences exhibit a single sharp jump at the second transformer block, where the spike FFN triggers massive activations. In the subsequent middle blocks, the differences remain close to zero, indicating that no further massive activations are triggered and that the residual stream alone preserves the existing ones until the late blocks.

Input and Output of the Spike FFN for other Sample Sequences

Following § 3, we depict the activations of the other 4 randomly generated sequences in Figure A2.

Pareto Inputs for the Spike FFN

Output of the spike FFN for Pareto-distributed input vectors

Figure A4. From top to bottom, the figure shows the output of the spike FFN when the input vector values are randomly sampled from a Pareto distribution (a=5a = 5), with the input value of the 894th (MAGC), 0th, or 1742nd channel swapped with the maximum input value, respectively.

Proofs

Proof of Theorem 4.1

Theorem C.1. Given input h(x)=x⋅ei+hˉh(x)=x\cdot e_i+\bar{h}. When x→+∞x\to+\infty, the output of an FFN has a quadratic form y(h(x))=x2⋅y∗+o(x2)y(h(x))=x^2\cdot y^*+o(x^2) with constant y∗∈Rdy^*\in\mathbb{R}^d equals to

y∗=∑j=1mαj⋅ωj(13)y^*=\sum_{j=1}^{m}\alpha_j\cdot\omega_j \tag*{(13)}

where α=(α1,…,αm)\alpha=(\alpha_1,\ldots,\alpha_m) is the combination of coefficients in the weight matrices:

αj={Wgate(j,i)Wup(j,i)∥Wdown(:,j)∥2Wgate(j,i)>00Wgate(j,i)≤0.(14)\alpha_j= \begin{cases} W_{\mathrm{gate}}^{(j,i)}W_{\mathrm{up}}^{(j,i)}\left\lVert W_{\mathrm{down}}^{(:,j)}\right\rVert_2 & W_{\mathrm{gate}}^{(j,i)}>0 \\ 0 & W_{\mathrm{gate}}^{(j,i)}\leq0 \end{cases}. \tag*{(14)}

Proof. Based on Equation (4), the linear representation of Wgateh(x)W_{\mathrm{gate}}h(x) and Wuph(x)W_{\mathrm{up}}h(x) can be written as

Wgateh(x)=xWgate(:,i)+bgate(15)W_{\mathrm{gate}}h(x)=xW_{\mathrm{gate}}^{(:,i)}+b_{\mathrm{gate}} \tag*{(15)}
Wuph(x)=xWup(:,i)+bup(16)W_{\mathrm{up}}h(x)=xW_{\mathrm{up}}^{(:,i)}+b_{\mathrm{up}} \tag*{(16)}

where bgate=∑i=1dhˉiWgate(:,i)b_{\mathrm{gate}} = \sum_{i=1}^{d} \bar{h}_i W_{\mathrm{gate}}^{(:,i)} and bup=∑i=1dhˉiWup(:,i)b_{\mathrm{up}} = \sum_{i=1}^{d} \bar{h}_i W_{\mathrm{up}}^{(:,i)} are both constant under xx.

We have the asymptotic property of SiLU⁡(x)\operatorname{SiLU}(x):

lim⁡x→+∞SiLU⁡(Wgateh(x))x={Wgate(j,i)Wgate(j,i)≥00Wgate(j,i)<0(17)\lim_{x \to+\infty} \frac{\operatorname{SiLU}(W_{\mathrm{gate}}h(x))}{x} = \begin{cases} W_{\mathrm{gate}}^{(j,i)} & W_{\mathrm{gate}}^{(j,i)} \ge0 \\ 0 & W_{\mathrm{gate}}^{(j,i)} < 0 \end{cases} \tag*{(17)}

and the asymptotic property of Wuph(x)W_{\mathrm{up}}h(x):

lim⁡x→+∞Wuph(x)x=Wup(:,i)(18)\lim_{x \to+\infty} \frac{W_{\mathrm{up}}h(x)}{x} = W_{\mathrm{up}}^{(:,i)} \tag*{(18)}

Finally,

lim⁡x→+∞y(h(x))x2=Wdownlim⁡x→+∞SiLU⁡(Wgateh(x))x⊙lim⁡x→+∞Wuph(x)x=∑j=1mαj⋅ωj,(19)\lim_{x \to+\infty} \frac{y(h(x))}{x^2} = W_{\mathrm{down}} \lim_{x \to+\infty} \frac{\operatorname{SiLU}(W_{\mathrm{gate}}h(x))}{x} \odot \lim_{x \to+\infty} \frac{W_{\mathrm{up}}h(x)}{x} = \sum_{j=1}^{m} \alpha_j \cdot\omega_j, \tag*{(19)}

where α=(α1,…,αm)\alpha= (\alpha_1,\ldots,\alpha_m) is

αj={Wgate(j,i)Wup(j,i)∥Wdown(:,j)∥2Wgate(j,i)>00Wgate(j,i)≤0(20)\alpha_j = \begin{cases} W_{\mathrm{gate}}^{(j,i)}W_{\mathrm{up}}^{(j,i)} \left\|W_{\mathrm{down}}^{(:,j)}\right\|_2 & W_{\mathrm{gate}}^{(j,i)} > 0 \\ 0 & W_{\mathrm{gate}}^{(j,i)} \le0 \end{cases} \tag*{(20)}

Proof of Proposition 4.6

Recall that

y∗=∑j=1mαjωj,∥ωj∥2=1.y^* = \sum_{j=1}^{m} \alpha_j \omega_j, \qquad\|\omega_j\|_2 = 1.

The energy distribution of α\alpha is

pj(α)=αj2∥α∥22,j=1,…,m.p_j(\alpha) = \frac{\alpha_j^2}{\|\alpha\|_2^2}, \qquad j = 1,\ldots,m.

Let j∗=arg⁡max⁡jpj(α)j^* = \arg\max_j p_j(\alpha) be the dominant coefficient index. Then y∗y^* can be decomposed into the dominant column and the residual part:

y∗=αj∗ωj∗+∑j≠j∗αjωj.y^* = \alpha_{j^*}\omega_{j^*} + \sum_{j \ne j^*} \alpha_j \omega_j.

Define the residual vector

r=∑j≠j∗αjωj.r = \sum_{j \ne j^*} \alpha_j \omega_j.

The residual amplification factor is defined as in Definition 4.5,

κ=∥r∥2∑j≠j∗αj2.\kappa= \frac{\|r\|_2}{\sqrt{\sum_{j \ne j^*} \alpha_j^2}}.

The angular deviation between the true asymptotic output and the dominant column is

∣sin⁡∠(y∗,ωj∗)∣=1−(y∗⋅ωj∗∥y∗∥2∥ωj∗∥2)2.\left|\sin\angle(y^*, \omega_{j^*})\right| = \sqrt{1 - \left(\frac{y^* \cdot\omega_{j^*}}{\|y^*\|_2\|\omega_{j^*}\|_2}\right)^2}.

Finally, for τ∈(0,1−1d)\tau\in\left(0, 1 - \frac{1}{d}\right), define

Δ(τ)=−τlog⁡τ−(1−τ)log⁡(1−τ)+τlog⁡(d−1).\Delta(\tau) = -\tau\log\tau- (1-\tau)\log(1-\tau) + \tau\log(d-1).

Lemma C.2. Assume ∣sin⁡∠(y∗,ωj∗)∣≤1−1d\left|\sin\angle(y^*, \omega_{j^*})\right| \le1 - \frac{1}{d}. Then,

∣R(y∗)−R(ωj∗)∣≤Δ(∣sin⁡∠(y∗,ωj∗)∣).\left|R(y^*) - R(\omega_{j^*})\right| \le\Delta\left(\left|\sin\angle(y^*, \omega_{j^*})\right|\right).

Proof. Based on the Fannes-Audenaert inequality:

∣R(y∗)−R(ωj∗)∣=∣H(ωj∗)−H(ωj∗)∣≤Δ(t),\lvert R(\mathbf{y}^{*}) - R(\boldsymbol{\omega}_{j^{*}}) \rvert= \lvert H(\boldsymbol{\omega}_{j^{*}}) - H(\boldsymbol{\omega}_{j^{*}}) \rvert\le\Delta(t),

where t:=12∥p(y∗)−p(ωj∗)∥1t := \frac{1}{2}\lVert p(\mathbf{y}^{*}) - p(\boldsymbol{\omega}_{j^{*}}) \rVert_{1} and HH is the entropy function. We have

12∥p(y∗)−p(ωj∗)∥1=12∑i=1d∣(yi∗∥y∗∥2)2−(ωj∗,i∥ωj∗∥2)2∣=12∑i=1d∣(yi∗∥y∗∥2−ωj∗,i∥ωj∗∥2)(yi∗∥y∗∥2+ωj∗,i∥ωj∗∥2)∣≤12[∑i=1d(yi∗∥y∗∥2−ωj∗,i∥ωj∗∥2)2]1/2[∑i=1d(yi∗∥y∗∥2+ωj∗,i∥ωj∗∥2)2]1/2=12[2−2y∗⋅ωj∗∥y∗∥2∥ωj∗∥2]1/2[2+2y∗⋅ωj∗∥y∗∥2∥ωj∗∥2]1/2=[1−(y∗⋅ωj∗∥y∗∥2∥ωj∗∥2)2]1/2=∣sin⁡∠(y∗,ωj∗)∣.\begin{aligned} \frac{1}{2}\lVert p(\mathbf{y}^{*}) - p(\boldsymbol{\omega}_{j^{*}}) \rVert_{1} = \frac{1}{2}\sum_{i=1}^{d}\left\lvert\left(\frac{y_i^{*}}{\lVert\mathbf{y}^{*}\rVert_{2}}\right)^2 - \left(\frac{\omega_{j^{*},i}}{\lVert\boldsymbol{\omega}_{j^{*}}\rVert_{2}}\right)^2 \right\rvert\\ &= \frac{1}{2}\sum_{i=1}^{d}\left\lvert\left(\frac{y_i^{*}}{\lVert\mathbf{y}^{*}\rVert_{2}} - \frac{\omega_{j^{*},i}}{\lVert\boldsymbol{\omega}_{j^{*}}\rVert_{2}}\right)\left(\frac{y_i^{*}}{\lVert\mathbf{y}^{*}\rVert_{2}} + \frac{\omega_{j^{*},i}}{\lVert\boldsymbol{\omega}_{j^{*}}\rVert_{2}}\right) \right\rvert\\ &\le\frac{1}{2}\left[\sum_{i=1}^{d}\left(\frac{y_i^{*}}{\lVert\mathbf{y}^{*}\rVert_{2}} - \frac{\omega_{j^{*},i}}{\lVert\boldsymbol{\omega}_{j^{*}}\rVert_{2}}\right)^2\right]^{1/2}\left[\sum_{i=1}^{d}\left(\frac{y_i^{*}}{\lVert\mathbf{y}^{*}\rVert_{2}} + \frac{\omega_{j^{*},i}}{\lVert\boldsymbol{\omega}_{j^{*}}\rVert_{2}}\right)^2\right]^{1/2} \\ &= \frac{1}{2}\left[2 - 2\frac{\mathbf{y}^{*}\cdot\boldsymbol{\omega}_{j^{*}}}{\lVert\mathbf{y}^{*}\rVert_{2}\lVert\boldsymbol{\omega}_{j^{*}}\rVert_{2}}\right]^{1/2}\left[2 + 2\frac{\mathbf{y}^{*}\cdot\boldsymbol{\omega}_{j^{*}}}{\lVert\mathbf{y}^{*}\rVert_{2}\lVert\boldsymbol{\omega}_{j^{*}}\rVert_{2}}\right]^{1/2} \\ &= \left[1 - \left(\frac{\mathbf{y}^{*}\cdot\boldsymbol{\omega}_{j^{*}}}{\lVert\mathbf{y}^{*}\rVert_{2}\lVert\boldsymbol{\omega}_{j^{*}}\rVert_{2}}\right)^2\right]^{1/2} \\ &= \lvert\sin\angle(\mathbf{y}^{*},\boldsymbol{\omega}_{j^{*}}) \rvert. \end{aligned}

Since Δ(t)\Delta(t) is increasing on 0≤t≤1−1d0 \le t \le1 - \frac{1}{d},

∣R(y∗)−R(ωj∗)∣≤Δ(min⁡{∣sin⁡∠(y∗,ωj∗)∣,1−1d})=Δ(∣sin⁡∠(y∗,ωj∗)∣).\lvert R(\mathbf{y}^{*}) - R(\boldsymbol{\omega}_{j^{*}}) \rvert\le\Delta\left(\min\left\{\lvert\sin\angle(\mathbf{y}^{*},\boldsymbol{\omega}_{j^{*}})\rvert,1-\frac{1}{d}\right\}\right) = \Delta\left(\lvert\sin\angle(\mathbf{y}^{*},\boldsymbol{\omega}_{j^{*}})\rvert\right).

Proposition C.3. Let

τ=κ1−pj∗(α)pj∗(α).(21)\tau= \kappa\sqrt{\frac{1-p_{j^{*}}(\alpha)}{p_{j^{*}}(\alpha)}}. \tag*{(21)}

We have

∣R(y∗)−R(ωj∗)∣≤Δ(τ),(22)\lvert R(\mathbf{y}^{*}) - R(\boldsymbol{\omega}_{j^{*}}) \rvert\le\Delta(\tau), \tag*{(22)}

where for τ∈(0,1−1d)\tau\in(0,1-\frac{1}{d}), Δ(τ)=−τlog⁡τ−(1−τ)log⁡(1−τ)+τlog⁡(d−1)\Delta(\tau)=-\tau\log\tau-(1-\tau)\log(1-\tau)+\tau\log(d-1).

Proof. Recall r=∑j≠j∗αjωj\mathbf{r}=\sum_{j\ne j^{*}}\alpha_j\boldsymbol{\omega}_j, then y∗=αj∗ωj∗+r\mathbf{y}^{*}=\alpha_{j^{*}}\boldsymbol{\omega}_{j^{*}}+\mathbf{r}. Since ∥ωj∗∥2=1\lVert\boldsymbol{\omega}_{j^{*}}\rVert_{2}=1, decompose the residual vector as

r=r∥ωj∗+r⊥,r⊥⊥ωj∗.\mathbf{r}=r_{\parallel}\boldsymbol{\omega}_{j^{*}}+\mathbf{r}_{\perp}, \qquad\mathbf{r}_{\perp}\perp\boldsymbol{\omega}_{j^{*}}.

We have

y∗=(αj∗+r∥)ωj∗+r⊥.\mathbf{y}^{*}=(\alpha_{j^{*}}+r_{\parallel})\boldsymbol{\omega}_{j^{*}}+\mathbf{r}_{\perp}.

The angular deviation from ωj∗\boldsymbol{\omega}_{j^{*}} is caused only by the perpendicular residual component. Hence,

∣sin⁡∠(y∗,ωj∗)∣=∥r⊥∥2[(αj∗+r∥)2+∥r⊥∥22]1/2\left\lvert\sin\angle(\mathbf{y}^{*},\boldsymbol{\omega}_{j^{*}})\right\rvert= \frac{\lVert\mathbf{r}_{\perp}\rVert_{2}}{\left[(\alpha_{j^{*}}+r_{\parallel})^2+\lVert\mathbf{r}_{\perp}\rVert_{2}^{2}\right]^{1/2}}
≤r∥2+∥r⊥∥22∣αj∗∣=∥r∥2∣αj∗∣.\le\frac{\sqrt{r_{\parallel}^{2}+\lVert\mathbf{r}_{\perp}\rVert_{2}^{2}}}{\lvert\alpha_{j^{*}}\rvert}=\frac{\lVert\mathbf{r}\rVert_{2}}{\lvert\alpha_{j^{*}}\rvert}.

The above inequality follows because, after squaring and rearranging, it is equivalent to

0≤(r∥(αj∗+r∥)+∥r⊥∥22)2.0\le\left(r_{\parallel}(\alpha_{j^{*}}+r_{\parallel})+\lVert\mathbf{r}_{\perp}\rVert_{2}^{2}\right)^2.

Moreover,

∥r∥2∣αj∗∣=κ∑j≠j∗αj2∣αj∗∣=κ1−pj∗(α)pj∗(α).\frac{\lVert\mathbf{r}\rVert_{2}}{\lvert\alpha_{j^{*}}\rvert}=\kappa\frac{\sqrt{\sum_{j\ne j^{*}}\alpha_j^2}}{\lvert\alpha_{j^{*}}\rvert}=\kappa\sqrt{\frac{1-p_{j^{*}}(\alpha)}{p_{j^{*}}(\alpha)}}.

Therefore,

∣sin⁡∠(y∗,ωj∗)∣≤κ1−pj∗(α)pj∗(α).\left|\sin\angle(\mathbf{y}^{*},\boldsymbol{\omega}_{j^{*}})\right| \le\kappa\sqrt{\frac{1-p_{j^{*}}(\alpha)}{p_{j^{*}}(\alpha)}}.

Based on Lemma C.2, it is sufficient to prove Proposition 4.6.

Additional Results

Identification of the Spike FFN and MAGC. We identify the spike FFN and MAGC by comparing the first (spike) token and the second (non-spike) token of the randomly generated sequences. Let y0ly_0^l denote the average FFN output of the first token in the ll-th transformer block. We regard an FFN as the spike FFN if its output exhibits an outlier channel [10], i.e.,

max⁡j∣y0l(j)∣>100andmax⁡j∣y0l(j)∣>10⋅median⁡j∣y0l(j)∣.(23)\max_j \left|y_0^l(j)\right| > 100 \quad\text{and} \quad\max_j \left|y_0^l(j)\right| > 10 \cdot\operatorname{median}_j \left|y_0^l(j)\right|. \tag*{(23)}

Given the spike FFN, we then identify MAGC from its inputs. Let h0\mathbf{h}_0 and h1\mathbf{h}_1 be the average inputs to the spike FFN for the first and second tokens, respectively. The gating channel should be the channel where the two inputs deviate the most. We therefore locate MAGC as

i∗=arg⁡max⁡j∣h0(j)−h1(j)∣,(24)i^{*} = \arg\max_j \left|h_0(j)-h_1(j)\right|, \tag*{(24)}

and determine the gating direction by the sign of h0(i∗)−h1(i∗)h_0(i^{*})-h_1(i^{*}): a positive (negative) sign indicates that massive activations emerge when the value of MAGC becomes sufficiently large (small).

This appendix reports the detailed results for the models summarized in Table 1: LLaMA-2-7B (Figure A5), Qwen2.5-1.5B (Figure A6), QwQ-32B (Figure A7), Ministral-3-3B-Instruct-2512 (Figure A8), and DeepSeek-R1-Distill-Llama-8B (Figure A9). For each model, we present (i) the input h\mathbf{h} and outputs y\mathbf{y} of the spike FFN for a random input sequence, (ii) the coefficient vector α\alpha defined in Theorem 4.1, where for models with a negative gating direction α\alpha is computed under the limit x→−∞x \to-\infty and the condition on Wgate(j,i)W_{\mathrm{gate}}^{(j,i)} flips sign accordingly, and (iii) the dominant columns (the columns most aligned with the output y0\mathbf{y}_0, as reported in Table 1) together with a randomly selected column for comparison.

Input $h$ to FFN

(a) (a) Input hh to FFN.

Output $y$ of FFN

(b) (b) Output yy of FFN.

The $\alpha$ vector when $i^*=310$

(c) (c) α\alpha vector when i∗=310i^*=310.

The $\omega_{10411}$ vector

(d) (d) ω10411\omega_{10411}.

The $\omega_{7890}$ vector

(e) (e) ω7890\omega_{7890}.

The $\omega_0$ vector

(f) (f) ω0\omega_0.

Figure A5. Results for LLaMA-2-7b-hf.

Results for Qwen2.5-1.5b., including (a) Input $h$ to FFN, (b) Output $y$ of FFN, (c) $\alpha$ vector when $i^{*}=1395$, (d) $\omega_{5601}$, (e) $\omega_{3295}$, and (f) $\omega_{3750}$

Figure A6. (a) Input hh to FFN. (b) Output yy of FFN. (c) α\alpha vector when i∗=1395i^{*}=1395. (d) ω5601\omega_{5601}. (e) ω3295\omega_{3295}. (f) ω3750\omega_{3750}. Figure A6: Results for Qwen2.5-1.5b.

Results for QwQ-32B: input and output of the FFN, $\alpha$ vector, and down matrix columns $\omega_{11696}$, $\omega_{1368}$, and $\omega_0$

Figure A7. Results for QwQ-32B. For QwQ-32B, several of the channels with the largest input difference ∣h0(j)−h1(j)∣|h_0(j)-h_1(j)| coincide with massive-activation channels propagated through the residual stream; we therefore identify the MAGC (i∗=4626i^* = 4626, negative gating direction) by traversing the ten channels with the largest such difference following Equation (24) and selecting the first one that is not itself a massive-activation channel, rather than simply taking the single largest.

Results for Ministral-3-3B-Instruct-2512

Figure A8. Results for Ministral-3-3B-Instruct-2512. Note that columns 0 and 2 belong to j∗j^*. Instead of choosing 0 as the random column for comparison, we select column 1.

Results for DeepSeek-R1-Distill-Llama-8B

Figure A9. (a) Input hh to FFN. (b) Output yy of FFN. (c) α\alpha vector when i∗=717i^*=717. (d) ω2427\omega_{2427}. (e) ω198\omega_{198}. (f) ω0\omega_0. Figure A9: Results for DeepSeek-R1-Distill-Llama-8B.

References

  1. [1]Joshua Ainslie, James Lee-Thorp, Michiel De Jong, Yury Zemlyansky, Federico Lebrón, and Sumit Sangh‍ai. Gqa: Training generalized multi-query transformers from multi-headed checkpoints. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pp. 4895–4901, 2023.
  2. [2]Federico Barbero, Alvaro Arroyo, Xiangming Gu, Christos Perivolaropoulos, Petar Veličković, Razvan Pascanu, and Michael M Bronstein. Why do llms attend to the first token? In Second Conference on Language Modeling, 2025.arxiv.org/abs/2504.02732
  3. [3]Sébastien Bubeck, Varun Chandrasekaran, Ronen Eldan, Johannes Gehrke, Eric Horvitz, Ece Kamar, Peter Lee, Yin Tat Lee, Yuanzhi Li, Scott Lundberg, et al. Sparks of artificial general intelligence: Early experiments with gpt-4. arXiv preprint arXiv:2303.12712, 2023.arxiv.org/abs/2303.12712
  4. [4]Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, Abhishek Kadian, Ahmad Al-Dahle, Aiesha Letman, Akhil Mathur, Alan Schelten, Amy Yang, Angela Fan, et al. The llama 3 herd of models. arXiv e-prints, pp. arXiv–2407, 2024.arxiv.org/abs/2407.21783
  5. [5]Suyu Ge, Yunan Zhang, Liyuan Liu, Minjia Zhang, Jiawei Han, and Jianfeng Gao. Model tells you what to discard: Adaptive kv cache compression for llms. arXiv preprint arXiv:2310.01801, 2023.arxiv.org/abs/2310.01801
  6. [6]Xiangming Gu, Tianyu Pang, Chao Du, Qian Liu, Fengzhuo Zhang, Cunxiao Du, Ye Wang, and Min Lin. When attention sink emerges in language models: An empirical view. In International Conference on Learning Representations, volume 2025, pp. 97114–97144, 2025.arxiv.org/abs/2410.10781
  7. [7]Xu Liu, Guikun Chen, and Wenguan Wang. Sinktrack: Attention sink based context anchoring for large language models. In The Fourteenth International Conference on Learning Representations, 2026.arxiv.org/abs/2604.10027
  8. [8]Noam Shazeer. Glu variants improve transformer. arXiv preprint arXiv:2002.05202, 2020.arxiv.org/abs/2002.05202
  9. [9]Seungwoo Son, Wonpyo Park, Woohyun Han, Kyueyun Kim, and Jaeho Lee. Prefixing attention sinks can mitigate activation outliers for large language model quantization. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, pp. 2242–2252, 2024.arxiv.org/abs/2406.12016
  10. [10]Mingjie Sun, Xinlei Chen, J Zico Kolter, and Zhuang Liu. Massive activations in large language models. In First Conference on Language Modeling, 2024.arxiv.org/abs/2402.17762
  11. [11]Shangwen Sun, Alfredo Canziani, Yann LeCun, and Jiachen Zhu. The spike, the sparse and the sink: Anatomy of massive activations and attention sinks. arXiv preprint arXiv:2603.05498, 2026.arxiv.org/abs/2603.05498
  12. [12]Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, et al. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971, 2023.arxiv.org/abs/2302.13971
  13. [13]Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017.arxiv.org/abs/1706.03762
  14. [14]Guangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han, and Mike Lewis. Efficient streaming language models with attention sinks. arXiv preprint arXiv:2309.17453, 2023.arxiv.org/abs/2309.17453
  15. [15]Ruiqing Yan, Xingbo Du, Haoyu Deng, Linghan Zheng, Qiuzhuang Sun, Jifang Hu, Yuhang Shao, Penghao Jiang, Jinrong Jiang, and Lian Zhao. Unveiling and controlling anomalous attention distribution in transformers. arXiv preprint arXiv:2407.01601, 2024.arxiv.org/abs/2407.01601
  16. [16]Zhongzhi Yu, Zheng Wang, Yonggan Fu, Huihong Shi, Khalid Shaikh, and Yingyan Celine Lin. Unveiling and harnessing hidden attention sinks: Enhancing large language models without training through attention calibration. arXiv preprint arXiv:2406.15765, 2024.arxiv.org/abs/2406.15765
  17. [17]Biao Zhang and Rico Sennrich. Root mean square layer normalization. Advances in neural information processing systems, 32, 2019.arxiv.org/abs/1910.07467
  18. [18]Stephen Zhang, Mustafa Khan, and Vardan Papyan. Attention sinks: A’catch, tag, release’mechanism for embeddings. Advances in Neural Information Processing Systems, 38:83140–83181, 2026.arxiv.org/abs/2502.00919

Paper details

vlnc:W_7fmpyhad
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

generative AI tools

View statement
Looking for related papers…
Contents