betaFeedback

WorksComputer Science

Functional Depth Is Learned: Isolating the Computation That Layers Produce Only Together

Abstract

Transformer performance scales with depth, but layer count merely counts the opportunities for sequential computation: layers could still behave as nearly independent refinements that barely depend on one another. We study how transformers develop functional depth during pretraining, introducing an exact inclusion-exclusion decomposition that isolates the connected component, i.e., the computation that appears only when a specified set of layers acts together under identity ablation. Tracking this quantity across public checkpoints of Pythia, OLMo, and Amber yields three findings. First, write-relative connected coordination strengthens from its initialization or earliest-checkpoint baseline as pretraining proceeds, across all measured interaction orders. Second, these connected components are behaviorally consequential under direct intervention: deleting them damages perplexity more than deleting a norm-matched random direction at the same site in all 35 measured model-order cells. Third, pairwise representation similarity is consistently negatively correlated with pairwise connected coordination across seven models, yet the two signals are not interchangeable: similarity- and coordination-based block-removal criteria often agree in Pythia but diverge on Amber. Together, these results suggest that architectural depth provides the opportunity for sequential computation, while pretraining progressively organizes cross-layer dependencies within that depth.

Introduction

Depth is one of the few reliable scaling axes of modern transformers, and recent studies have shown that stacking layers is central to improving model performance [15, 31, 27]. Unfortunately, the mechanism behind what added depth actually buys remains poorly understood. A stacked architecture offers as many opportunities for sequential computation as it has layers, yet a trained model could still behave as a collection of nearly independent refinements [33, 14], with each layer editing the residual stream [5] without depending on combinations of earlier computations. Architectural depth, in other words, is only potential depth. Existing analysis tools—representation similarity [28, 16, 24], layer lenses [1], and layer-skipping and reordering studies [6, 29]—inspect layers individually or in pairs; they can measure what each layer leaves behind, but not the computation that multiple layers produce only when present together.

In this work, we take an initial step toward understanding the dynamics by which functional depth is formed during transformer pretraining. We investigate three important research questions that remain unanswered:

RQ1. Do the layers of a trained transformer actually compute jointly across depth, or do they behave as a stack of independent refinements? And how does this cross-layer coupling structure change over the course of pretraining?

RQ2. Is the computation that layers produce only together behaviorally consequential under direct intervention, relative to an equal-norm perturbation at the same site?

RQ3. Does cross-layer connective structure provide a complementary account of the phenomena reported by layerwise and pairwise analyses?

Our experiments reveal several important insights into the fine-grained dynamics by which functional depth is formed during transformer pretraining.

First, we find that functional depth, operationalized by write-relative connected components, strengthens during pretraining (Figure 1). At initialization or at the earliest released checkpoints [2, 9], normalized connected components are substantially smaller, particularly at higher interaction orders, whereas later checkpoints exhibit larger connected components across all measured orders and depths. Our normalization expresses each connected component relative to the actual write of the final participating layer, allowing us to compare interaction strength against a local write scale rather than raw residual magnitude. The resulting pattern is consistent with pretraining progressively organizing cross-layer interactions across depth. Second, the connected component is causally load-bearing rather than an algebraic remainder. Deleting it damages perplexity more than deleting a norm-matched random direction of the same size at the same site, in all 35 of our measured model–order cells, with the gap exceeding two orders of magnitude in the largest models. Third, representation similarity is systematically associated with weak cross-layer coordination, while the two quantities remain distinct. Across seven models differing in scale and training data, pairwise similarity is consistently negatively correlated with the normalized connected component, so layer pairs with more similar representations tend to exhibit weaker pairwise connected computation.

Development of connected cross-layer coordination during pretraining

Figure 1. Development of connected cross-layer coordination during pretraining (pythia-410m). Each panel visualizes one checkpoint (columns, init–64k steps) at one interaction order kk (rows, k=3k = 3–66): nodes are layers ordered by depth, and each arc spans an adjacent window TT of kk layers, with intensity proportional to its normalized connected component U^T\widehat{U}_{T}, scaled by the order-level ratio RkR_{k}. Coordination is weak relative to later checkpoints at initialization and progressively concentrates into an early-interior band as training proceeds, across every measured order.

Taken together, to the best of our knowledge, this work is among the first attempts to isolate cross-layer joint computation in transformers with an exact estimand and to trace its development. Layer count specifies only the possibility of depth; whether that possibility becomes an organized computation is decided by pretraining. By treating functional depth as an empirical property of a trained computation rather than an architectural hyperparameter, we hope to help the community build a holistic understanding of deep models and make better-informed decisions about pruning, compression, and scaling.

Related Work

Most analyses of transformer depth build on the residual-stream view of each block as an identity map plus a per-layer update [5], and inspect one or two layers at a time: decoding the state at each layer (nostalgebraist 2020; Belrose et al. 2023), comparing pairs of representations [28, 16, 24], or scoring single blocks for skipping, reordering, or pruning [6, 29, 10, 20]. Causal-intervention methods likewise localize behavior by patching activations at chosen sites [21, 34, 7, 3, 35]; the cross-layer attribution methods of Lindsey et al. [18], Dunefsky, Chlenski, and Nanda [4], and Lindsey et al. [17] are closest in spirit, but decompose the representation into features spanning layers. We instead decompose the function: whether one layer’s write changes how later layers compute, including effects requiring three or more layers jointly, with the residual identity

