Manuscript Offprint

arXiv:2610.39068

Closed Gates Leak: Decomposing Adjacent-Layer Cancellation in Gated Language Models

Harvey Dam, Ganesh Gopalakrishnan

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

In transformer language models with gated multilayer perceptrons (MLPs), adjacent layers write partly against each other into the residual stream. Previous work interpreted this cancellation as layers proposing features and the next layer selectively rejecting the inappropriate ones. We decompose the cancellation by removing the previous layer's write from the input of the next MLP: what the next layer writes along that write splits into what it writes anyway and how much less its MLP writes because the write is present, which we call the damping, and we trace the damping to the neurons that carry it. In gated MLPs the damping is carried by neurons whose gates are closed. SiLU and GELU are slightly negative below zero, so a closed gate still passes a small negative multiple of what the neuron reads, and a neuron whose output weight points along its input weight then subtracts a fraction of the direction it read. Summed over such neurons, closed gates contract the average direction a gated MLP reads, and the previous layer's write is not singled out: the same layer's write at another token is damped as much or more, and the eigenvalue signature from which that work concluded that the correction is selective appears for another token's write as well. Over training the damping grows while what the next layer writes anyway stays flat, and cancellation begins when the damping overtakes it; annealing the negative side of the gate activation away in continued pretraining removes the damping and the cancellation. Adjacent-layer cancellation is therefore weak evidence about which features a model rejects: it is produced by a contraction that gated MLPs apply, on average over directions, to whatever they read.

1. Introduction

Elhage et al. (2021) describe a transformer's residual stream as a communication channel: each layer reads from the stream and writes back by adding to it, so what one layer writes stays unless another component writes against it. Patrawala et al. (2025) found that adjacent layers do write against each other. Averaged over tokens, the cosine between what layer ii adds to the stream and what layer i+1i+1 adds is ≈−0.2\approx -0.2 in five of seven model families (Llama 3, OLMo, Mistral, Gemma and Qwen2), most strongly in the first two-thirds of the network, while layers further apart do not cancel on average. The effect is absent at initialisation and grows during pretraining, and they find the multilayer perceptrons (MLPs) primarily responsible. They interpret the cancellation through a propose-and-reject framework, in which layers propose candidate features and subsequent layers selectively correct the inappropriate ones, a hypothesis they state they do not test; from the eigenvalues of each layer's Jacobian they conclude that the correction is selective rather than a uniform attenuation. If that interpretation holds, adjacent-layer cancellation shows which features a model rejects, and the components that write against the previous layer are where the rejection is computed.

We ask what in the next layer writes against the previous one, and whether it singles out what that layer wrote. Removing the previous layer's write from the next MLP's input splits the next layer's output along that write into three parts: what its attention writes along it, what its MLP writes along it with the write absent (co-writing), and how much less the MLP writes along it because the write is present (damping). By definition the pair cancels when the damping exceeds the other two. The content is in the sizes of the parts, in which neurons carry the damping, and in whether the write is damped differently from other directions.

We find that the next MLP damps the previous layer's write less than it damps the same layer's write at another token; that in gated models this damping is carried by neurons whose gates are closed, where SiLU and GELU are slightly negative; and that adjacent layers cancel where this contraction outweighs what the next layer writes along the previous write anyway. A gated MLP (Shazeer, 2020) computes m(x)=m(x) =

¹Kahlert School of Computing, University of Utah, Salt Lake City, USA. Correspondence to: Harvey Dam harvey.dam@utah.edu.

Preprint. October 30, 2026.

Wdown(ϕ(Wgatez)⊙Wupz)W_{\text{down}}(\phi(W_{\text{gate}}z) \odot W_{\text{up}}z) with zz the normalised stream and ϕ\phi SiLU or GELU. Both are slightly negative below zero, and Gerstner & Schütze (2025) describe how that reverses what a neuron does: a closed gate still passes a small negative multiple of the neuron's input (it leaks), so a neuron whose output weight points along its input weight adds the direction it reads when its gate is open and subtracts a small multiple of that direction when the gate is closed. Between 53% and 91% of the middle layers' neurons are of this strengthening kind, and between 0.62 and 0.83 of the gates are closed at a token. Summed over the closed strengthening neurons, the reversal that prior work described one neuron at a time becomes a contraction of everything the MLP reads, and this contraction carries most or all of the damping of the previous write in all ten gated models we examined, a mixture of experts among them.

This limits what cancellation shows. In all ten gated models the previous write is damped less than the same layer's write at another token. How much more it is damped than a random direction depends on the frame: along the controlled write it is within 9% of a random direction in nine of the ten (20% above it in Phi-3-mini), along the raw write 8% to 20% above it, and through the whole layer's Jacobian 1% to 44% above it. A direction written into the stream is, on average over directions, written against by the next gated MLP by 15% to 46% of its size; single directions spread widely around that average, and a fifth to a third of them are amplified. Cancellation is therefore weak evidence about which features a model rejects, and analyses that read a layer's contribution, or the next layer's response to it, should expect the next gated MLP to write against most contributions, not only against the ones a model rejects.

The contraction depends on an architectural choice, not only on what training learns: 51M-parameter models trained with the gate's negative region removed have 32% of the damping, at a loss two seeds cannot distinguish, and two ReLU conversions of Llama-2-7B keep about a tenth of it. In a model that cancels, the cancellation goes with the negative region. Continued pretraining of Qwen2.5-0.5B with the negative region annealed away leaves a model whose window cosine has gone from −0.184-0.184 to +0.021+0.021, at a loss cost of 0.165 nats, while the same training with the activation unchanged leaves it at −0.170-0.170 (three seeds); Llama-3.2-1B behaves the same (one seed).

References (72)