as the null—the only value under which UTU_T vanishes exactly when a participating layer is removed (Section 5.3 contrasts the resulting block-removal rankings with similarity-based ones). Residual networks have been read as ensembles of shallow paths [33] or as iterative inference [14]; the former enumerates subpaths, whereas we isolate what the full path contributes beyond every proper subpath. Formally, our estimand is the Möbius transform, or Harsanyi dividend, of the set function induced by layer ablation [12, 8], standard for input features and tokens [30, 32, 11]. We differ in that the payoff is a vector-valued residual write, the players are non-commutative maps, and the residual-identity null makes the decomposition exact; connecting to studies of training dynamics [23, 26, 13], we track this quantity across pretraining, asking not what a model represents but how many layers must act together before a computation exists at all.

Cross-Layer Coordination

The number of layers the architecture supplies must be distinguished from the depth the trained model actually uses: if each layer edited the residual stream independently of the computations before it, the model would behave less like a deep computation than like a collection of independent refinements applied in sequence. We therefore define cross-layer coordination as follows. If a later layer produces the same update regardless of the outputs of earlier layers, the layers compute independently; if the results of earlier layers change what the later layer computes, the layers coordinate. Coordination is thus not several layers producing large updates, but one layer’s computation depending conditionally on the computations that precede it. Our goal is to isolate the component that appears only when a specified set of layers all act together, and that is not explained by any proper subset.

The Connected Component as Conditional Computation

Consider a pretrained transformer with LL layers, and let h(ℓ)∈Rdh^{(\ell)} \in\mathbb{R}^{d} denote the residual-stream state entering layer ℓ\ell. Each transformer block acts as

fℓ(h)=h+gℓ(h)(1)f_{\ell}(h) = h + g_{\ell}(h) \tag*{(1)}

where gℓ:Rd→Rdg_{\ell} : \mathbb{R}^{d} \to\mathbb{R}^{d} is the full update that layer ℓ\ell’s attention and MLP write to the residual stream.

Consider first two layers i<ji < j acting in sequence, and expand the forward pass directly:

(fj∘fi)(h)=(h+gi(h))⏟output of layer i+gj(h+gi(h))(2)(f_j \circ f_i)(h) = \underbrace{(h + g_i(h))}_{\text{output of layer }i} + g_j\left(h + g_i(h)\right) \tag*{(2)}

In the last term of Eq. (2), layer jj receives as input not the original state hh but the state to which layer ii’s update has already been written: what layer jj computes depends on what layer ii wrote. To isolate this dependence, we split layer jj’s update into a part determined independently of layer ii and a part that is not:

δij(h):=gj(h+gi(h))−gj(h)(3)\delta_{ij}(h) := g_j\left(h + g_i(h)\right) - g_j(h) \tag*{(3)}

gj(h)g_j(h) is the update layer jj produces even without layer ii’s participation, and δij(h)\delta_{ij}(h) is the extent to which layer ii’s write changed layer jj’s computation. If δij(h)=0\delta_{ij}(h) = 0, the two layers are merely placed in sequence and compute independently; if δij(h)≠0\delta_{ij}(h) \ne0, the two layers coordinate. δij\delta_{ij} is therefore a computation that exists only when the two layers are present together.

This quantity can be rewritten in terms of subset forward passes. For a subset S={s1<⋯<sm}⊆TS = \{s_1 < \cdots< s_m\} \subseteq T of a layer set TT, define the result of applying only the layers in SS, in their original depth order, as

FS(h)=(fsm∘⋯∘fs1)(h),F∅(h)=h(4)F^{S}(h) = (f_{s_m} \circ\cdots\circ f_{s_1})(h), \qquad F^{\varnothing}(h) = h \tag*{(4)}

with every unselected layer replaced by the identity map. In this notation F{i,j}(h)F^{\{i,j\}}(h) is Eq. (2), and F{i}(h)=h+gi(h)F^{\{i\}}(h) = h + g_i(h), F{j}(h)=h+gj(h)F^{\{j\}}(h) = h + g_j(h), so

U{i,j}(h):=F{i,j}(h)−F{i}(h)−F{j}(h)+F∅(h)=δij(h)(5)\begin{aligned} U_{\{i,j\}}(h) &:= F^{\{i,j\}}(h) - F^{\{i\}}(h) - F^{\{j\}}(h) + F^{\varnothing}(h) \\ &= \delta_{ij}(h) \tag*{(5)} \end{aligned}

Eq. (5) takes the result of applying the two layers together, removes the effects that each layer explains on its own, and leaves only the component that arises from their sequential composition. The δij\delta_{ij} obtained by expanding the forward pass thus coincides exactly with the result of an inclusion–exclusion operation over the layer set, and this form generalizes directly to three or more layers.

Higher-Order Connected Components

Extending the two-layer definition to three or more layers requires more than inspecting the joint application of all the layers. The full forward pass of kk layers contains not only the computation that requires all of them together, but also every lower-order contribution explained by individual layers and smaller subsets. Isolating genuine order-kk coordination therefore requires removing these lower-order components.

For three layers T={1,2,3}T = \{1,2,3\}, for example, the component that requires all three is

U{1,2,3}(h)=F{1,2,3}(h)−(F{1,2}(h)+F{1,3}(h)+F{2,3}(h))+(F{1}(h)+F{2}(h)+F{3}(h))−F∅(h)(6)\begin{aligned} U_{\{1,2,3\}}(h) ={}& F^{\{1,2,3\}}(h) \\ &- \left(F^{\{1,2\}}(h) + F^{\{1,3\}}(h) + F^{\{2,3\}}(h)\right) \\ &+ \left(F^{\{1\}}(h) + F^{\{2\}}(h) + F^{\{3\}}(h)\right) - F^{\varnothing}(h) \tag*{(6)} \end{aligned}

We take the result of all three layers, remove the effect of each pair of layers, add back the single-layer effects that were removed twice in the process, and finally subtract the untouched input. This inclusion–exclusion cancels every lower-order contribution exactly.

We generalize to arbitrary order. Let

T=(ℓ1<ℓ2<⋯<ℓk)(7)T = (\ell_1 < \ell_2 < \cdots< \ell_k) \tag*{(7)}

be a set of layers with their original depth order retained.

Definition 1 (Connected component). The connected component of a layer set TT is

UT(h)=∑S⊆T(−1)∣T∣−∣S∣FS(h)(8)U_T(h) = \sum_{S \subseteq T} (-1)^{|T|-|S|} F^S(h) \tag*{(8)}

UTU_T is the computation that appears when all selected layers act together but is not explained by the forward pass of any proper subset S⊂TS \subset T. It is thus a vector-valued expression of the coordination of the layer set TT: UT(h)≠0U_T(h) \ne0 means that the joint participation of all selected layers produces a change that does not reduce to the computation of lower-order layer sets.

Distinguishing connected components of this kind that are already present at initialization from coordination formed by training, however, requires accounting not only for the absolute size of UTU_T but also for the scale of the layer update in which this component appears. Because the magnitude of a layer’s write to the residual stream can change over the course of pretraining, an increase in ∥UT∥\lVert U_T \rVert alone does not establish that the connected component has become larger relative to the computation produced at that layer. The structure of UTU_T itself provides a natural normalization. Writing ℓk=max⁡T\ell_k = \max T and T<ℓk=T∖{ℓk}T_{<\ell_k} = T \setminus\{\ell_k\}, and splitting the sum in Eq. (8) by whether ℓk\ell_k is included, we obtain

UT(h)=∑S⊆T<ℓk(−1)k−1−∣S∣gℓk(FS(h))(9)U_T(h) = \sum_{S \subseteq T_{<\ell_k}} (-1)^{k-1-|S|} g_{\ell_k}\left(F^S(h)\right) \tag*{(9)}

Every term in Eq. (9) is an update produced by the final participating layer ℓk\ell_k, evaluated under a different subset-conditioned input. Thus, UTU_T isolates the part of layer ℓk\ell_k’s write associated with the joint presence of all preceding participating layers beyond what is explained by their proper subsets, and a natural local scale for its magnitude is layer ℓk\ell_k’s actual write when all preceding participating layers are present. We therefore define the normalized connected component of order k=∣T∣k = |T| as

U^T(h)=∥UT(h)∥∥gℓk(FT<ℓk(h))∥+ε(10)\widehat{U}_T(h) = \frac{\lVert U_T(h) \rVert}{\lVert g_{\ell_k}(F^{T_{<\ell_k}}(h)) \rVert+ \varepsilon} \tag*{(10)}

where ε>0\varepsilon> 0 is a small constant for numerical stability. The denominator is the term in Eq. (9) corresponding to S=T⟨ℓkS = T_{\langle\ell_k}, i.e., the magnitude of the update that layer ℓk\ell_k actually writes when all preceding participating layers are present. U^T\widehat{U}_T therefore measures the magnitude of the order-kk connected component relative to the actual write of the final participating layer. This normalization expresses the connected component in units of the local write scale of layer ℓk\ell_k, rather than in absolute residual units. It does not separately normalize the magnitudes of the preceding layers’ updates, whose effects enter through the subset-conditioned inputs FS(h)F^S(h).

When U^T\widehat{U}_T is close to 0. Layer ℓk\ell_k’s update does not require the joint computation of the preceding layers. This covers not only the case where layer ℓk\ell_k writes the same update regardless of what the preceding layers computed, but also the case where each preceding layer does change the update, yet the change reduces to a sum of per-layer contributions. In the latter case layer ℓk\ell_k coordinates with the preceding layers only individually, and such lower-order coordination cancels exactly in the alternating sum of Eq. (8). Either way, no order-kk coordination exists.

When U^T\widehat{U}_T is close to 1. The order-kk connected component has a magnitude comparable to the actual update written by layer ℓk\ell_k when all preceding participating layers are present. Thus, the joint interaction associated with all layers in TT is large relative to the local write scale of the final participating layer. Importantly, U^T\widehat{U}_T should not be interpreted as the fraction of layer ℓk\ell_k’s update attributable to order-kk coordination, because the connected and lower-order components need not be orthogonal. For the same reason, U^T\widehat{U}_T is not bounded above by 1: UTU_T is an alternating combination of actual and counterfactual updates, and its norm can exceed that of the actual write used for normalization.

Finally, to assess how pretraining changes cross-layer coordination, we compare the normalized connected component of a trained checkpoint to that of the same architecture at the baseline checkpoint, defining the final coordination ratio at order kk as

Rk=U^Tfinal(h)U^Tbase(h)(11)R_k = \frac{\widehat{U}_T^{\mathrm{final}}(h)}{\widehat{U}_T^{\mathrm{base}}(h)} \tag*{(11)}

where the baseline is the initialization checkpoint when available and otherwise the earliest released checkpoint. Rk=1R_k = 1 means that the model’s order-kk write-relative connected component remains at its baseline level, whereas Rk>1R_k > 1 indicates strengthening relative to that baseline. We use RkR_k to quantify how cross-layer interaction changes during pretraining relative to its order-specific starting level. Because the baseline value of U^T\widehat{U}_T decreases with interaction order, RkR_k should be interpreted within each order rather than as an absolute comparison of interaction strength across orders.

Experimental Setup

Models. We use public checkpoints of Pythia (Biderman et al. 2023), OLMo [9], and Amber [19]. All three families release intermediate pretraining checkpoints, which lets us track how coordination is organized over the course of training within a fixed architecture. Using families that differ in scale, depth, and training data guards against the observations being a property of any single model family. The models and checkpoints are summarized in Table 1.

SeriesModelsLLddCheckpoints
Pythia410M241024
Pythia1B162048
Pythia1.4B2420488 (0–64k steps, 134B tok.)
Pythia2.8B322560
Pythia6.9B324096
OLMo1B1620487 (4B–3T tok.)
Amber7B3240968 (≤1.26T tok.)

Table 1. Model series and released checkpoints used in the developmental analysis.

Dataset. All measurements are performed on WikiText-103 [22]. Residual-stream states over contiguous text chunks serve as the base point hh for every estimand; UT(h)U_T(h) is computed independently at each token position and then averaged. The perplexity evaluations of § 5.2 and the CKA [16] measurements of § 5.3 use the same corpus and the same token sample, so coordination, similarity, and deletion damage are all compared on the same distribution.

Probed tuples. All measurements are taken over tuples of layers adjacent in depth. An order-kk tuple is one of the adjacent windows

T={ℓ,ℓ+1,…,ℓ+k−1}(12)T = \{\ell, \ell+ 1, \ldots, \ell+ k - 1\} \tag*{(12)}

of which a model of depth LL has L−k+1L - k + 1. We restrict to adjacent windows so that the subset forward passes and the full forward pass share the same input state and bypass no intermediate layer, keeping the site of the deletion intervention well defined.

Interventions. The deletions of § 5.2 proceed as follows. During the full forward pass we record the base point hh at the input of ℓ1\ell_1, run the 2k2^k subset forward passes separately to compute UT(h)U_T(h), subtract it from the residual stream immediately after the output of block ℓk\ell_k, and run the remaining layers unchanged. Because subset composition preserves depth order, the alternating sum of Eq. (8) resolves exactly into the write of the last participating layer, so the intervention site is determined structurally as ℓk\ell_k rather than by approximation. The deletion thus leaves the model to continue computing from the best subset-explainable reconstruction of its own state. The random control subtracts, at the same site, a Gaussian direction rescaled per token to ∥UT∥\lVert U_T \rVert. The two interventions match in norm exactly at the point of action, so any difference in damage is attributable solely to whether the deleted direction is the connected component. Reported factors are post-intervention perplexity divided by unintervened perplexity.

Results

Coordination Strengthens During Pretraining

We test whether pretraining organizes the nominal depth supplied by the architecture into interdependent computation. We compare the normalized connected component of the final checkpoint to that of the same architecture at baseline checkpoint, and report the coordination ratio RkR_k at orders k=2k = 2–66 over all adjacent windows in depth.

Write-relative coordination strengthens over baseline. As Table 2 shows, Rk>1R_k > 1 in all 35 model–order cells. The smallest observed value is R2=1.62R_2 = 1.62 for Pythia-1B, and even this weakest case lies above its baseline level. Because U^T\hat{U}_T expresses the connected component relative to the actual write of the final participating layer, RkR_k compares the strength of the connected interaction against a local write scale rather than using the absolute magnitude of UTU_T. Across every measured model and interaction order, the connected component becomes larger relative to this scale by the final checkpoint.

ModelOrder kkk=2k=2k=3k=3k=4k=4k=5k=5k=6k=6
Pythia-410Mbase0.350.140.060.030.02
Pythia-410Mfinal0.620.540.580.720.98
Pythia-410MRkR_k1.763.869.0621.347.1
Pythia-1Bbase0.430.210.120.080.06
Pythia-1Bfinal0.690.660.791.001.38
Pythia-1BRkR_k1.623.246.8213.123.6
Pythia-1.4Bbase0.350.140.060.030.02
Pythia-1.4Bfinal0.580.520.600.821.23
Pythia-1.4BRkR_k1.663.789.6324.760.8
Pythia-2.8Bbase0.300.110.050.030.02
Pythia-2.8Bfinal0.550.480.510.620.81
Pythia-2.8BRkR_k1.824.5011.024.952.7
Pythia-6.9Bbase0.300.110.050.030.02
Pythia-6.9Bfinal0.540.540.660.991.40
Pythia-6.9BRkR_k1.804.8412.632.264.4
OLMo-1Bbase0.390.190.120.080.07
OLMo-1Bfinal0.800.740.790.931.08
OLMo-1BRkR_k2.053.876.8611.416.5
Amber-7Bbase0.300.120.060.040.03
Amber-7Bfinal0.520.360.320.320.37
Amber-7BRkR_k1.712.985.268.9214.1

Table 2. Write-relative connected component U^T\hat{U}_T (Eq. (10)) at the baseline checkpoint (base) and the final released pretraining checkpoint (final), with the ratio Rk=U^Tfinal/U^TbaseR_k = \hat{U}_T^{\mathrm{final}}/\hat{U}_T^{\mathrm{base}} for k=2k = 2–66 (geometric mean over windows). At the baseline U^T\hat{U}_T decays by roughly half per order; training removes this decay, keeping it O(1)O(1) at every order.

When coordination forms. Figure 2 shows, for Pythia-1.4B, how these values are reached over the course of training. At the earliest checkpoints RkR_k stays near 1 at every order: components requiring the joint participation of several layers exist algebraically even at random weights, but their size does not exceed what each layer’s write magnitude already predicts. The ratios leave this level only after 2.1B tokens of pretraining, beyond which the bootstrap intervals over windows no longer contain $R_k = 1. Cross-layer coordination is not a byproduct of the weights drifting away from initialization, but a structure organized at a specific phase of pretraining.

Coordination ratio over pretraining

Figure 2. Coordination ratio RkR_k over pretraining (Pythia-1.4B), averaged over all adjacent windows of order kk. All orders start near Rk=1R_k = 1 and separate upward as training proceeds. Bands are 95% bootstrap confidence intervals over adjacent windows.

Connected Coordination is Behaviorally Consequential

The coordination ratio establishes that coordination exists and strengthens with training, but it does not say whether this component matters for the model’s actual output. If the connected component were a mere algebraic remainder, removing it should leave model behavior nearly unchanged. At each order kk, we compare the perplexity increase from deleting the connected component UTU_T from the forward pass with the increase from deleting a norm-matched random direction at the same site. Since UTU_T is by construction a component of the last participating layer’s write, the deletion is applied to the residual stream immediately after that layer’s output. The two deletions have identical magnitude at the deletion site, so any difference in the resulting factors comes from whether the deleted direction is the connected component.

Table 3 presents this comparison across orders k=2k = 2–66. In all 35 measured cells, deleting the connected component causes a larger perplexity increase than the random deletion. The difference is often dramatic: deleting the k=3k = 3 connected component of Pythia-6.9B increases perplexity by a factor of 809, whereas deleting a random direction of the same magnitude increases it by only 2.0×2.0\times. Were the connected component a negligible fine correction, the two factors would be comparable; instead, the factor on the connected side is reliably larger. The size of the gap varies across models—the margins are narrow at every order for Amber-7B in particular—yet the sign is consistent without exception. This observation shows that the computation multiple layers produce only together is causally substantive for model output.

ModelPPL (real)k=2k=2 U-del.k=2k=2 rand.k=3k=3 U-del.k=3k=3 rand.k=4k=4 U-del.k=4k=4 rand.k=5k=5 U-del.k=5k=5 rand.k=6k=6 U-del.k=6k=6 rand.
Pythia-410M34.711.8×3.5×8.2×2.8×4.7×2.2×6.4×5.9×19.8×9.4×
Pythia-1B30.414.5×2.1×5.7×3.3×2.9×1.9×7.2×3.2×52.9×11.9×
Pythia-1.4B26.110.8×2.3×52.5×3.1×12.5×4.3×35.1×2.5×224×19.8×
Pythia-2.8B22.06.7×3.5×21.6×1.24×15.0×3.2×167×3.9×111×5.3×
Pythia-6.9B19.36.6×3.0×809×2.0×63.0×5.4×1472×162×1253×898×
OLMo-1B24.4218×18.6×2.5×1.9×4.0×2.1×3.9×3.6×19.8×7.8×
Amber-7B11.02.3×1.20×1.8×1.05×1.1×1.04×2.7×1.09×1.8×1.20×

Table 3. Perplexity increase (relative to the unintervened model) from deleting the connected component UTU_T versus a norm-matched random direction at the same site, for k=2k = 2–66. The two deletions have identical magnitude at the intervention point, so the gap is attributable to the deleted direction being connected. UU-deletion is more damaging in all 35 cells.

Representation Similarity Tracks, but Does Not Determine, Coordination

Layer redundancy has often been diagnosed through representation similarity: adjacent layers with similar representations have been interpreted as doing similar work [24], motivating layer skipping and deep-layer pruning [10, 29]. We compare the CKA [16] of each layer pair with the normalized connected component U^{i,j}\hat{U}_{\{i,j\}} of the same pair. As shown in Table 4, the two quantities are negatively correlated in all seven models (ρsim\rho_{\mathrm{sim}} between −0.66-0.66 and −0.19-0.19): layer pairs with more similar representations tend to exhibit weaker pairwise connected computation.

ModelkkDense↓ρsim\rho_{\mathrm{sim}}Coordination: Low (safe)↓Coordination: High (risky)↓ρ\rhoCKA: High (safe)↓CKA: Low (risky)↓ρ\rho
pythia-410M234.7−0.5270.2 [14–15]625.1 [21–22]+0.6368.2 [10–11]139.4 [1–2]−0.57
384.0 [10–12]2130.0 [5–7]+0.8380.0 [9–11]1486.3 [3–5]−0.70
4155.6 [18–21]15978.1 [5–8]+0.84126.5 [12–15]23693.8 [3–6]−0.71
pythia-1B230.4−0.66233.1 [1–2]90.6 [13–14]+0.0576.3 [8–9]233.1 [1–2]−0.81
377.8 [6–8]1026.2 [3–5]+0.83106.1 [7–9]156.5 [11–13]−0.68
4130.8 [7–10]5535.6 [2–5]+0.94130.8 [7–10]296.9 [9–12]−0.59
pythia-1.4B226.1−0.3950.1 [16–17]169.2 [3–4]+0.3050.8 [20–21]216.0 [1–2]−0.54
370.1 [17–19]334.6 [3–5]+0.5569.3 [19–21]1813.6 [1–3]−0.58
4137.4 [16–19]7915.1 [1–4]+0.5896.8 [19–22]1859.1 [3–6]−0.66
pythia-2.8B222.0−0.5438.4 [16–17]39.4 [29–30]+0.5436.4 [10–11]141.7 [1–2]−0.60
341.7 [14–16]79.0 [18–20]+0.7438.9 [10–12]324.0 [1–3]−0.53
450.8 [13–16]1119.0 [2–5]+0.8247.7 [10–13]1782.5 [1–4]−0.44
pythia-6.9B219.3−0.1935.8 [29–30]178.5 [2–3]+0.1132.4 [27–28]178.5 [2–3]−0.70
335.6 [23–25]117.8 [15–17]+0.4734.7 [27–29]4858.9 [1–3]−0.64
439.7 [22–25]8145.7 [3–6]+0.6138.8 [26–29]785.4 [1–4]−0.59
OLMo-1B224.4−0.4849.3 [7–8]145.8 [13–14]+0.5588.9 [10–11]901.9 [1–2]−0.69
3138.2 [7–9]124.0 [10–12]+0.40124.0 [10–12]1866.0 [1–3]−0.70
4173.8 [7–10]2866.1 [1–4]+0.75183.4 [6–9]2866.1 [1–4]−0.71
Amber-7B211.0−0.4823.8 [4–5]26.7 [29–30]+0.5755.7 [27–28]26.9 [1–2]+0.18
333.3 [3–5]34.3 [28–30]+0.4932.1 [27–29]25.7 [8–10]+0.01
440.7 [3–6]44.9 [27–30]+0.3249.9 [26–29]34.8 [7–10]−0.07

Table 4. Perplexity after removing kk consecutive layers, with blocks selected by coordination versus CKA. Bracketed indices denote the removed block; best and second best per row. ρsim\rho_{\mathrm{sim}} is the model-level Spearman correlation between pairwise CKA and U^{i,j}\hat{U}_{\{i,j\}} over all layer pairs. ρ\rho is the Spearman correlation between a metric’s block score and post-removal perplexity; correct ranking gives ρ>0\rho> 0 for coordination and ρ<0\rho< 0 for CKA.

This association provides a functional interpretation of one pattern underlying representation similarity, but it does not make the two notions equivalent. High similarity need not imply that two layers repeat the same computation, and weak coordination does not by itself imply that their individual writes are dispensable. Rather, our results show that preservation of representation geometry is systematically associated with weaker pairwise interaction. Coordination therefore captures how one layer’s computation depends on another, providing information complementary to state-level similarity.

Table 4 further compares the two signals through actual block removal. For each model, we select kk consecutive layers according to the coordination and CKA criteria, remove them, and measure perplexity. Across the Pythia family, the two criteria often give similar recommendations: the perplexities of the low-coordination and high-CKA blocks agree within 8% in 10 of the 15 cells, and the low-CKA blocks fall in the early layers in 13 cells, frequently overlapping with high-coordination regions. At k=2k=2 on Pythia-6.9B and k=4k=4 on OLMo, the criteria select the same block. The agreement is not uniform, however. On Amber-7B, CKA’s block-ranking correlation becomes near zero or

changes sign (+0.18, +0.01, −0.07), whereas coordination retains a positive association with removal damage (+0.57, +0.49, +0.32). The blocks favored by high CKA yield perplexities of 55.7, 32.1, and 49.9, compared with 26.9, 25.7, and 34.8 for the corresponding low-CKA blocks. Thus, even though ρsim=−0.48\rho_{\mathrm{sim}} = -0.48 on Amber-7B, pairwise state similarity alone does not reliably rank block-removal cost.

The distinction is structural. Similarity is fundamentally pairwise, whereas Section 5.1 shows that connected computation also appears at orders of three or more layers. A layer with weak pairwise coordination can still participate in a stronger higher-order interaction that pairwise similarity cannot observe. Conversely, weak connected interaction alone does not guarantee inexpensive removal, because a layer may have a large individual contribution even when its interactions with other layers are small. The mixed behavior of similarity-based pruning reported in prior work [6, 29] is consistent with this distinction. Notably, Pythia-6.9B, which has the weakest pairwise association (ρsim=−0.19\rho_{\mathrm{sim}} = -0.19), also has the largest k=3k=3 coordination ratio among the measured models (R3=4.84R_3 = 4.84, Table 2).

In sum, representation similarity is a useful but incomplete signal of cross-layer interaction. High similarity is consistently associated with weaker pairwise coordination in our models, but neither pairwise similarity nor weak coordination alone guarantees safe layer removal. Higher-order connected components provide complementary information about cross-layer dependencies that pairwise state comparisons cannot capture.

Discussion

That cross-layer coordination forms through training and contributes substantively to model output shows that deep models do not merely accumulate independent per-layer refinements. It does not follow, however, that coordination is a direct cause of improved performance. At least two directions of explanation are possible.

One possibility is that training organizes layers into interdependent computation, and the resulting coordination enables the model to express more complex functions. On this view, coordination is the mechanism that converts the nominal depth supplied by the architecture into actual computational capacity: two models with the same number of layers may differ in effective computational depth, and in performance, depending on how strongly their layers form connected computation.

The opposite direction is also possible. In the course of solving hard prediction problems the model may come to require several sequential intermediate computations, with cross-layer coordination emerging as a result. If information must be extracted, transformed in context, and integrated with other information, each step naturally depends on the result of the preceding one. On this view, coordination is less an independent cause of performance than a structural signature that the model has acquired multi-step computation.

The two explanations need not be exclusive. The computational demands of the task may first induce coordination, and the coordination thus formed may in turn make complex computation reliably executable. Our results show that coordination is used in actual model behavior, but they do not distinguish whether coordination precedes the emergence of a capability or forms as a consequence of learning it. Settling this would require manipulating the sequential complexity of the task, or jointly tracking when specific capabilities and coordination emerge during training.

Limitations. Our measurements focus on windows of layers adjacent in depth, which keeps the intervention site well defined but leaves coordination between distant layers largely unmeasured; identity ablation also induces counterfactual states within each window. Our normalization is relative to the actual write of the final participating layer and does not separately normalize preceding-layer write magnitudes. Finally, computing UTU_T exactly requires 2k2^k subset forward passes, making higher interaction orders beyond k≤6k \le6 increasingly expensive and likely to require approximation.

Conclusion

We introduced an inclusion–exclusion decomposition that isolates the computation arising only when multiple layers act together, and traced its development across public checkpoints of Pythia, OLMo, and Amber. In our experimental setting, we find that write-relative cross-layer coordination strengthens over pretraining, that deleting the resulting connected component is consistently more damaging than deleting a norm-matched random direction at the same site, and that representation similarity provides a complementary, but not interchangeable, signal of cross-layer dependency and block-removal cost. These observations are consistent with the view that architectural depth provides the opportunity for sequential computation, while pretraining progressively organizes cross-layer dependencies within that depth. We hope that treating functional depth as a learned, empirical property offers a new lens for analyzing, training, and deploying deep models.

References

  1. [1]Belrose, N.; Furman, Z.; Smith, L.; Halawi, D.; Ostrovsky, I.; McKinney, L.; Biderman, S.; and Steinhardt, J. 2023. Eliciting Latent Predictions from Transformers with the Tuned Lens. arXiv preprint arXiv:2303.08112.arxiv.org/abs/2303.08112
  2. [2]Biderman, S.; Schoelkopf, H.; Anthony, Q.; Bradley, H.; O’Brien, K.; Hallahan, E.; Khan, M. A.; Purohit, S.; Prashanth, U. S.; Raff, E.; Skowron, A.; Sutawika, L.; and van der Wal, O. 2023. Pythia: A Suite for Analyzing Large Language Models Across Training and Scaling. In International Conference on Machine Learning (ICML).arxiv.org/abs/2304.01373
  3. [3]Chan, L.; Garriga-Alonso, A.; Goldowsky-Dill, N.; Greenblatt, R.; Nitishinskaya, J.; Radhakrishnan, A.; Shlegeris, B.; and Thomas, N. 2022. Causal Scrubbing: A Method for Rigorously Testing Interpretability Hypotheses. AI Alignment Forum.
  4. [4]Dunefsky, J.; Chlenski, P.; and Nanda, N. 2024. Transcoders Find Interpretable LLM Feature Circuits. In Advances in Neural Information Processing Systems (NeurIPS).arxiv.org/abs/2406.11944
  5. [5]Elhage, N.; Nanda, N.; Olsson, C.; Henighan, T.; Joseph, N.; Mann, B.; Askell, A.; Bai, Y.; Chen, A.; Conerly, T.; DasSarma, N.; Drain, D.; Ganguli, D.; Hatfield-Dodds, Z.; Hernandez, D.; Jones, A.; Kernion, J.; Lovitt, L.; Ndousse, K.; Amodei, D.; Brown, T.; Clark, J.; Kaplan, J.; McCandlish, S.; and Olah, C. 2021. A Mathematical Framework for Transformer Circuits. Transformer Circuits Thread.
  6. [6]Freiberger, M.; Kun, P.; Løvlie, A. S.; and Risi, S. 2024. LayerShuffle: Enhancing Robustness in Vision Transformers by Randomizing Layer Execution Order. arXiv preprint arXiv:2407.04513.arxiv.org/abs/2407.04513
  7. [7]Goldowsky-Dill, N.; MacLeod, C.; Sato, L.; and Arora, A. 2023. Localizing Model Behavior with Path Patching. arXiv preprint arXiv:2304.05969.
  8. [8]Grabisch, M.; and Roubens, M. 1999. An Axiomatic Approach to the Concept of Interaction among Players in Cooperative Games. International Journal of Game Theory, 28(4): 547–565.
  9. [9]Groeneveld, D.; Beltagy, I.; Walsh, P.; Bhagia, A.; Kinney, R.; Tajford, O.; Jha, A. H.; Ivison, H.; Magnusson, I.; Wang, Y.; et al. 2024. OLMo: Accelerating the Science of Language Models. In Proceedings of the Annual Meeting of the Association for Computational Linguistics (ACL).arxiv.org/abs/2402.00838
  10. [10]Gromov, A.; Tirumala, K.; Shapourian, H.; Glorioso, P.; and Roberts, D. A. 2025. The Unreasonable Ineffectiveness of the Deeper Layers. In International Conference on Learning Representations (ICLR).arxiv.org/abs/2403.17887
  11. [11]Hao, Y.; Dong, L.; Wei, F.; and Xu, K. 2021. Self-Attention Distribution: Interpreting Information Interactions Inside Transformer. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, 12963–12971.arxiv.org/abs/2004.11207
  12. [12]Harsanyi, J. C. 1963. A Simplified Bargaining Model for the n-Person Cooperative Game. International Economic Review, 4(2): 194–220.
  13. [13]Hoogland, J.; Wang, G.; Farrugia-Roberts, M.; Carroll, L.; Wei, S.; and Murfet, D. 2024. The Developmental Landscape of In-Context Learning. arXiv preprint arXiv:2402.02364.
  14. [14]Jastrzębski, S.; Arpit, D.; Ballas, N.; Verma, V.; Che, T.; and Bengio, Y. 2018. Residual Connections Encourage Iterative Inference. In International Conference on Learning Representations (ICLR).arxiv.org/abs/1710.04773
  15. [15]Kaplan, J.; McCandlish, S.; Henighan, T.; Brown, T. B.; Chess, B.; Child, R.; Gray, S.; Radford, A.; Wu, J.; and Amodei, D. 2020. Scaling Laws for Neural Language Models. arXiv preprint arXiv:2001.08361.arxiv.org/abs/2001.08361
  16. [16]Kornblith, S.; Norouzi, M.; Lee, H.; and Hinton, G. 2019. Similarity of Neural Network Representations Revisited. In International Conference on Machine Learning (ICML).arxiv.org/abs/1905.00414
  17. [17]Lindsey, J.; Gurnee, W.; Ameisen, E.; Chen, B.; Pearce, A.; Turner, N. L.; Citro, C.; et al. 2025. On the Biology of a Large Language Model. Transformer Circuits Thread.
  18. [18]Lindsey, J.; Templeton, A.; Marcus, J.; Conerly, T.; Batson, J.; and Olah, C. 2024. Sparse Crosscoders for Cross-Layer Features and Model Diffing. Transformer Circuits Thread.
  19. [19]Liu, Z.; Qiao, A.; Neiswanger, W.; Wang, H.; Tan, B.; Tao, T.; Li, J.; Wang, Y.; Sun, S.; Pangarkar, O.; Fan, R.; Gu, Y.; Miller, V.; Zhuang, Y.; He, G.; Li, H.; Koto, F.; Tang, L.; Ranjan, N.; Shen, Z.; Ren, X.; Iriondo, R.; Mu, C.; Hu, Z.; Schulze, M.; Nakov, P.; Baldwin, T.; and Xing, E. P. 2023. LLM360: Towards Fully Transparent Open-Source LLMs. arXiv:2312.06550.arxiv.org/abs/2312.06550
  20. [20]Men, X.; Xu, M.; Zhang, Q.; Wang, B.; Lin, H.; Lu, Y.; Han, X.; and Chen, W. 2024. ShortGPT: Layers in Large Language Models are More Redundant Than You Expect. arXiv preprint arXiv:2403.03853.
  21. [21]Meng, K.; Bau, D.; Andonian, A.; and Belinkov, Y. 2022. Locating and Editing Factual Associations in GPT. In Advances in Neural Information Processing Systems (NeurIPS).arxiv.org/abs/2202.05262
  22. [22]Merity, S.; Xiong, C.; Bradbury, J.; and Socher, R. 2017. Pointer Sentinel Mixture Models. In International Conference on Learning Representations (ICLR). WikiText-103.arxiv.org/abs/1609.07843
  23. [23]Nanda, N.; Chan, L.; Lieberum, T.; Smith, J.; and Steinhardt, J. 2023. Progress Measures for Grokking via Mechanistic Interpretability. In International Conference on Learning Representations (ICLR).arxiv.org/abs/2301.05217
  24. [24]Nguyen, T.; Raghu, M.; and Kornblith, S. 2021. Do Wide and Deep Networks Learn the Same Things? Uncovering How Neural Network Representations Vary with Width and Depth. In International Conference on Learning Representations (ICLR).arxiv.org/abs/2010.15327
  25. [26]Olsson, C.; Elhage, N.; Nanda, N.; Joseph, N.; DasSarma, N.; Henighan, T.; et al. 2022. In-context Learning and Induction Heads. Transformer Circuits Thread. ArXiv:2209.11895.arxiv.org/abs/2209.11895
  26. [27]Petty, J.; van Steenkiste, S.; Dasgupta, I.; Sha, F.; Garette, D.; and Linzen, T. 2024. The Impact of Depth on Compositional Generalization in Transformer Language Models. In Proceedings of the Conference of the North American Chapter of the Association for Computational Linguistics (NAACL).
  27. [28]Raghu, M.; Gilmer, J.; Yosinski, J.; and Shlens, J. 2017. SVCCA: Singular Vector Canonical Correlation Analysis for Deep Learning Dynamics and Interpretability. In Advances in Neural Information Processing Systems (NeurIPS).arxiv.org/abs/1706.05806
  28. [29]Sun, Q.; Pickett, M.; Nain, A. K.; and Jones, L. 2025. Transformer Layers as Painters. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 39, 25219–25227.arxiv.org/abs/2407.09298
  29. [30]Sundararajan, M.; Dhamdhere, K.; and Agarwal, A. 2020. The Shapley Taylor Interaction Index. In International Conference on Machine Learning (ICML).
  30. [31]Tay, Y.; Dehghani, M.; Rao, J.; Fedus, W.; Abnar, S.; Chung, H. W.; Narang, S.; Yogatama, D.; Vaswani, A.; and Metzler, D. 2022. Scale Efficiently: Insights from Pre-training and Fine-tuning Transformers. In International Conference on Learning Representations (ICLR).
  31. [32]Tsai, C.-P.; Yeh, C.-K.; and Ravikumar, P. 2023. Faith-Shap: The Faithful Shapley Interaction Index. Journal of Machine Learning Research, 24(94): 1–42.arxiv.org/abs/2203.00870
  32. [33]Veit, A.; Wilber, M.; and Belongie, S. 2016. Residual Networks Behave Like Ensembles of Relatively Shallow Networks. In Advances in Neural Information Processing Systems (NeurIPS).
  33. [34]Wang, K. R.; Variengien, A.; Conmy, A.; Shlegeris, B.; and Steinhardt, J. 2023. Interpretability in the Wild: A Circuit for Indirect Object Identification in GPT-2 Small. In International Conference on Learning Representations (ICLR).arxiv.org/abs/2211.00593
  34. [35]Zhang, F.; and Nanda, N. 2024. Towards Best Practices of Activation Patching in Language Models: Metrics and Methods. In International Conference on Learning Representations (ICLR).arxiv.org/abs/2309.16042

Paper details

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

views · 12

downloads · 0

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

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents