Rethinking Layer Relevance in Large Language Models Beyond Cosine Similarity
Authors: Cristian Hinostroza
Rodrigo Toro Icarte
Christ Devia
Andres Carvallo De Ferari
Eugenio Herrera-Berg
Denis Parra
Jorge F Silva
Venue: ICLR 2026 Poster (2026)
Keywords: LLMs
Layer Relevance
Mechanistic Interpretability
Structured Pruning
Primary area: interpretability and explainable AI

Abstract: Large language models (LLMs) have revolutionized natural language processing. Understanding their internal mechanisms is crucial for developing more interpretable and optimized architectures. Mechanistic interpretability has led to the development of various methods for assessing layer relevance, with cosine similarity being a widely used tool in the field. On this work, we demonstrate that cosine similarity is a poor proxy for the actual performance degradation caused by layer removal. Our theoretical analysis shows that a layer can exhibit an arbitrarily low cosine similarity score while still being crucial to the model's performance. On the other hand, empirical evidence from a range of LLMs confirms that the correlation between cosine similarity and actual performance degradation is often weak or moderate, leading to misleading interpretations of a transformer's internal mechanisms. We propose a more robust metric for assessing layer relevance: the actual drop in model accuracy resulting from the removal of a layer. Even though it is a computationally costly metric, this approach offers a more accurate picture of layer importance, allowing for more informed pruning strategies and lightweight models. Our findings have significant implications for the development of interpretable LLMs and highlight the need to move beyond cosine similarity in assessing layer relevance.

RETHINKING LAYER RELEVANCE IN LARGE LAN- GUAGE MODELS BEYOND COSINE SIMILARITY
Cristian Hinostroza 2, Rodrigo Toro Icarte Christ D Andres Carvallo", Eugenio Herrera-Berg! -erg". Denis Parra Jorge F. Silva
PPnttificaa Universidad Católica de Chile
Nattional Center for Artificial Intelligence (CENIA)
3 Universidad de Chile
ABSTRACT
Large language models (LLMs) have revolutionized natural language processing. Understanding their internal mechanisms is crucial for developing more inter- pretable and optimized architectures. Mechanistic interpretability has led the development of various methods for assessing layer relevance, with cosine sim- ilarity being a widely used tool in the field. In this work, we demonstrate that cosine similarity is poor proxy for the actual performance degradation caused by layer removal. Our theoretical analysis shows that a layer can exhibit an arbi- trarily low cosine similarity score while still being crucial to the model's perfor- mance, On the other hand, empirical evidence from range of LLMs confirms that the correlation between cosine similarity and actual performance degradation is often weak or moderate, leading to mislcading interpretations a transformer's s internal mechanisms. We propose more robust metric for assessing layer rele- vance: the actual drop in model accuracy resulting from the removal of a layer. Even though it is computationally costly metric, this approach offers more ac- curate picture of layer importance, allowing for more informed pruning strategies and lightweight models. Our findings have significant implications for the de- velopment of interpretable LLMs and highlight the need to move beyond cosine similarity in assessing layer relevance.
INTRODUCTION
Transformers Vaswani et al. 2017). )) initially designed for tasks related to large language models (LLMs) (Chkirbene et al.) 2024), have become the main architecture for modern AI. They now sup- port applications in computer vision (Caron et al. 2021), reinforcement learning (Li et al. (202a)). multimodal learning (Xu al. 2023), recommender systems (Villa et al. 2020), and beyond. Since these models play a central role in AI, uncovering which parts matter the most can guide us toward more interpretable and optimized architectures.
Mechanistic interpretability aims to reverse-engineer pre-trained LLMs to better understand how they work (Ferrando et al., 2024). In this context, cosine similarity has become standard tool for assessing semantic relationships between internal representations (Sanh et al.) 2019 Li et al. 2023b Sun al. 2025 Modell al. 2025). Intuitively, when the angle between two token embeddings is small, the tokens are assumed to encode similar information.
Recent studies have used cosine similarity to assess layer relevance in pre-trained LLMs (c.g., Sajjad et al. 2023 He et al.) 2024 Men et al. 2025 ZZhag et al.) 2024b Sun et al., 2025 Yang et al.] 2024.. .. The core idea is that layers making minimal changes to their input vectors are considered less relevant, with relevance quantified
minus the cosine similarity between layer's input and output vectors. This score has been applied in various contexts: for example, Gromov et al. (2025) used it to prune models and analyze performance across tasks, finding that reasoning tasks require more layers than factual ones. Similarly, He et al. (2024) visualized relevance scores across datasets (Figure IB), showing that some layers consistently appear irrelevant regardless of the task.
While these results offer valuable insights, they hinge on the assumption that cosine similarity is a re- liable indicator of layer relevance- an assumption we challenge. In this paper, demonstrate that

---

B
C4
Codsalpecs
ARC
0.0
Layer
10
15
20
25
30
5
10
15
20
25
30
..4
+0.2
+0.6
+0.0
0.1
02
033
04
0.5
Apcurecy-based relevence soore
Cosine similaitty based relevance score
Figure/ 1: Relevance of OLMo (Groeneveld et al., 2024)ss 's layers across ten datasets. A. Accuracy- based relevance scores: We measure the drop task accuracy to evaluate the relevance of each layer. Layers that increase accuracy when removed are highlighted in green, layers that do not affect accuracy appear white, and layers that reduce the model's s accuracy when removed are indicated in red/purple. B. Relevance scores computed using the cosine similarity score, which measures how much each layer transforms its input. The least relevant layers appear in yellow.
cosine similarity is a poor proxy for the actual performance degradation caused by layer removal. For example, layer 16 in OLMo appears to be of low relevance according to cosine similarity, as illustrated in Figure B (where irrelevant layers are shown in yellow). However, removing this layer results in average accuracy drop of 66% across the ten datasets presented. In fact, eliminating layer 16 alone reduces OLMo's performance to chance level on ARC-C. These findings suggest that relying on cosine similarity as relevance metric can lead to misleading interpretations of transformer's internal mechanisms.
In this paper, we provide formal proof demonstrating that layer exhibit arbitrarily low cosine similarity score while still being crucial to the model's 's performance. In particular, removing such a layer can drastically alter the model's output-potentiall. reducing its accuracy from perfect to zero. This phenomenon arises when the layer introduces subtle modification to its input vector that is subsequently amplified by downstream layers, resulting snowball effect. Consequently, despite its near-zero cosine similarity score, the removal of this layer can significantly disrupt the model's s final predictions.
We then show that this theoretical worst-case scenario does occur, to some degree, in practice. Em- pirically, we find that the correlation between cosine similarity and actual performance degradation often weak moderate, depending the model. As result, cosine similarity either overesti- mates or underestimates a layer's ' true relevance in over 90% cases we studied.
Having established that cosine similarity is unreliable metric for assessing layer relevance, next investigate the implications of re-running previously proposed experiments using a more robust alternative. Specifically, appropriate metric is the actual drop in model accuracy resulting from the removal of a layer. While this approach is computationally expensive-requiiee evaluation-it avoids the shortcomings inherent to cosine similarity. Crucially, this metric captures the complex interdependencies among layers in Transformer architectures.
argue that for the purposes of mechanistic interpretability. the most
layer-by-layer removal and performance
We begin by replicating the layer relevance visualization introduced by He et al. (2024). Figure IT displays the relevance of each layer in OLMo across datasets, measured by the change in model accuracy after removing each layer individually. Red/purple indicates drop in accuracy, green an improvement, and white no change. This visualization offers markedly different perspective from cosine similarity, revealing that layer relevance varies by dataset and highlighting the critical role of layers 8 and 16 in OLMo's performance.
We then replicated the task analysis proposed by Gromov et al. (2055). which involved pruning layers deemed irrelevant based on cosine similarity and observing the resulting performance drop. Instead, ranked layers by the actual decrease in accuracy on the task's training set and pruned accordingly. Results are shown in Figure 2 Because our metric better reflects layer relevance, the performance drop in HellaSwag is less pronounced than in the original study. This challenges the conclusion that all layers are essential for reasoning tasks: using more informative metric, we find that over 75% accuracy be maintained even after removing 22% of the layers.
2

---

MMLU (World Knowledge)
GSMBK (Math Reasoning)
HellaSwag (Common Sense Reasoning
80
Acc-based
Acc-based
Acc-based
60
Performance
Performance
40
Performance
50
60
30-
40
30
10-
30
0.0 0.1 0.2 3.3 0.4 0.5 0.6 0.7 0.8 Pruning Ratio
0.0 0.1 0.2 0.3 0.4 0.5 0.6 Pruning Ratio
0.7
0.8
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Pruning Ratio
Figure 2: We evaluate LLaMA-3-8B using the cosine-similarity pruning strategy proposed by Gro- mov et al. (2025), and compare it with our method. In contrast to cosine similarity, our approach mitigates immediate performance degradation in reasoning tasks, highlighting the critical role of selecting an appropriate metric for interpreting model internals.
We conclude with a practical application in structured pruning (Anwar et al., 2017). which aims to remove layers from trained models with minimal impact performance. In the task-dependent setting, we show that pruning layers based on our accuracy-based relevance score yields superior results compared to existing methods, including Taylor approximations (Kim et al.) [2024]
1 Ma et al.,
2023), cosine similarity (He et al. 2024 et al. [ Gromov et al. (025), ), and FinerCut (Zhang 2024b). In the task-indeeendent setting. method also achieves the best performance, though it is sensitive to the choice of calibration dataset.
2 RELATED WORK
central challenge in Transformer research is accurately measuring layer relevance. This question critical for two main applications: mechanistic interpretability, which seeks understand how pre-trained LLMs operate, and structured pruning, which aims to reduce model size by removing irrelevant layers while preserving performance. Cosine similarity has become a popular metric for both tasks due to its computational efficiency and intuitive appeal (e.g.. (Sajjad
(e.g..[Sajjad et al. 2023 Gromov al., 2025 He et al., 2024 Men et al., 2025) Yang al.) [2244] Zhhagg et al. 2024b). It assumes that layers making minimal changes to their input vectors are less relevant. Moreover, cosine-based pruning has achieved strong results in task-independent settings.
However, cosine similarity is only a proxy for what truly matters: downstream performance. While prior work has raised concerns about its use in comparing token embeddings (Timkey Van Schi- indel 202T) to our knowledge, this is the first study to rigorously evaluate- both theoretically and empirically its limitations in estimating layer relevance in Transformer models. We then propose based relevance score, which considers layer relevant only if its moval significantly degrades performance on a given task.
an alternative: an accuracy-baac bbssed
Beyond cosine similarity, which is typically used local metric (e.g., Sajjad et al. 2023 Gromov et al. 2025 He et al.) 2024)] Men et al.) 2025), several global metrics have been proposed. These assess relevance by evaluating changes the model's output after removing layer. Global metrics fall into two categories: consistency-base and performance-based.
Consistency-basete metrics com-
pare the model's 's output distributions with and without a target layer (Sieberling al. 2024 Yang
et al. 2026) Zhang et al. 2024b), identifying layers whose removal leaves the output unchanged. However, these metrics focus on output invariance rather than predictive accuracy, and may overlook layers that subtly affect performance.
Performance- basse metrics are more aligned with our approach (Kim al. 2024 Ma et al. 2023
Zhong et al. 2025 Song et al.) 2024). These metrics rely on ground- tround-truth information to assess the relevance of a layer. For example, Ma et al. (2023) use Taylor expansions to estimate the change in loss when layer is removed. Other works rely
srpplexity-based scores, deeming layers irrelevant their removal does not significantly increase perplexity (Kim et al., 2024, Zhong et al.) 2025 SSng et al.) 2024). Like accuracy- based score, these methods aim to identify layers whose exclusion yields minimal performance degradation. Nevertheless, as we show in Section 6 our
metric consistently outperforms these alternatives in structured pruning tasks.
3

---

Finally, work connects with broader literature understanding how Transformers represent and process information (Brinkmann et al. 2024; Clark et al. (2019)] Devlin et al. 2019: Geva et al.,
2021
2022
2023 Gurnee & Tegmark| 2024]]awall Jawahar et al. 2019 Lioubashessk et al.
2025 Meng
et al.
2022
Sun et al. |025] Tigges et al. 2023). In particular, our relevance metric could be used
revisit studies that identify functional behaviors in specifie attention layers (Clark al. 20T9h
Geva et al., 2023) or MLPs (Geva et al. 2021] Meng et al., 2022). offering new insights into their
contributions. It may also help bridge findings on global Transformer behavior (Gurnee & Tegmark,
2024 Brinkmann et al., 2024] (Tigges et al. (023) with specific layers or processing stages. We
expand on these connections and review additional pruning methods Appendix
COSINE-SIMILARITY SCORE
Let us begin by formally defining the cosine-simullarity score. The cosine- sismia-similarity score is local metric that examines the difference between the input and output vectors of a layer to assess its relevance (Sajjad al. 2023 Gromov et al.) 2025 He al.) 2024 Men al. 2025). Intuitively, if
the output of a layer is identical to its input, removing that layer would have no effect on the model's performance. Formally, given two vectors æ and y. the cosine similarity is defined follows:
x
CosineSim(z; y) |
(1)
||3
To define score where the least relevant layers receive a value of zero, we compute the cosine- similarity score as one minus the cosine similarity between the input and output vectors of layer.
Given calibration dataset D { Ji=1- the relevance of layer is then calculated the average cosine-similarity score across all tokens and instances: (1 CosineSim x (1.)) x x
CosSimScorool; D)
N
j=1
where each sequence (() has (+) tokens, (1.i) E Rn xd is the intermediate layer representation of (()) layer and X (t,x) Rdd denotes the representation of the j-th token at layer I.
4 RETHINKING LAYER RELEVANCE: BEYOND COSINE SIMILARITY
This section highlights the limitations of cosine similarity as layer relevance metric. We show, both theoretically and empirically, that layers assessed as irrelevant by cosine similarity can still cause significant drops in downstream performance when removed. To address this, propose an accuracy-base -base metric that directly evaluates relevance based on what truly matters: the model's predictive performance.
4.1 LIMITATIONS OF COSINE SIMILARITY FOR LAYER RELEVANCE
We begin by formally demonstrating that a layer can have an arbitrarily low cosine similarity score while still having a significant impact on model performance. Specifically, the following theorem shows that for any dataset I and any e > 0, it is possible to construct a decoder-only Transformer that achieves perfect accuracy on D. yet the removal of the layer with the lowest cosine similarity reduces the model's 's performance to zero. Moreover, the cosine similarity score of that layer is
Theorem Let م denote a Transformer model with L layers, and 1h represent the same model with layer 1 removed. Then, for any 0 and any calibration dataset BB {(s(), ( such that s # أاكه for all i + and gهو (O....,C- there exists decoder-only Transformer fr.
with L 2 3 satisfying the following conditions:
1. There exists an intermediate layer 1 {1,.... L - 2} such that D) c, and CosSimScore((; ID) > ffor all i + L.
2. The full model achieves perfect accuracy: (=()))) ()6) for all (0)) E D. but removing layer I causes the model's accuracy to drop to zero: (L, # ()) for all g(0) D.
4

---

Perfect sligg
Grord slip
Prinned fookl arruneyy >
Pythia66998
Mistral-78
OLMo-78
Reformmnco order
12
Dosn moce
0.5
Ri 0 46
Rm-0.23
R=-0.15
Pu4.6e-16
Pm 9.44--
P=1.0e-02
0.02
0.04
0.06
0.05
0.10
0.15
0.1
0.2
0.3
Cosine similartty based
20 aimilrity
Figure 3: A. Relationship between cosine similarity scores and performance variation after removing a layer. Each point represents a specific layer-task pair from one of the 28 middle layers in Pythia, Mistral, or OLMo, evaluated across ten tasks (same set as in Figure T B. Alignment between cosine similarity rankings and performance rankings across three models, ten tasks, and 28 layers. Cell (i indicates the number of times cosine similarity assigned rank j while the ground-truth rank was i (rank = least relevant). The heatmap uses three distinct color scales; green for the diagonal (perfect alignment), blue for low-cost misrankings, and red for all other cells.
To construct a Transformer in which a layer has an arbitrarily low cosine similarity yet significantly impacts model performance, two key conditions must be met. First, snowball effect must occur: the target layer introduces a subtle change to its input vector, which is then amplified by subsequent layers. This allows the layer to have minimal cosine similarity while still influencing the final output. Second, some embedding dimensions must be irrelevant to the model's prediction. This enables other layers to make large changes in those irrelevant dimensions, inflating their cosine similarity scores without contributing to performance. A complete proof is provided in Appendix B
We believe both phenomena can naturally arise in pre-trained LLMs, particularly in task-dependent settings. For given task, many transformations applied by the model may be irrelevant to solving it. Empirically, we observe snowball effect in models like OLMo, where layer 16 exhibits a very low cosine similarity score yet has substantial impact on performance (see Figure I
We now present a more in-depth empirical evaluation of the cosine similarity score as proxy for layer relevance. Specifically, we aim to assess how well cosine similarity predicts the actual drop in downstream performance when layer removed. Figure A compares the cosine similarity score with the observed reduction in accuracy after removing individual layers from three tre-trained ALMs-Mistral Pythia, and OLMo-across across ten datasets: C4, CodeAlpaca, LIMA, MathInstruct, BoolQ, ARC-Challenge, ARC-Easy, HellaSwag, PIQA, and Winogrande. We exclude the first and last two layers, as they are trivially identifiable as relevant and behave as clear outliers.
As shown in Figure BA, there is some correlation between cosine similarity and performance degra- dation. However, the strength of this correlation varies by model: moderate in Pythia (R = -0.46), weak in Mistral (R= -0.23), and very weak in OLMo (R -0.15).
To further evaluate the reliability of cosine similarity, we compare its layer relevance ranking against cround-truth ranking based on actual performance drop. Figure 3 presents confusion matrix summarizing the results across the same three models and ten datasets. In this matrix, cell (i,j) indicates the number of times cosine similarity ranked a layer as the j-th least relevant, while its true rank was i according to performance drop. Diagonal entries represent perfect agreement; entries below the diagonal indicate underestimation of relevance, and those above indicate overestimation. Overall, cosine similarity misestimated a layer's relevance in 93.8% of cases. That said, not all errors are equally severe: entries near the diagonal reflect small ranking deviations. But even when considering only substantial errors (highlighted in red), cosine similarity still fails in 53.6% of cases.
Overall, these results demonstrate that cosine similarity is an unreliable and noisy metric for estimat- ing layer relevance. In many cases, layers deemed irrelevant by cosine similarity lead to substantial drops in performance when removed and vice versa. This inconsistency highlights the need for caution when using cosine similarity, particularly in the context of mechanistic interpretability. Re- lying on such a flawed metric risks drawing incorrect conclusions about how Transformer models function. We illustrate this issue with concrete examples in Section
5

---

4.2 ACCURACY- BASED RELEVANCE SCORE
Rather than relying on a proxy, we propose directly visualizing the performance drop to assess how each layer contributes the model's effectiveness. We do by using accurucy-based score. Given a dataset D and a Transformer model with L layers fl, we assess the relevance of layer as:
AccBasedRelevancol -), = max(Accuracy( D) r(D),,
(3)
max(Accuracyy D) r))
where Accuracy( (ff, D) denotes the accuracy of the full model on dataset D, and r(D) represents the expected performance of a random predictor the dataset.
This score ranges from -oo and +1: negative values indicate improved performance upon removal of the layer, zero indicates no change, and positive values reflect a drop performance. Thus, higher scores correspond greater relevance of the layer for the task. It is important to note that this range valid only when the full model performs better than a random predictor. If the model's accuracy falls below that of random predictor, the relevance score becomes ill-defined, and the analysis should not be applied in such cases.
The accuracy- based score be applied to any component of a transformer- based model, including a single weight, a multi-head attention layer, an MLP, Transformer block, or multiple blocks. That said, in the next section, will focus on visualizing the importance of Transformer blocks.
5 CASE STUDIES
To assess the practical impact of our findings, we revisit two case studies that used cosine similarity evaluate layer relevance in pre-trained LLMss Replacing cosine similarity with our accuracy- based metric, we observed significantly different outcomes. These results highlight the limitations of proxy metrics and reinforce the value of accuracy- -based evaluation for mechanistic interpretability.
5.1 RELEVANCE CONSISTENCY ACROSS DATASETS
We begin by revisiting the study What Matters in Transformers by He et al. (0024), which proposes method to visualize layer relevance using cosine similarity. Figure 44 shows the relevance of each layer in Mistral (Tiang et al. 2023) across multiple datasets, with yellow indicating low cosine similarity score and purple indicating high. Based on these visualizations, the authors conclude that layer relevance is largely task-independent-aa pattern also observed in OLMo (Figure IB).
When applying our accuracy-based metric, we obtain a markedly different view of layer relevance, as shown in Figure [ for OLMo and Figure 4 for Mistral. These visualizations use a fixed color scale: green for performance gains, white for no change, and red/purple for performance drops. Unlike cosine similarity, our metric reveals that layer relevance is highly task-dependent. For example, removing block 14 OLMo reduces accuracy by ~41 % on MathInstruct but has minimal impact (~1%) CodeAlpaca. Some layers performance when removed-e.. e.g.. block 23 Mistral increases accuracy by ~255% on MathInstruct but decreases by ~6% on CodeAlpaca. Finally, our metric also captures broader task sensitivity. For instance, Mistral shows consistently lower relevance across blocks on MMLU compared to BoolQ a distinction not visible in cosine similarity plots.
show negative relevance, improving
Denet
10
0.0
Layer
5
10
15
20
25
30
10
15
20
30
.04
.0/2
+022
40.4
+0.6
+0.3
olo5
oh
0/15
0/2
0.25
d3
d.35
0.4
Accuracy-bared relevance score
Cosine similarity based relevance score
Figure 4: Relevance of Mistral's Transformer blocks across datasets. A. Accuracy-based relevance
scores. B. Cosine similarity score.

---

0.3
To ensure these differences not artifacts of visualiza- tion, we conducted a statistical comparison between the two metrics. Using z-score normalization, the average variance of each of OLMo's 32 blocks across ten datasets. As shown in Figure [ accuracy- score exhibits significantly greater variance than cosine similarity. A Wilcoxon test (Appendix C.3) confirms these differences are statistically significant, reinforcing the visual evidence that layer relevance is dask-dependent.
Normalizee Score
0.2
computed
OLMo
Pythia
Pythia
Cos-Sim
Figure 5: Relevances Across Datasets
Beyond cross-task consistency, we also explored how rel- evance evolves during training (Appendix C.4) and prun-
In pruning, we found that a layer's relevance depends on the presence of other evver--removing one can increase or decrease the importance of another. In training, no clear pattern emerged: some layers gained relevance over time, while others fluctuated.
ing (Appendix C.5)
5.2 DIFFERENCES BETWEEN TYPES OF TASKS
We now revisit The Unreasonable Ineffectiveness of the Deeper Layers by Gromov et al. (2025), which argues that deeper layers in pre-trained LLMs are essential for reasoning tasks (e.g.. GSM8K, HellaSwag) but less relevant for factual retrieval tasks such as MMLU. Their hypothesis is based on the idea that, when faced with reasoning task, the model must compute intermediate steps to arrive at the final imslliig that all layers contribute meaningfully to such tasks. Their analysis on LLaMA 2-70B showed that MMLU retained accuracy under early pruning, while GSM8K and HellaSwag degraded instantly and continued to decline, supporting the hypothesis that deeper layers play critical role in reasoning.
Their pruning strategy, however, was based on cosine similarity rather than direct depth- based abla- tion. To assess the robustness their findings, we replicated the experiment on I.LaMA 3-8B using our accuracy-based relevance metric. As shown in Figure 2 we observed similar task-dependent trends according to the cosine similarity score: MMLU remained stable under initial pruning, while GSM8K and HellaSwag showed performance drops, particularly in GSM8K.
In contrast, when pruning guided by our accuracy-based metric, a different pattern emerges: the model maintains strong performance HellaSwag even after several blocks are removed, and GSM8K shows minimal degradation after pruning two blocks. This suggests that cosine similarity may underestimate the importance of certain blocks for reasoning tasks panssing them prematurely and thereby reducing model performance. Moreover, cosine similarity appears unable to identify blocks that not relevant for reasoning, whereas method successfully distinguishes between essential and non-essential layers.
Finally, we note that, unlike Gromov et (0255), who pruned contiguous block groups based on aggregate cosine similarity, our method prunes blocks iteratively, re-evaluating the model after each step. In Appendix D we compare both strategies cosine similarity used in their work and our iterative method. While some trends are less pronounced, the core conclusion remains: different metries yield different insights into model behavior.
6 EMPIRICAL RESULTS IN STRUCTURED PRUNING
The primary goal of our accuracy- based relevance score was support mechanistic interpretability by providing a reliable measure of layer importance. However, this metric also proves effective for structured pruning-in -.e.., reducing model size by removing layers with minimal impact on per- formance (Anwar al. 2017). Surprisingly, pruning layers deemed irrelevant by our score yields state-of-the-an results, while remaining simple to implement.
Structured pruning methods typically rely calibration set to estimate layer relevance and prune up to p% of the model's 's weights. These methods differ in whether they apply one-shot or itera- tive pruning, and in the criteria used rank layers. To evaluate pruning effectiveness, generalization performance across standard benchmarks. We applied our iccuracy-basee score iter- atively prune LLaMA3-8B (Grattafiori al. 2024), selected for its in prior state-of-the-re
compare

---

Table 1: Task-dependent results for LLaMA3-8B models across multiple tasks. All methods remove 25% of the model using each task's training set. "Original" refers to the unpruned model.
Method
Are-C
Arc-E
BoolQ
HS
OBQA
PIQA
WG
MMLU
Mean
Original
53.16
81.02
82.02
78.94
44.8
81.28
73.56
65.11
69.99
Taylor
31.48
67.97
61.31
62.73
38.4
76.55
55.64
25.03
52.39
Cosine Similarity
45.73
67.8
66.33
69.52
38.6
72.91
71.35
44.05
59.54
Out. Cosine-Sim
39.51
65.57
72.11
67.97
36.8
76.88
65.11
36.82
57.6
Out. Norm-Sim
40.19
66.08
72.08
64.96
39.6
75.46
68.27
49.03
59.46
Out. Divergence-Sim
41.13
65.87
72.14
67.20
34.0
74.43
69.46
35.12
57.42
Perplexity
38.14
53.11
62.14
58.92
38.4
67.19
62.12
59.04
54.88
Slice-GPT GPT
41.64
73.27
75.75
67.35
39.6
77.15
70,56
48.74
61.76
Accuracy (Ours)
49.57
74.96
84.04
71.53
79.06
73.8
62.97
67.49
pruning work (Zhang et al. 2024b). We also replicated the experiment Mistral-7B (Jang al.
2023) and evaluated one-shot pruning (see Appendix [E3)..
Our method was benchmarked against leading pruning techniques, including: Taylor approxima- 2024 Ma et al. 2023), cosine similarity (He et al., 2024, Men et al., 2025 Gro- mov al. 2025): , output- output-based based metrics (e.g.. output cosine similarity. norm similarity, divergence
tions (Kim et al.
similarity) Zhang et al. 2024b, Yang et al. 2026 Sieberling et al. (2024). and perplexity-bas
relevance Kim al. 2024 Zhong al. 2025 Song et al. (0024).
To ensure fair comparison, all methods pruned the same layer types using identical calibration data, removing up 25% of the model. Metrics were recomputed after each pruning step. We also included SlideGPT (Ashkboos et al.] (2024). which reduces layer size rather than removing entire layers; we matched its pruning ratio 25%. No healing or postprocessing was applied, as our focus was on evaluating the effectiveness of the relevance metric itself.
We assessed performance across eight widely used benchmarks: ARC-Challenge (Clark et al. 2018), ARC-Easy (Clark et al.] 2018)) BoolQ (Clark et al.] (019a), HellaSwag (Zellers et 20019) PIQA (Bisk al. 2020), OpenBookQA (Mihaylov et al. 2018), Winogrande (Sakaguchi et al., 2021). and MMLU (Hendrycks et al. 2021). These span range of reasoning and knowledge tasks, each with a train/test split. Implementation details are provided in Appendix E.
We first report task-dependent results, where the goal is to optimize performance for specific task. Each model was pruned using the corresponding training set as calibration data and evaluated on the test set. Presents results for LLaMA3-8B. Our accuracy- based score consistently outper- formed all baselines and, in some cases, even surpassed the unpruned model. Similar trends were observed with Mistral-7B (see Appendix E.2 These findings indicate that our score can effectively prune pre-trained LLMs when the deployment task is known. For example, if lightweight model is needed for math problem solving, our score identifies and removes layers unrelated to that domain. While this may reduce performance on unrelated tasks (c.g., poetry generation), such trade-off's are acceptable when the goal is task-specific efficiency.
We now turn to the task-independent setting, where the objective is to prune pre-trained LLM while preserving performance across diverse set of tasks. this context, we observed that the effectiveness of our accuracy-bur based score is highly sensitive to the choice of calibration set.
reboerrs results for LLaMA3-88 using a calibration set composed of 10% of the training data from each of the eight benchmarks. Under this configuration, our method outperforms all baselines, yielding pruned model that achieves the highest average performance across tasks. However, when the calibration set is restricted to a single benchmark, performance varies significantly (as shown in Appendix E.5) while cosine similarity remains stable at Rs 60%, regardless of the calibration set.
To further examine our model's sensitivity to the choice of calibration set, the last two rows of Table report its task-independent performance when pruned using two different calibration sets: ARC-E and C4. First, pruning with ARC-E yields strong performance across most tasks, indicating that layer relevance derived from one task can generalize effectively to others. Second, pruming with C4 demonstrates the opposite effect: task-specific relevance can severely degrade performance
8

---

Table Task-independent results for LLaMA3-8B across multiple tasks. Each pruning method uses the same calibration dataset to prune 25% of the model once, which is then evaluated on all tasks.
Method
Are-C
Arc-E
BoolQ
HS
OBQA
PIQA
WG
MMLU
Mean
Original
53.16
81.02
82.02
78.94
44.8
81.28
73.56
65.11
69.99
Taylor
45.39
67.97
61.31
62.73
41.4
76.55
68.11
25.03
56.06
Cosine Similarity
43.6
66.96
75.53
69.35
36.2
73.23
71.82
44.07
60.1
Out. Cosine-Sim
40.61
65.78
67.58
64.6
36.2
75.3
69.51
30.16
56.22
Out. Norm-Sim
37.88
65.32
57.77
61.73
39.6
74.86
65.43
26.5
53.64
Out. Divergence-Sing
39.51
64.39
64.8
64.37
34.2
73.83
68.59
33.5
55.4
Perplexity
31.83
48.95
59.27
48.01
30.5
66.76
61.88
29.31
47.06
Slice-GPT
41.16
70,28
77.49
61.19
36.8
73.66
62.66
45.03
58.53
Accuracy (Ours)
47.35
71.68
78.38
73.41
43.8
76.55
71.11
58.04
65.04
Accuracy (Are-F)
51.37
74.96
66.94
73.62
43.6
78.51
71.59
44.82
63.18
Accuracy (C4)
36.69
56.52
53.36
60.16
33.8
72.63
60.14
28.5
50.23
unrelated tasks. Finally, certain tasks remain difficult to generalize to. In particular, BoolQ and MMLU exhibit relevance patterns that differ substantially from the rest, such that strong perfor- mance was only achievable when incorporating part of their training data during pruning. Overall, these findings reinforce a key observation of our work: layer relevance inherently task-dependent.
An important direction for future work is to understand what properties calibration set should possess to enable strong indeeindepnndent performance. Our observations suggest that accuracy improves when the calibration set includes a diverse mix of for example, sampling approx- imately 10% from the training sets of multiple benchmarks. We also find that certain tasks, such as ARC-E, exhibit layer relevance patterns that align well with many other tasks. However, the underlying reasons for this consistency remain unclear and warrant further investigation.
6.1 COMPUTATIONAL COST COMPARISON
As discussed in Section cosine similarity has clear limitations measure of layer relevance. Its primary advantage, however, speed. Computing layer relevance via cosine similarity is highly efficient: let N denote the number of layers and T the number of instances in the calibration set. Cosine similarity requires only T forward passes to compute relevance for all layers. In contrast, our accuracy- based score requires N x T forward passes, output- based methods require (N + 1) x T forward passes, and Taylor approximations require T forward and T backward passes.
Table illustrates this trade-off by reporting the time required to prune 25% of LLaMA-3-8B. As shown, cosine similarity is by far the fastest- Resteit-requiring only a few minutes to prune 25% of the model. Our ceuuracy-bbsed method averages 4.6 hours, which is similar other baselines. How- ever, our method consistently produces pruned models with superior performance.
Reducing the computational cost of our metric is a key direction for future work. particularly for larger models. Using our current (naive) implementation. we estimate that pruning 50% of LLaMA- 3-70B would take between 8.5 days with C4 and 1.1 days with CodeAlpaca-usine two NVIDIA H100 GPUs These estimates represent worst-case scenarios, as we have not yet fully exploited parallelization. Further details are provided in Appendix(E.6
Moreover, our iterative pruning strategy is inherently suboptimal. At present. we employ a greedy approach: we compute each layer's relevance, prune the least relevant layer, and then recompute relevance scores before proceeding to the next pruning step. However, identifying the optimal com- bination of n layers to remove would require a bearch-based method-such as A capable of back- tracking and considering cases where removing seemingly suboptimal layer might lead to better overall performance later. Unfortunately, even our current greedy procedure is computationally ex- pensive, making exhaustive search for the optimal set of n layers infeasible. Nevertheless, if we could accelerate the evaluation (or estimation) of accuracy-base based relevance, it would open the door to exploring how much performance could be gained by finding truly optimal pruning combinations.

---

Table 3: End-to-end runtime for pruning 25% of LLaMA-3-8B NVIDIA L40s GPU.
Accuracy
Cos. Sim.
Perplexity
Out. Cos
Out. Norm
Out. Div
Taylor
C4
7.70 hrs
9.54 min
7.71 hrs
8.08 hrs
7.98 hrs
8.08 hrs
11.30 hrs
LIMA
6,46 hrs
14.45 min
6.38 hrs
6.62 hrs
6.65 hrs
6.83 hrs
14.17 hrs
MathInstruct
3.16 hrs
7.01 min
3.30 hrs
3.22 hrs
3.29 hrs
3.31 hrs
8.45
CodeAlpaca
1.06 hrs
3.55 min
1.08 hrs
1.12 hrs
1.11 hrs
1.12 hrs
7.59 hrs
Mean
4.60 hrs
8.64 min
4.62 hrs
4.76 hrs
4.76 hrs
4.83 hrs
10.37 hrs
Pruning ratio 0.25
Score
Pruning ratio
Score
Pruning
Scote
50
Arc-C
Arc-E
BoolQ
HS
OBQA
PIQA
WG
MMLU
Mean
Accuracy (Ours)
Cosine Similarity
Random
Accuracy (Ours) Healing
Similarity Healing
Random Healing
Figure 6: Impact of healing (dark colors) after pruning (light colors) across varying pruning ratios.
6.2 RESULTS PRUNING WITH HEALING
Recent work has introduced healing phase after pruning (e.g., (en et al. 2024 Gromov et al., 2025 Song et al. 2024 Kim et al., 2024). This phase fine-tunes the pruned model a few steps, aiming to mitigate distributional mismatches across layers caused by pruning. In this section, we examine whether healing complements our accuracy-based pruning approach.
Figure shows task-dependent pruning results with and without healing. Scores are normalized: 100 indicates perfect performance, random predictor. When pruning 25% of layers, performance after healing is nearly invariant to the pruning strategy. In fact, random rnseline-removing 25% of layers at random (averaged over five for small pruning ratios, healing largely neutralizes differences between pruming methods. Still, accuracy-based pruning combined with healing slightly outperforms cosine similarity (60.5% vs. 59.6% normalized average). At 50% pruning, the gap widens: accuracy-basede healing achieves 42.2% normalized performance, compared to 31.2% for cosine similarity and 20.5% for random. At 75% pruning, all methods degrade severely, yet accuracy-based pruning remains superior (12.2% vs. 9.3% for cosine similarity and 9.4% for random).
competitively after healing. In other words,
Implementation details are provided in Appendix E.. In brief, we fine-tuned using LoRA for up to 10 epochs. reporting the best performance across epochs (full curves appear in Appendix E.7) h. Ten epochs are sufficient for all methods exhibit signs of overfitting. While early stopping relied on the test set-ideally, validation set should be used-this does not alter the main conclusion: healing substantially reduces differences between pruning strategies at low pruning ratios, yet accuracy- based pruning consistently achieves the best performance pruning becomes more aggressive.
7 CONCLUSION
In this paper, we challenged the common use of cosine similarity as proxy for layer relevance LLMs, showing through theory and experiments that often misrepresents true importance. To address this, we propose accuracy-based relevance metric that directly measures performance impact, offering a more faithful view of layer significance. Beyond interpretability, this metric enables superior structured pruning, outperforming existing methods in both task-dependent and mnsk-independent settings. Our findings call for shift toward celtommanc--gruudde evaluations to better understand model internals and design more effective pruning strategies.
10

---

ACKNOWLEDGMENTS
We gratefully acknowledge the support of the Agencia Nacional de Investigación y Desarrollo (ANID), Chile. This research was funded by the National Center for Artificial Intelligence CE- NIA FB210017, Basal ANID. The work of R. Toro Icarte was supported by Fondecyt Iniciación 11230762. The work of C. Devia was supported by Fondecyt 11241551 and FONDEQUIP EQM230106. The work of A. Carvallo was supported by Fondecyt 3240001. The work of D. Parra was supported by Fondecyt Regular 1231724 and the Millennium Initiative research centers iHealth ICN2021 004 and IMFD ICN17 002. The work J. F. Silva was supported by Fondecyt Regular 1250098 and ANID AC3E CIA250006.
REFERENCES
Sajid Anwar, Kyuyeon Hwang, and Wonyong Sung. Structured pruning of deep convolutional neural networks. ACM Journal on Emerging Technologies Computing Systems (JETC), 13(3):1-18, 2017.
Saleh Ashkboos, Maximilian Croci, Marcelo Gennari do Nascimento, Torsten Hoefler, and James Hensman. Slicegpt: Compress large language models by deleting rows and columns. In Proceed- ings of the 12th International Conference on Learning Representations (ICIR), 2024.
Yonatan Bisk, Rowan Zellers, Ronan Le Bras, Jianfeng Gao, and Yejin Choi. Piqa: Reasoning about physical commonsense in natural language. In Proceedings of the 34th AAAI Conference on Artificial Intelligence (AAAI), pp. 7432-7439, 2020.
Jannik Brinkmann, Abhay Sheshadri, Victor Levoso. Paul Swoboda, and Christian Bartelt. mech- anistic analysis of transformer trained on a symbolic multi-step reasoning task. In Findings of the Association for Computational Linguistics: ACL 2024, pp. 4082 4102, 2024.
Mathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou, Julien Mairal, Piotr Bojanowski. and Armand Joulin. Emerging properties self-supervised vision transformers. Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 9650-9660, 2021.
Zina Chkirbene, Ridha Hamila, Ala Gouissem, and Unal Devrim. Large language models (Il) in industry: A survey of applications, challenges, and trends. In Proceedings of the IEEE 2 International Conference on Smart Communities: Improving Quality of Life using Al, Robotics and loT (HONET), pp. 229-234. IEEE, 2024.
Christopher Clark, Kenton Lee, Ming-Wer Wei Chang, Tom Kwiatkowski. Michael Collins, and Kristina Toutanova. Boolq: Exploring the surprising difficulty of natural yes/no questions. In Proceedings of the 2019 Conference of the North American chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), pp. 2924-22222222 2924-2936, 2019a.
Kevin Clark, Urvashi Khandelwal, Omer Levy, and Christopher D. Manning. What does bert look at? an analysis of bert's attention. In Proceedings of the 2nd BlackboxNLP Workshop: Ana- lyzing and Interpreting Neural Networks for NLP (BlackboxNI.P), pp. 276-286. Association for Computational Linguistics, 2019b.
Peter Clark, Isaac Cowhey, Oren Etzioni, Tushar Khot, Ashish Sabharwal, Carissa Schoenick, and Oyvind Tafjord. Think you have solved question answering? try arc, the ai2 reasoning challenge. arXiv preprint arXiv:1803.0544 2018.
Tim Dettmers, Artidoro Pagnoni, Ari Holtzman, and Luke Zettlemoyer. Qlora: Efficient finetuning of quantized 1lms. In Proceedings of the 37th Conference on Advances in Neural Information Processing Systems (NeurIPS), 2023.
Jacob Devlin, Ming- Wei Chang. Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HI.T), pp. 4171 2019.

---

Javier Ferrando, Gabriele Sarti, Arianna Bisazza, and Marta R. Costa-jussà A primer the inner workings of ceafformer-basee language models. CoRR, abs/2405 2024. doi: 10.48550/ ARXIV.2405.00008 WtLhhtts::/// /ttttps://.o...r//10.... www.:.o.rro..... wwt.o///......000.111111.1.1 2405. 00208
Leo Gao, Jonathan Tow, Baber Abbasi, Stella Biderman, Sid Black, Anthony DiPofi, Charles Fos- ter, Laurence Golding, Jeffrey Hsu, Alain Le Noac'h, Haonan Li, Kyle McDonell, Niklas Muen- nighoff, Chris Ociepa, Jason Phang, Laria Reynolds, Hailey Schoelkopf, Aviya Skowron, Lintang Sutawika, Eric Tang, Anish Thite, Ben Wang, Kevin Wang, and Andy Zou. The language model evaluation harness, 07 2024. httht zenodo. . org/ rwc. rs 2608602
Mor Geva, Roei Schuster, Jonathan Berant, and Omer Levy. Transformer feed-forward layers key-value memories. In Proceedings of the 2021 Conference on Empirical Methods in Natu- ral Language Processing (EMNLP), pp. 5484 5495. Association for Computational Linguistics, 2021.
Mor Geva, Avi Caciularu, Kevin Wang. and Yoav Goldberg. Transformer feed-forward layers build predictions by promoting concepts in the vocabulary space. In Proceedings of the 2022 Confer- ence on Empirical Methods in Natural Language Processing (EMNLP), pp. 30-45. Association for Computational Linguisties, 2022.
Mor Geva, Jasmijn Bastings, Katja Filippova, and Amir Globerson. Dissecting recall of factual associations in auto-regressive language models. In Proceedings of the 2023 Conference on Em- pirical Methods in Natural Language Processing (EMNLP), pp. Computational Linguistics, 2023.
Association for
Aaron Grattafiori, Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, Abhishek Kadian, Ahmad Al-Dahle, Aiesha Letman, Akhil Mathur, Alan Schelten, Alex Vaughan, al. The Ilama 3 herd of models. arXiv preprint 2rXiv:2407.21788 2024.
Dirk Groeneveld, Iz Beltagy, Evan Walsh, Akshita Bhagia, Rodney Kinney, Oyvind Tafjord, Ananya Jha, Hamish Ivison, Ian Magnusson, Yizhong Wang, et al. Olmo: Accelerating the science of lan- guage models. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (ACL), 2024.
Andrey Gromov, Kushal Tirumala, Hassan Shapourian, Paolo Glorioso, and Daniel A Roberts. The unreasonable ineffectiveness of the deeper layers. In Proceedings of the 13th International Con- ference Learning Representations (ICLR), 2025.
Wes Gurnee and Max Tegmark. Language models represent space and time. In Proceedings of the 12th International Conference on Learning Representations (ICLR), 2024.
Shwai He, Guoheng Sun, Zheyu Shen, and Ang Li. What matters in transformers? not all attention is needed. arXiv preprint arXiv:2406. 15786, 2024.
Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. Measuring massive multitask language understanding. In Proceedings of the 9th International Conference on Learning Representations (ICLR), 2021.
Edward Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. Lora: Low-rank adaptation of large language models. In Proceedings of the 10th International Conference on Learning Representations (ICLR), 2022.
Ganesh Jawahar, Benoît Sagot, and Djamé Seddah. What does bert learn about the structure of language? In Proceedings of the 57nd Annual Meeting of the Association for Computational Linguistics (ACL), 2019.
Albert Q. Jiang, Alexandre Sablayrolles, Arthur Mensch, Chris Bamford, Devendra Singh Chaplot, Diego de las Casas, Florian Bressand, Gianna Lengyel, Guillaume Lample, Lucile Saulnier, and et al. Mistral 7b. arXiv preprint vrXiv:2310.06822. 2023.
Bo-Kyeong Kim, Geonmin Kim, Tae-Ho Kim, Thibault Castells, Shinkook Choi, Junho Shin, and Hyoung-Kyi Kyu Song. Shortened LLaMA: A simple depth pruning for large language models. In Proceedings of the ICLR 2024 Workshop on Mathematical and Empirical Understanding of Foun- dation Models, 2024. URL http:tttp////ggeeeeieeee net forum ? did 100==0dVG
12

---

Hao Li, Asim Kadav, Igor Durdanovic, Hanan Samet, and Hans Peter Graf. Pruning filters for efficient convnets. arXiv preprint arXiv: 2016.
Wenzhe Li, Hao Luo, Zichuan Lin, Chongjie Zhang, Zongqing Lu, and Deheng Ye. A survey transformers in reinforcement learning. Transactions on Machine Learning Research, 2023a.
Yuchen Li, Yuanzhi Li, and Andrej Risteski. How do transformers learn topic structure: Towards a mechanistic understanding. In Proceedings of the 40th International Conference on Machine Learning (ICMI.), pp. 19689-19729, PMLR, 2023b.
Daria Lioubashevski, Tomer M. Schlank, Gabriel Stanovsky, and Ariel Goldstein. Looking be- yond the top-1: Transformers determine top tokens in order. In Proceedings of the 42th Interna- fional Conference on Machine Learning (ICML), 2025. URL
ew .ne./
forum? d=2B1 1W176TD
Yao Lu, Hao Cheng, Yujie Fang, Zeyu Wang, Jiaheng Wei, Dongwei Xu, Qi Xuan, Xiaoniu Yang, and Zhaowei Zhu. Reassessing layer pruning in llms: New insights and methods. arXiv preprini
arXiv:2411.15558 2024.
Xinyin Ma. Gongfan Fang, and Xinchao Wang. LIm-pruner: on the structural pruning of large language models. In Proceedings of the 37th Conference on Advances in Neural Information Processing Systems (NeurIPS), pp. 21702-21720, 2023.
Sourab Mangrulkar, Sylvain Gugger, Lysandre Debut, Younes Belkada, Sayak Paul, Benjamin Bossan, and Marian Tietz. PEFT: State-of-the-art parameter-efficient fine-tuning methods. https: /tg:t//ittii hrigthub.... com www.oo/ogogoe.oooooooeeeoooeeooe http:/ggggggae//eett./.g 2022.
Xin Men, Mingyu Xu, Qingyu Zhang, Qianhao Yuan, Bingning Wang, Hongyu Lin, Yaojie Lu, Xianpei Han, and Weipeng Chen. Shortgpt: Layers in large language models are more redundant than you expect. In Findings of the Association for Computational Linguistics: ACL 2025, pp- 20192-20204, 2025.
Kevin Meng, David Bau, Alex Andonian, and Yonatan Belinkov. Locating and editing factual associations in gpt. In Proceedings of the 36th Conference Advances in Neural Information Processing Systems (NeurIPS), 2022.
Todor Mihaylov, Peter Clark, Tushar Khot, and Ashish Sabharwal. Can a suit of armor conduct elec- tricity? new dataset for open book question answering. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 2381-2391, 2018.
Alexander Modell, Patrick Rubin-Delanchy, and Nick Whiteley. The origins of representation man- ifolds in large language models. arXiv preprint a7x5v:2505.18225, 2025.
Hassan Sajjad, Fahim Dalvi, Nadir Durrani, and Preslav Nakov. On the effect of dropping layers of pre-trained transformer models. Computer Speech & Language, 77:101429, 2023.
Keisuke Sakaguchi, Ronan Le Bras, Chandra Bhagavatula, and Yejin Choi. Winogrande: An adver- sarial winograd schema challenge at scale. Communications the ACM, 64(9):99-106, 2021.
Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01 2019.
Shoaib Ahmed Siddiqui, Xin Dong, Greg Heinrich, Thomas Breuel, Jan Kautz, David Krueger, and Pavlo Molchanov. A deeper look at depth pruning of llms. In Proceedings of the ICML 2024 Workshop on Theoretical Foundations of Foundation Models, 2024.
Oliver Sieberling, Denis Kuznedelev, Eldar Kurtic, and Dan Alistarh. Evopress: Towards optimal dynamic model compression via evolutionary search. arXiv preprint arXiv:2410.14649 2024.
Jiwon Song, Kyungseok Oh, Taesu Kim, Hyungjun Kim, Yulhwa Kim, and Jae-Joon Kim. Sleb: Streamlining Ilms through redundancy verification and elimination of transformer blocks. In Proceedings of the 4/th International Conference on Machine Learning (ICML), 2024.
13

---

Mingjie Sun, Zhuang Liu, Anna Bair, and Zico Kolter. A simple and effective pruning approach for large language models. In Proceedings of the 12th Interaational Conference on Learning Representations (ICLR), 2024.
Qi Sun, Mare Pickett, Aakash Kumar Nain, and Llion Jones. Transformer layers as painters. In Proceedings of the 39th AAAI Conference on Artificial Intelligence (AAAI), pp. 25219-25227, 2025.
Curt Tigges, Oskar John Hollinsworth, Atticus Geiger, and Neel Nanda. Linear representations of sentiment in large language models. arXiv preprini arXiv:2310.15154 2023.
William Timkey and Marten Van Schijndel. All bark and bite: Rogue dimensions in transformer language models obscure representational quality. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 4527-4546, 2021.
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Proceedings of the 31st Con- ference on Advances in Neural Information Processing Systems (NIPS), 2017.
Andrés Villa, Vladimir Araujo, Francisca Cattan, and Denis Parra. Interpretable contextual team- aware item recommendation: application in multiplayer online battle arena games. In Proceedings of the 14th ACM Conference on Recommender Systems, pp. 503-508, 2020.
Frank Wilcoxon. Individual comparisons by ranking methods. In Breakthroughs in statistics: Methodology and distribution, pp- 196-202. Springer, 1992.
Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Remi Louf, Morgan Funtowiez, Joe Davison, Sam Shleifer. Patrick von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame, Quentin Lhoest, and Alexander Rush. Transformers: State-of-the-art natural language processing. In Qun Liu and David Schlangen (cds.). Proceedings of the 2020 Conference Empirical Methods in Natural Language Processing (EMNLP), pp. 38-45, Online, October 2020. Association for Computational Linguistics. doi: 18.18653/v /200022 /2t00/0...mmmmdmm......mmm URL htttps://aclattoo/l http:/o....rr222...mmmmddd......
Peng Xu, Xiatian Zhu, and David A Clifton. Multimodal learning with transformers: A survey.
IEEE Transactions on Pattern Analysis and Machine Intelligence, 45(10):12133-1213, 2023.
Guang Yang, Yu Zhou, Xiangyu Zhang, Wei Cheng, Ke Liu, Xiang Chen, Terry Yue Zhuo, and Taolue Chen. Less more: Towards green code large language models via unified structural pruning, Information Processing & Management, 104580, 2026.
Yifei Yang, Zouying Cao, and Hai Zhao. Laco: Large language model pruming via layer collapse. In Findings of the Association for Computational Linguistics: EMNIP 2024, pp. 6401-6417, 2024.
Rowan Zellers, Ari Holtzman, Yonatan Bisk, Ali Farhadi, and Yejin Choi. Hellaswag: Can a ma- chine really finish your sentence? In Proceedings of the 57nd Annual Meeting of the Association for Computational Linguistics (ACL), pp. 4791-4800, 2019.
Yang Zhang, Yanfei Dong, and Kenji Kawaguchi. Investigating layer importance in large language models. In Proceedings of the 7th BlackboxNLP Workshop: Analyzing and Interpreting Neural Networks for NLP (BlackboxNLP),, pp. 469-479, 2024a.
Yang Zhang, Yawei Li, Xinpeng Wang, Qianli Shen, Barbara Plank, Bernd Bischl, Mina Rezaei, and Kenji Kawaguchi. Finercut: Finer- -naanne interpretable layer pruning for large language models. In Proceedings of the NeurIPS 2024 Workshop on Machine Learning and Compression, 2024b.
Longguang Zhong, Fanqi Wan, Ruijun Chen, Xiaojun Quan, and Liangzhi Li. Blockpruner: Fine- grained pruning for large language models. In Findings of the Association for Computational Linguistics: ACL 2025, pp. 5065-5080, 2025.
14

---

A RELATED WORK (EXTENDED VERSIoN)
A.1 UNDERSTANDING TRANSFORMER INTERNALS
The question of how Transformer models represent and process information was first explored in depth with BERT (Devlin et al. 2019). Early studies revealed that BERT captures structural prop- erties of language across its layers. Lower layers focus phrase-level and surface features, while intermediate layers encode a rich hicrarchy of linguistic information Sooomation-ttattnng starting with syntactic struc- tures and transitioning to semantic representations at higher layers (Jaahhar et al. 2019). Addi- tionally, some attention heads within BERT specialize in specific linguistic tasks, such as syntactic parsing and coreference resolution, aligning with traditional linguistic notions (Clark et al.) 2019b). These findings provided initial insights into how Transformer-based models organize knowledge, setting the stage for broader investigations into their internal mechanisms.
Recent studies have further refined our understanding of how Transformers encode and manipulate information. Feed-forward (FF) layers function as key-value memory systems, storing patterns from training and influencing the model's 's output distribution (Geva et al. (021). This structured memory particularly important for factual recall, as knowledge is primarily stored in the FF layers of middle blocks (Meng et al., 2022). Meanwhile, attention layers propagate and retrieve stored information, dynamically integrating relevant associations for prediction (Geva et al. 2023).
Beyond factual recall, Transformers encode abstract and structured representations, They capture spatiotemporal relationships in text (Gurnee & Tegmark, 2024) and implement a depth-bounded recurrent mechanism that stores intermediate results at selected token positions (Brinkmann et al.) 2024]. Additionally, high-level concepts such as sentiment are encoded in linear activation structures Tigges et al. 2023), highlighting the model's ' ability to organize information hierarchically.
Another line of research suggests that certain Transformer layers contribute little to the model's final prediction. By analyzing how probability distributions evolve across blocks, researchers observed that in many cases, a model's prediction stabilizes early-once once a token becomes the most probable, it remains unchanged until the final layer. These stabilization points, known saturation events, suggest that the model's later layers primarily refine rather than reshape its output (Geva et al.] 2022). Further studies confirmed that even lower-ranked tokens follow the same pattern once the Top-1 prediction stabilizes (Lioubashevski et al. (025). Moreover, experimental evidence shows that middle blocks can be removed or swapped with minimal impact on performance (Sun et al. 2025).
These findings have led to the prevailing belief that some Transformer blocks are inherently unim- portant. In this work, we revisited this assumption by showing that a block's relevance can vary significantly depending on the task suggesuggn that global conclusions about importance may over- look task-specific dynamics.
A.2 MEASURING BLOCK RELEVANCE
Most research on measuring block relevance has been conducted in the context of structured pruning
(Men al. 2025 Gromov et 2025 He al. 2024 Kim et al.) 2024 Ma et al. 2023 Zhang
ct al.) 2024b; Yang et al. [026] Sieberling et al. 2024). The goal is to remove the least relevant
blocks while preserving model performance, which has led to the development of several techniques for estimating a block's 's importance.
A foundational but now outdated approach is magnitude- based pruning, which removes blocks based on their parameter magnitudes. While widely used for individual weight pruning (Li et al.) (016)). this method proved too simplistic at the block level. Still, it served as a useful baseline in the early development of structured pruning techniques.
More recent work has focused on proxy-based relevance scores that analyze how much a block transforms its input. One popular class of methods uses cosine similarity between a block's input and output, assuming that low transformation implies low relevance (Men et al. 2025 Gromov et al. 2025 He et al.; 2024). Other studies rely on Taylor expansion techniques estimate the change in loss when a weight or block is removed, providing a more gradient- informed view of importance
(Kim et al. 2024
Ma al. 2023
15

---

Another set of methods evaluates relevance by comparing the pruned model's output the original model's, s. using metrics like cosine similarity, norm differences, and divergence- based measures. Zhang al. (2024b), for example, employ Censen-Shamen divergence to guide pruning and achieve state-of-the-art results. Follow-up work builds on this idea using KI. divergence, a closely related metrie: Yang al. (2026) apply it as part of multi-step strategy create smaller models tailored to code generation, while Sicberling et al. (2024) combine it with a novel selection algorithm that prunes blocks jointly rather than iteratively.
Perplexity-based metrics are also used, especially in language modeling, where blocks are consid- ered irrelevant if their removal does not significantly increase perplexity (Kim al., 2024 Zhong et al., [2025] Song et al. 2024). Beyond gruning-speciffe methods, some studies draw on game- theoretic tools, such as approximations Shapley values, to assess a block's contribution to the model's 's output in more theoretically grounded way (Zhang et al. 2024a Siddiqui et al. 2024).
While most pruning research focuses on overall effectiveness, few works ask whether a block's relevance remains stable as the model is progressively pruned. [He et al. (2024) and et al. (2024). instance, compare one-shot pruning- where relevance scores are computed single time and used to select all blocks to prune-with iterative pruning, where relevance is recalculated and re- ranked after each pruning step. Their findings suggest that one-shot pruning can match or even outperform iterative pruning for structured sparsity. However, their analyses center end-task accuracy rather than how relevance itself shifts during the process. This leaves an important question unanswered: Does pruning change block relevance? A question that answered in Section C.5
While most methods rely on a single calibration dataset to assess relevance, some recent studies have started exploring the generalizability of relevance scores across datasets. He et al. (2024) found that relevance maps computed via cosine similarity appear largely consistent across datasets, leading them to conclude that certain layers may be universally important or unimportant. This perceived dataset-agnostic behavior motivated their decision to use a single calibration dataset throughout their experiments. Their findings also connect to naturation-based analyses (Geva et al. 2022; Li-
oubashevski et al. 2025). which similarly suggest that once model's prediction stabilizes, later
computations may less critical.
We took He et al. (2024) as our primary baseline because they provide one of the few systematic attempts to visualize and quantify block relevance across tasks. Their heatmaps offered a clear point of comparison for our own cross-task analysis, which was built on their setup but replaces similarity- based relevance with a gasudgroud,ed, accuracy-based metric.
B PROOF THEOREM
B. AUXILIARY RESULT
Before proving Theorem let's first prove the following theorem:
Theorem 2 For any > 0 and unlabeled calibration dataset D = ={s(t)) y there exists decoder-
only Transformer f with L > 3 and labeling function L D 10,1) satisfying the following conditions:
1. There exists an intermediate layer 1 E (1,..., and CosSimScorooi; cfor all i 1.
T ,..,,,,
2} such that CosSimScore((; D)
2. The full model achieves perfect accuracy: (=(()) C(s(0) for all ( E D. but removing layer I causes the model's accuracy to drop to zero: (s(()) )++ + ((s()) all (0) e D..
This result can viewed as simplified version of Theorem where the labeling function is binary and freely chosen, rather than being fixed by the dataset ID.
Let (?) = x (0.i) denote the embedding of sequence s(,) where X (1.0) E Raxd, with the number of tokens and d the hidden dimension. The transformation at block is given by
(1+1,1) x (1.4) ((x(,,))
16

---

A decoder-only transformer with L blocks is then
(²() =U U F()(()) Σ [(xxa))o0)) 000)
where U-) denotes the final transformation applied the output of the last block (e.g., an unem- bedding layer for next-token prediction or a classification head).
We also define the model obtained by removing block I, denoted f41 In this case, the hidden state (1-11) directly connected to block + 1, bypassing block 1. Formally,
L-1 (k:1) 0(1)))
) = E(s(0) + (xx(0))))
with the convention that
(1+1.)) X (1-1.)) + (0aa)++f((x0 (xx(1-10) 0((-1)) for the pruned model.
Let I, denote the column vector of size n with all entries equal one, and O,, the zero vector the same size.
Consider the embedding function
F(s:) = n0 8 1,
0 [,0],
Vs( E TD;
with hidden dimension d = and > Thus, every token in the vocabulary has same embedding.
Define the labeling function L()()) 0 for all (0) E D, i.e., all sentences belong to the same class. The final transformation standard classification head
U(X)
arg max softmax
X nto w
(0.1)
where X, X,,) the representation of the last token, and
[
WU
1
0
We now construct three blocks as follows (with M >> 1):
(1,0 (0,) + 10,c (0)))
M m,0],
X (2,) (1.1) 50
(1.1)
0 nta
0,00]
X (3.1) = x (2.4) + (8M
1,00
-M 100
Each Transformer block contains forward network of the form
FFN(X) ReLU(X 1, W2 + 1
where W1, W2 E gd and b1, by Rd Note that the bias vectors written as b, so that dimensions match for sequence length n.
To enforce that the multi-head attention does not modify the representation, we set its output to zero, so that the residual connection yields the identity mapping.
For the FFN, we choose Wi I. W I, and b 0, so the residual effect comes only from b2- Specifically:
In Block 1, set b, (0, 0, M) add M in the third coordinate.
In Block 2, set b2 (ō, 0, 0, to add in the first coordinate.
17

---

In Block 3, we instead choose
M
07
W
0
0
b2 - (0.0, (0,0,-M)*,
0
that the FFN contributes the transformation
[6M 1,
Ont9
-M nc0]
With this construction, the model output is
))) U (16(M + 1) 1 no0
8. 1 n,6)
Ontil) -((s))
while pruning the second block yields
(s = ([O 8 1,00
O,ta] = 1 + C(s:).
Finally, we compute the cosine-similarity scores:
8 V82 M
CosSimScore(O;; ID)
V02 + M
M2
()))
V28² + M
8(M 1)
CusSimScore(2::)) V + M /1 M2 M
As M - oo, we obtain
CosSimScoro(0; D) + 1, ())) + CosSimScoro(2;D)) + 1.
Thus, by choosing appropriate values of M and 0, we can ensure
CosSimScoree1;nnn 6,
which completes the proof for Theorem 2
also worth noting that this argument can be extended to multiple dimensions that do not affect the task, rather than relying on single one. In this way, instead of requiring large value of M, can use several smaller dimensions M1. M2, Md-
Finally, might worry that this construction would fail in practice because each block also in- cludes a LayerNorm operation applied after the residual aggregation. However, in our setup every row (") is identical, so each token representation has the same mean and variance at every step. Consequently, the effect of LayerNorm is deterministic and can be exactly canceled out by choosing the LayerNorm parameters (y, (3) appropriately. In particular, setting y and to rescale and shift the normalized vectors recovers the mre-noomllized representation, ensuring that LayerNorm does not alter the intended behavior of the construction.
B.2 GENERAL CASE
We first show that a decoder-only Transformer can trivially overfit any labeled calibration dataset D ((s(0) ( where (1)) # g0) for i and yft) (O....,C-- 1).
Suppose that the tokenizer assigns token to each sequence s Define an embedding function E(-) such that
B(s(0)) = (1) E BIXC
we let
B(s(0) (1)0
where eb) is the j-th standard basis vector RCC then the classification head
U(X) arg max softmax XW C-1)
18

---

with
(ell))
W
(e(c))
perfectly classifies the dataset, i.e. f)(())= = y Thus, the model can memorize the dataset without any Transformer blocks, using only embeddings and the unembedding matrix.
We now extend this idea construct model satisfying the conditions of Theorem dimension be d = 2C + 1. Define the embedding as
Let the hidden
Ei((!)) = 8 .ee (2))+ E R2
so that each input is mapped into a unique coordinate among the last C' dimensions (beyond the first C'+ + 1).
We construct three Transformer blocks as follows (with M > 1):
Block 1, Adds M coordinate C'
X (1.) X (0.1) + M M.e (C+1)
Block 2. Adds ( i.c. one-hot signal in the first C coordinates corresponding to the correct class:
(2, x (1,0 8. (000 +1)
Block 3. Amplifies the signal in the first C coordinates by (M - 8), subtracts M from coordinate C + 1, and adds a misleading one-hot vector from the last C' dimensions:
x (3.1) = (2.1) + (M - 5) (y ee (C+1) - e (C-g())
As in the proof of Theorem 2 we ensure that multi-head attention acts as the identity by setting its output projection Wo = 0, and we use the feed-forward networks with suitable (W1, W2, b, b2) to realize the desired additive transformations.
After the three blocks, the first C coordinates of (3.5) are dominated by (M + 8) e (11)
M ( +11), while the misleading additions are suppressed. Thus, the classifier V correctly outputs ( for all and the model achieves perfect accuracy.
However, if Block 2 is removed, then the model never inserts the signal in the first coordinates. Block 3 then only contributes spurious information, and the classification head produces incorrect labels for all samples. Therefore, the pruned model fails completely.
Finally, as in Theorem 2 compute the cosine similarity scores for each block. By taking M + oo and choosing appropriately, we ensure that Block attains CosSimScore(I; ID) = e, while the others approach 1. Thus, the theorem follows.
Two final remarks are worth noting. First, if the number of classes C' is odd, the pruned model may not achieve accuracy. Specifically, instances assigned to class C-1 will be classified correctly, as the misleading signal coincides with the correct label. This issue is trivial to resolve by adjusting the label assignment class structure.
Second, as the proof of Theorem [ the presence normalization layers does not invalidate the construction. This is because the mean and variance of each token representation within block remain constant across instances, ensuring that normalization does not interfere with the mechanism underlying the proof.
C FURTHER ANALYSIS ABOUT RELEVANCE CONSISTENCY ACROSS DATASETS
In this section go deeper in the analysis done in Section 5.1 about the work from He al. 2024
19

---

C.I IMPLEMENTATION DETAILS
All experiments conducted pre-trained models, using code based the EleutherAl LMM Evaluation Hamesss (Gao et al. 2024) for our accuracy-based scores. We used a batch size of 4 and ran evaluations on NVIDIA RTX A6000 and RTX 4090 GPUs.
To compute cosine similarity relevance scores, we used the same hardware and followed the method- ology introduced Section g based the implementation from He et al. (2224) Each sample in this method is full input sequence matching the model's context length (e.g.. 4096 tokens for Mistral-7B), constructed by concatenating multiple dataset instances until the required token length is reached. Because instance lengths vary across datasets, the number of instances per sample also varies. Following He el. (2024), we use 256 such samples per dataset for C4, LIMA, CodeAlpaca, and MathInstruct.
For fairness, we used the same dataset instances to compute our accuracy-basee relevance scores. However, unlike cosine similarity, we did not concatenate instances into long sequences. Instead, we evaluated next-token prediction at the instance level, computing accuracy on the last token of each instance. Thus, while the underlying data is shared, the two metrics differ in their evaluation granularity.
For the remaining datasets, used the training split associated with each task and modified the input format used during relevance scoring to compute cosine similarity scores. Specifically. instead of generating full answer phrases, presented all answer options explicitly (e.g.. "A" "B", "C", "D") within the prompt and computed the probability of generating only the correct option token. This adjustment was necessary ensure the model received all relevant information required for task evaluation. In contrast, no such modification was needed for our accuracy- based metric, as we followed standard LM evaluation protocols for multiple-choice tasks.
Following these protocols (Gao et al., 2024). we constructed input prompts by concatenating the context, question, and each answer option individually. For each example, we computed the total log-probability of the full prompt associated with each option and selected the one with the highest value. We report normalized accuracy, which adjusts log-probaiilities for option length to ensure fairness between longer and shorter candidates. A prediction is counted correct if the selected option matches the gold label.
C.2 NORMALIZATION DETAILS
To complement block relevance visualizations and quantify how accuracy-based score cap- tures more variation across datasets than cosine similarity, we compute the variance in relevance across tasks for both methods. For each model and method, we first apply z-score normalization to the block relevance scores, then calculate the variance across datasets for each of the 32 lay- ers ers-yielding 32 variance values per model-method combination. In Figure 5 we report the mean variance and standard deviation error bars for each model and method.
C.3 WIL.OOXNN SIGNED-RANK TEST
When comparing our accuracy-bassed based relevance cosine similarity, we found significantly higher variance using our metric. In fact, the Wilcoxon signed-rank test (Wilcoxon) 1992) resulted in the following values: p-value 1. 1.7e-7, W-value = 20 for Mistral; p-value 8.8e-9, W-value = for OLMo; and p-value 4.6e-10, W-value = 0 for Pythia, respectively.
C.4 RELEVANCE DURING TRAINING
Block relevance patterns evolve during training, but in markedly different ways depending on the metric. Our accuracy-based metric (Figures 7 and 7B) displays chaotic behavior through train- ing, with some blocks gaining or losing relevance between checkpoints without following smooth trends. While certain blocks in OLMo tend to increase in relevance, these changes are rarely mono- tonic. This fluctuation suggests that blocks may take on transient, adaptive roles throughout train- ing myn-miimmcss that cosine similarity tends obscure.
20

---

Cosine similarity (Figures 7C and PD) reveals consistent patterss across models. For both models, most blocks either maintain their relevance scores or gradually increase throughout training. This suggests that some blocks increasingly modify their inputs training progresses. However, it's important to note that this does not necessarily reflect how much each block contributes to the model's output.
Figures 9 a present the results on CodeAlpaca, C4 and LIMA, respectively, using OLMo. As with Math the cosine similarity-baser relevance (bottom figures) produces nearly identical heatmaps across datasets, reinforcing the metric's s stability and dataset-agnoste nature. Interestingly, we also find pattern not discussed in prior work- 2 shows a non-monotonic trajectory where its relevance increases at early stages and later decreases, pattern that could be studied in future works.
In contrast, the accuracy-based relevance (top figures) continues to show less consistent and less interpretable patterns. While some blocks exhibit periods of increased or decreased relevance, there are no clear, sustained trends comparable to those seen with cosine similarity.
Figures I to 13 show the results for the same experiment, but with Pythia on the same four datasets used in previous sections. Unlike the OLMo figures, we apply separate color scale for block in the cosine similarity plots (bottom figures) for all Pythia figures. This is necessary because the relevance values of the first block are significantly higher than the rest-usinng using single color scale would make differences between blocks to 31 nearly invisible.
As with OLMo, cosine similarity yields nearly identical relevance patterns across datasets, rein- foreing the observation that this metric is largely insensitive to the specific task. However, a new behavior emerges in Pythia: some blocks show initial drop in relevance between the first and second checkpoints, but then stabilize or fluctuate rather than continue decreasing. This, along with the unusual pattern in block 2 in OL,o, suggests that certain relevance dynamics may be model- specific. More precisely, we suspect they may be seed-specific: different initializations of the same model trained on the same data could produce distinct relevance trajectories.
In contrast, our accuracy-based metric continues to show no clear, smooth patterns across training steps, and exhibits noticeable differences between datasets. One particularly interesting finding is that blocks 17 to 31 appear nearly irrelevant under cosine similarity for all datasets- yet our method shows that pruning some of these blocks can significantly hurt performance. This further illustrates that cosine similarity can miss important functional contributions of blocks, reinforcing the need for task-aware relevance measures.
Finally, through our experiments, we do not observe a clear relationship between block relevance patterns and the model's accuracy gains throughout training for either metric. In other words, changes in block relevance do not directly correlate with improvements in overall performance, highlighting the complexity of the internal dynamics involved during model learning.
OLMo
Pythis
1.0
122
1.0
300
0.6 Layer
0.-
2000 C-2
04
04
0.8
Accunsay
Acourccy Sated releva soore
10
1.0
134
0.6
5000
Layer
0.1 02.
0.3
0.4
0.5
0.6 0.7
0.08 5,10 0.15 Cadire ammilttt--baadd
0.20
01:30
Cocine simbarty based
Figure 7: Block relevance during training in OLMo (left) and Pythia (right) on the MathInstructt dataset. A. each row corresponds to model checkpoint trained given number of tokens in billions (OLMo) or train iterations in millions (Pythia on B), with accuracy reported on the y-axis. A, B, Accuracy-based score. C, D, Cosine-similarity score.
21

---

Train Tokens (billions)
250 (0.54)
500 (0.57)
1000 (0:59)
0.90
1250 (0.61)
1750 (0.61)
0.85
2000 62)
64)
2500 (0.64)
30 31
Accuracy-based Relevance score
Train Tokens (billions)
(0.54)
500 (0.57)
(0.59)
1250 (0.61)
(0.61)
2000 (0.62)
2250 (0.64)
2500 64)
10
12
13
20
30 31
32
Cosine Similarity-based Relevance score
Figure 8: Block relevance during training in OLMo the CodeAlpaca dataset. Each row corre- sponds to a model checkpoint trained on given number of tokens billions (shown on the y-axis), with accuracy reported in parentheses. (Top) Accuracy-based score. (Bottom) Cosine-similarity score.
Train Tokens (billions)
(0.41)
500 (0.44)
0.95
750 (0.45)
(0.46)
0.90
1250 (0.47)
(0.47)
2000 (0.48)
(0.48)
10
-0.4
-02
0.0
02
0.4
0.6
0.8
Accuracy-based Relevance score
Train Tokens (billions)
(0.44)
750 (0.45)
1000 (0.46)
(0.47)
1500 (0.48)
(0.47)
2000 (0.40 48)
2250 (0.48)
10
011
02
0.3
0.4
0.5
06
0.7
088
Cosine Similarity-based Relevance score
Figure 9: Block relevance during training in OLMo on the C4 dataset. Each row corresponds. to model checkpoint trained given number of tokens in billions (shown the y-axis), with accuracy reported in parentheses. (Top) Accuracy-based score. (Bottom) Cosine-similarrty score.
22

---

1.00
Train Tokens (billions)
250 (0.24)
750 (0.28)
1000 (0.28)
1500 (0.28)
1750 (0.27)
0.85
2250 28)
0.80
2500 (0.23 29)
Accuracy-based Relevance score
Train Tokens (billions)
250 (0.24)
500 (0.26)
(0.28)
1000 (0.20)
1250 28)
(0.28)
1750 (0.27)
2000 28)
20)
2500 (0.29)
02
Cosine Similarity-based Relevance score
Figure 10: Block relevance during training in OLMo the LIMA dataset. Each corresponds to model checkpoint trained on a given number of tokens in billions (shown on the y-axis), with accuracy reported parentheses. (Top) Accuracy- baased score. (Bottom) simmia--imilartty score.
Train Iterations (thousand)
250 (0.5)
500 (0.55)
1000 (0.57)
0.90
1250 (0.58)
(0.6)
1750 (0.59)
0.85
2000 (0.6)
(0.6)
2500 (0.6)
24
29
30
31
Accuracy-based Relevance score
Train Iterations (thousand)
(0.5)
500 (0.55)
0.95
750 (0.56)
(0.57)
1250 (0.58)
0.90
1500
(0.59)
2000 (0.6)
2250
(0.6)
2
10
12
13
15
16
23
25
26
78
29
30
31
32
0.05
010
015
020
025
0.30
0:35
Cosine Similarity-based Relevance score
Figure 11: Block relevance during training in Pythia on the CodeAlpaca dataset. Each row cor- responds to model checkpoint trained with a given number of iterations in thousand (shown on the y-axis), with accuracy reported in parentheses. (Top) Accuracy-basse score. (Bottom) Cosine- similarity score.
23

---

Train Iterations (thousand)
100
500 34]
0.95
750 (0.34)
(0.35) 1000
1500 (0.36)
2000 30)
2250 37)
0.80
-0.4
-0.2
0.0
02
0.4
0.6
0.8
Accuracy-based Relevance score
Train Iterations (thousand)
1.00
250 (0.32)
(0.34)
0.95
750 (0.34)
1000 (0.35)
1500 (0.36)
1750 (0.36)
0.85
2250 (0.37)
0.80
2500 (0.37)
0.05
010
0.15
0.20
Cosine Similarity-based Relevance score
Figure 12: Block relevance during training in Pythia on the C4 dataset. Each row corresponds to model checkpoint trained with given number of iterations in thousand (shown on the y-axis), with accuracy reported parentheses. (Top) Accuracy-baa based score, (Bottom) Cosine-simille Cosine-similarity score.
Train Iterations (thousand)
1.00
500 (0.27)
0.95
750 (0.28)
(0.29)
0.90
1250 (0.28)
1500 (0.3)
(0.29)
2000 (0.29)
0.80
(0.31)
-0.4
-0.2
0.0
0.2
0.4
0.6
0.8
Accuracy-based Relevance score
Train Iterations (thousand)
1.00
250 (0.23)
(0.27)
0.95
750 (0.28)
1000 (0.29)
(0.28)
1500 (0.3)
1750 29)
29)
2250 (0.3)
0.80
2500
0.05 010
0.15
0.00
025
Cosine Similarity-based Relevance score
Figure 13: Block relevance during training in Pythia on the LIMA dataset. Each row corresponds model checkpoint trained with given number of iterations in thousand (shown the y-axis), with accuracy reported in parentheses. (Top) Accuracy-based score. (Bottom) Cosine-similarity score.
24

---

A
Mathinstruct
Aoc
B
CodeAlpaca
Layara dooppee
Apc
1.0
DA1
0.9
0.57
0.79
0.8
10.31
10
15
20
25
30
10
15
20
25
30
0.4
0.2
+0.2
+0.4
+0.6
+0.8
-04
-02
-0'2
+0.4
10.6
+0.9
Accuracy- based relevance
Accuracy basedd relevance
Leppracrepped
Layers dropoed
0.9
F2
Dog
252
D27
2.14
C224
20
30
5
10
15
20
25
30
0.05
0.15
0.2
0.25
033
0.35
0.4
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
Cosine Similanty based relevance
Cosine Similarit
Figure 14: Block relevance on Mistral in MathInstruct (left) and CodeAlpaca (right) as blocks are iteratively pruned. A, at each row the least relevant block, according to the Accuracy-basee score of Mistral on MathInstruct, is removed and shown with a gray cross. The accuracy of the pruned model is shown on the right. B, the same on CodeAlpaca. C, D, using cosine-similarity score.
C.5 RELEVANCE DURING PRUNING
Pruning significantly changes block relevance-especiallyy under our accuracy- based metric. As model blocks are pruned, we observe that certain blocks increase in importance while others be- come less critical. These shifts reveal that accuracy- baseed relevance captures latent dependencies and compensatory dynamics between layers. To better understand how these shifts in relevance emerge, we performed iterative structured pruning on Mistral-7B. At each step, we (1) compute block relevance using either our accuracy-based method or cosine similarity, (2) remove the least relevant block, and (3) repeat steps one and two until 25% of blocks are pruned. Figure [4 shows results for MathInstruct and CodeAlpaca, while Figure LS and Figure 16 show results for C4 and LIMA respectivelly. The figures also report the accuracy for the same dataset used for pruning.
Pruning using the accuracy- based score (Figures I4A and [4B) reveals complex dynamics. First, after pruning block, earlier (closer to the input) and/or later (closer to the output) blocks can gain relevance. For example, in MathInstruct (Figure 44)) block 17-initially of moderate impor- becomes highly relevant once later blocks are removed, suggesting that pruning can reassign or expose latent functional roles. Second, blocks with negative relevance (green blocks) become neutral or positive after pruning. For example, in the first row of Figure [4J4, several green blocks change behavior after pruning block 23, implying that they were not inherently harmful but instead interacted negatively with it. Third, blocks with high relevance decreased their value after pruning. For example, we observe that block 31 becomes less relevant after block 23 is removed, which we speculate reflects compensatory role-block 31 may have been mitigating the detrimental effects of block 23, pattern aligning with prior findings on corrective behavior (Geva et al. 2022). These examples suggest that our metric can be tool to study the inner workings of transformers.
As expected, when pruning using our method, we observed differences in relevance at the dataset level. In MathInstruct, pruning blocks triggers sharp shifts in relevance, while in CodeAlpaca, the relevance landscape remains relatively stable in the early pruning steps. Notably, CodeAlpaca lacks negatively relevant blocks at initialization, suggesting less redundancy or more uniform functional distribution, among other possible explanations. This phenomenon opens new avenues for research.
On the other hand, under cosine similarity (Figures 14C and 14D), we observe that relevance changes after pruning are generally local and limited. Only the later blocks of the network, those po- sitioned after the pruned block, display relevance changes according to this measure. For instance, in MathInstruct, pruning block 27 results in slight increases of cosine-similarity score in later blocks, while earlier blocks remain unaffected. Even though one might expect this behavior given the local nature of the metric, this explanation is only partially correct. Since cosine similarity is computed lo- cally, only blocks following the pruned one can exhibit changes in relevance. Mathematically, these changes could be either increases decreases; however, in practice, we observe only increases.
25

---

1.00
0
(0.44) B
SEMIKK
AXW
AENAKA
(0.42) 0
3
0.90
X
5 (0.338
0.85
(0003)
X X
X
(0.34)
X
X
X
X
(0.32))
12
13
14
15
16
17
22
23
24
29
30
31
32
-0.2
Accuracy based Relevance score
00.444)
X
2
3
(
X
X
X
5 (0.333)
X
X
X
X
X
X
7 (0.255
X
X
(0.177)
10
14
15
16
17
18
23 24
25
26
30
31
0
0:35
Cosine amillarity-based Relevance score
Figure 15: Block relevance in Mistral on the C4 dataset as layers are incrementally pruned. In each row, the least relevant block (according to the corresponding metric) is removed and shown with gray cross. The accuracy of the pruned model is shown in parentheses. (Top) Accuracy- based score. (Bottom) Cosine-similarity score.
When using aceuracy-based relevance, iterative pruning produces a different model compared to one-shot pruning, which removes all least-relevant blocks simultaneously based on initial relevance scores. As shown in Figure [4| our metric reveals that block relevance changes significantly after each pruning step, with new dependencies and compensatory patterns emerging across layers. For example, under one-shot pruning, blocks 16, 19, 21, 23, 26, 27, 28, and 29 would be removed from Mistral (Figure 14A first row); in this case, the pruned model would exhibit accuracy of 0.22 (data not shown). In contrast, based on iterative pruning, we removed different blocks, resulting in pruned model accuracy of 0.44. Our results indicate that one-shot pruning may not be suitable when employing accuracy-based relevance. In contrast, cosine similarity yields nearly identical results for both one-shot and iterative pruning since relevance scores remain largely stable throughout the pruning steps.
Regarding C4 and LIMA datasets. We observe similar patterns to those previously discussed: our accuracy-basee relevance scores reveal richer dynamics than cosine similarity.
With the accuracy- based metric, gresses. In rare cases, such as block 1, relevance remains stable throughout. In contrast, cosine sim- ilarity mostly shows increasing relevance blocks that follow the pruned one, while other blocks remain largely unaffected.
both increases and decreases in relevance pruning pro-
interesting pattern emerges both C4 and LIMA: block 20 consistently increases in relevance under our metric. This may suggest shared functional role between these two tasks, though it may also be coincidental. A deeper investigation into this connection would be valuable.
Regarding the comparison between one-shot and iterative pruning, we noted that the two approaches often select different sets blocks for removal. However, the reasons for these divergences differ depending the relevance metric.
For cosine similarity (Figures [4C and I4p), the evolution mostly predictable. As discussed earlier, pruning block tends increase the similarity scores of subsequent blocks. As result, iterative pruning diverges from one-shot pruning primarily when the least relevant block is not one of the later-positioned layers. For example, in MathInstruct, block 28 initially had low relevance, but pruning earlier blocks (e.g.. block 27) increased its relevance, causing it to be excluded from later pruning steps. A similar shift happens with block 26. If the initial relevance ordering of blocks
26

---

1.00
(0044)
00 S
(0.46))
(0.46)
3
0.90
X
5 50.422
0.85
(1
X
X
X
(0.399
X
X
X
X
8
13
14
15
16
17
22
23
24
26
29
30
31
32
-0.2
Accuracy based Relevance score
00.44)
Drogged seaes
X
2
3
(
X
X
X
5 (0.36)
X
X
X
X X
7 (0.26)
X
X
(0.18))
10
14
15
16
18
23
24
25
26
31 32
0.20
Cosine Similarity- Relevance score
Figure 16: Block relevance in Mistral on the LIMA dataset as layers are incrementally pruned. In each row, the least relevant block (according to the corresponding metrie) is removed and shown with a gray cross. The accuracy of the pruned model is shown in parentheses. (Top) Accuracy- based score. (Bottom) Cosine-similarity score.
LIMA
10
25
50
125
250
500
2500
3000
Mathinstruct
CodeAlpaca
10
25
50
125
250
2000
2500
3000
HN Conmmmonnnn
HOMER Cammaaa
28
-0.4
-0.2
0.0
0.2
0.8
Figure 17:
Block relevance in LLaMA-3-8B across 4 datastes. In each we used different size of the dataset to compute the metric.
21-28 had been strictly decreasing, both pruning methods would have selected the same blocks. The observed deviations result from small, local shifts in relevance caused by positional effects during pruning.
C.6 SIZE OF THE CALIBRATION DATASET
To further analyze our metric, we applied to LLaMA-3-8B using four different datasets: C4, LIMA, Mathinstruct, and CodeAlpaca, each with varying dataset sizes. Figure 17 presents the results of this experiment. We observe that after using approximately 500 samples, the heatmaps begin to converge toward the scores computed with 3,000 samples. While some differences remain noticeable, they are not critical for the overall ranking; in other words, the sets of relevant and irrelevant blocks remain consistent.
27

---

MMLU (World Knowledge)
GSMBK (Math Reasoning)
HellaSwag (Common Sense Reasoning
80
Acc-based
Acc-based
Acc-based
60
Performance
Cop Sim based
Porformance
Sor-Sim besed
Performance
Cap Sm based
50
60
30-
40
30
10-
30
0.0 0.1 0.2 3.3 0.4 0.5 0.6 0.7 0.8
0.0 0.1 0.2
0.3 0.4 0.5
0.6
0.7
0.8
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Pruning Ratio
Pruning Ratio
Pruning Ratio
Figure 18: Evaluation LLaMA-3 --BB under the cosine-similarity pruning strategy of Gromov et al. 2025) compared with our proposed method and soiine-iimllarity score with an iterative pruning strategy.
D FURTHER ANALYSIS ABOUT DIFFERENCES BETWEEN TYPE OF TASKS
Figure s8lss the same results as Figure 2 with the addition of results obtained using cosine sim- ilarity under iterative pruning strategy. As discussed in the main paper, the original conclusions still hold although the performance drop in HellaSwag is now less abrupt.
It's also worth noting that there clear differences between the two ways of applying the cosine similarity score, which supports our argument that this metric should be used with caution when making assumptions about the internal mechanisms of Transformer models.
E STRUCTURED PRUNING
E. IMPLEMENTATION DETAILS
Since all benchmarks used in our structured pruning experiments are multiple-choice tasks, we fol- lowed the same protocol and considerations as mentioned in Appendix C.I
We evaluate models in a zero-shot setting on all tasks except for MMLU, where we use the five-shot format commonly adopted in prior work (Zhang al. 2024b] He al. 2024).
For Taylor relevance, we implement the element-wise importance formulation from Ma et al. 2023 using absolute weight-gradient products aggregated via sum-identified setup in their study. For Cosine Similarity, we follow the approach of He et al. (2024), concate- nating multiple examples to form long input sequences that align with the model's context window. Explained in Appendix C.T
the best-performing
All models are evaluated using the LM Evaluation Harness (Gao al. 2024). ensuring consistency with prior structured pruning work. Experiments were run on NVIDIA RTX A6000 and RTX 4090
GPUs, using batch size of 4.
E.2 MISTRAL
To assess the generality of our approach across architectures, we replicate the structured pruning experiment described in the main paper (Section 6 using Mistral-7B. The pruning setup, datasets, evaluation method, and relevance proxies identical to those used in the LLaMA3 experiment.
As shown Table 4 our accuracy-based relevance method consistently outperforms all base- lines across tasks, confirming its robustness beyond a single model family. However, unlike with LLaMA3, the task-specific pruned models do not surpass the performance of the unpruned model. This aligns with observations in prior work (He al.) 2024: Zhang al.) (024b), which also port significant differences between models the percentage of original performance retained after pruning.
28

---

Table 4: Accuracy of pruned Mistral-7B models on eight downstream tasks. All methods remove 25% of the layers using task-specific relevance estimates computed from each task's training set. Our accuracy-based approach consistently outperforms baselines. Best results per task are in bold. "Original" refers the unpruned model.
Methods
Arc-C
Arc-E
BoolQ
OBQA
HS
PIQA
WG
MMLU
Original
53.67
79.55
83.73
44.4
81.03
82.26
74.27
62.48
Taylor
23.46
29.8
55.72
24.4
32.15
65.94
51.46
24.16
Cosine Similarity
42.41
60.23
66.73
37.4
70.43
73.72
70.48
42.29
Out. Cosine-Sim
38.41
68.39
64.62
37.8
70.82
78.56
61.8
26.69
Out. Norm-Sim
38.41
68.39
37.8
70.47
78.56
61.96
38.73
Out. Divergence-Sing
32.51
56.99
58.2
34.4
66.97
74.32
59.83
33.41
Perplexity
40.96
59.18
64,86
36.4
62.98
71.71
64.72
57.86
Acc (Ours)
46.42
74.83
82.29
42.4
75.77
80.52
72.46
61.18
Table One-shot structured pruning results on LLaMA3-8B across eight downstream benchmarks. In this setting, relevance scores are computed once and used to prune 25% of layers in a single step. While our method occasionally underperforms others this configuration, it remains highly competitive overall. Notably, the iterative version of our method consistently outperforms all one- shot baselines, highlighting the benefits dynamic relevance estimation.
Method
Are-C
Arc-E
BoolQ
IIS
OBQA
PIQA
WG
MMLU
Original
53.16
81.02
82.02
78.94
44.8
81.28
73.56
65.11
Taylor Cosine Similarity
33.36
56.14
61.25
56.77
34.8
71.98
54.14
23.64
47.61
68.86
70.4
71.09
39.4
76.39
70.39
35.12
Out. Cosine-Sin Sim
44.8
68.01
56.33
51.19
38.2
73.29
59.19
23.72
Out. Norm-Sin
38.46
65.07
64.65
57.21
37.6
72.86
64.88
23.72
Out. Divergence-Sin
42,46
56.44
70.34
66.36
32.4
71.16
67.96
30.12
Perplexity
39.85
57.66
62.42
55.05
37.2
66.81
65.59
59.63
Acc 1-Shot (Ours)
42.24
72.09
52.2
74.49
44.4
79.54
66.93
53.21
Ace Iterative (Ours)
49.57
74.96
84.04
71.53
44
79.06
73.8
62.97
29

---

E.3 ONE-SHOT
To assess how method performs in simpler pruning setup, we replicate the main structured pruning experiment using one-shot approach. Instead of iteratively updating relevance scores during pruning. we compute each method's scores only once, rank the layers accordingly, and prune the bottom 25% in single step.
Results are shown in Table While our method occasionally underperforms others in the one- shot setting (e.g., on BoolQ). the iterative version of our method still outperforms all base- lines inneldinc one-shot variants- variants--highlgghteee highlighting the benefits of reevaluating relevance dynamically. This is consistent with our earlier findings in Section C.5 where we showed that block relevance evolves during pruning.
Interestingly, for few datasets (e.g., HellaSwag and OpenBookQA), our one-shot variant marginally outperforms its iterative counterpart. We hypothesize that this may result from domain shifts between the training and test splits, which can affect our accuracy-based signal. Addition- ally, selecting the optimal pruning set is ultimately a challenging search problem one that has been tackled explicitly in recent works (Sieberling al. 2024
E.4 TASK-INDEPENDENT PRUNING
The task-independent structured pruning setup consists of using a single dataset- re- ferred as calibration dataset-to compute relevance scores and prune the model accordingly. This results in one pruned model per pruning method, which is then evaluated across multiple down- stream tasks. The tasks used for evaluation typically mirror those presented the main paper.
It is worth notng that there is no standardized protocol regarding which dataset to use as calibration data or how many samples include. For example, Zhang et al. (2024b) uses WikiText-2 with 10 randomly selected instances, while He et al. (2024) uses C4, selecting 256 samples where each sample may span multiple instances (due to concatenation to match the model's input length; see Appendix C.I.
In our experiments, we adopt the setup of He et al. (2024) for consistency. However, to ensure fair cumparrison-epeciiiin against pruning methods like cosine similarity that operate instance- level granularity-we avoid concatenation and instead use the same 1,500 instances employed in the cosine similarity baseline. These instances were selected to construct 256 full-comtext-lengthh samples in a consistent and comparable manner.
Table 6 presents results for the LLaMA3-8P model under this classic pruning setup. As shown, the cosine similarity method outperforms all others, including our accuracy-basee metric. This outcome contrasts with the results reported by /Zhang al. (2024b), likely due to differences in calibration dataset choice and sample size.
These results consistent with expectations. Our method is tightly coupled to the calibration dataset, and-as as demonstrated throughout this peper-relevance is highly task- and data-dependent. Therefore, when the calibration dataset is misaligned with the evaluation tasks, performance likely to degrade.
Then, we evaluate our method using an alternative calibration dataset that combines training data from the target evaluation tasks. Table 2 reports results for LLaMA3-SB using a calibration set composed of 10% of the training data from each of the eight benchmarks. Under this configuration, our method outperforms all baselines, yielding a pruned model that achieves the highest average performance across tasks.
E.5 TASK RELATIONS
Given the task-independent results presented in Table 2 natural question arises: can the training set one task serve as a suitable calibration set for pruning models used in other tasks? Table explores this by showing the performance of different training sets used calibration data. We observe that most tasks achieve good average performance; notably, some tasks serve as particularly effective calibration sets for others.
30

---

Table 6: Task-independent structured pruning results for LLaMA3-8B across eight downstream benchmarks. Each pruning method uses the same 1,500-instance calibration dataset to prune the model once, which then evaluated on all tasks. Cosine similarity performs best this setup, while our accuracy-based method underperforms, likely due to its strong dependency on the calibration dataset.
Are-C
Are-E
BoolQ
HS
OBQA
PIQA
WG
MMLU
Mean
Original
53.15
81.02
82.02
78.94
44.8
81.28
73.56
65.11
69.99
Taylor
45.39
67.97
61.31
63.73
41.4
76.55
68.11
25.03
56.19
Cosine Similarity
43.34
65.32
76.7
70.24
36.8
73.39
70.96
40.78
59.69
Out. Cosine-Sine Sim
44.2
72.05
71.99
66.57
40.2
77.37
66.93
34.56
59.23
Out. Norm-Sim
42.66
70.12
66.94
67
41.4
78.73
67.72
34.1
58.58
Out. Divergence-Sing
43.54
71.25
68.62
65.09
39.6
76.01
65.94
30.57
57.58
Perplexity
40.19
63.47
44.43
65.96
39.2
74.48
64.4
29.4
52.69
Acc (Ours)
36.69
56.52
53.36
60.16
33.8
72.63
60.14
28.5
50.23
Table 7: Calibration dataset analysis. Each row shows the performance of LLaMA3-8B model pruned at 25% with our method using a different train set as a calibration dataset.
Are-C
Are-E
BoolQ
HS
OBQA
PIQA
WG
MMLU
Mean
Arc-C
49.57
74.45
69.08
72.91
42.2
77.8
67.56
40.2
61.72
Arc-E
51.37
74.96
66.94
73.62
43.6
78.51
71.59
44.82
63.18
BoolQ
40.7
66.96
84.1
67.97
38.6
73.23
71.82
35.09
59.81
HS
44.45
62.5
65.84
71.53
44.2
73.5
64.72
42.83
58.7
OBQA
45.82
66.5
75.38
66.88
44
75.24
65.9
50.45
61.27
PIQA
44.62
70.2
48.62
68.45
44.2
79.05
67.8
27.8
56.34
WG
44.71
68.73
78.13
69.85
39.2
75.03
73.8
42,4
61.48
MMLU
40.61
62.46
75.32
63.11
35
71.49
69.3
62.97
60.03
Building on Table 7 Figure 19 presents a graph illustrating the relationships between tasks. Each node corresponds to task, and a directed edge from task 1 to task 2 indicates that the training set of task I serves as either a good (blue) or poor (red) calibration set for task 2. We define "good" as achieving at least 90% of the performance obtained when pruning with task 2's own training set (see T, and "poor" as 10% or lower. To further indicate the strength of the effect, edge transparency varies: lighter blue denotes values closer the 90% threshold, while lighter red denotes values closer to 10%.
Several observations emerge from this analysis:
ARC-E and ARC-C serve as good proxies for almost all tasks, with the exception of BoolQ and MMLU, Interestingly, ARC-E is a better proxy than ARC-C, despite being an casier version of the same benchmark.
Nearly all tasks act good proxies for HellaSwag, except for MMLU. This finding is noteworthy because HellaSwag is generally considered a commonsense reasoning task, whereas MMLU requires broader world knowledge.
No task provides a good proxy for MMLU or BoolQ. For MMLU, this expected: world-knowledd benchmark, it likely requires calibration sets with overlapping domain coverage, which the other tasks lack. For BoolQ, however, the absence good proxies less straightforward. One possible explanation is that its yes/no format introduces unique structural properties that are particularly sensitive to pruning.
E.6 COMPUTATIONAL COST
To assess how long method would take achieve higher pruning ratios, quantify the benefits of using more compute, and evaluate larger models, we estimate the time required to prune 50% of L-LMMA3-88B using NVIDIA L.40S and pair of NVIDIA H100s, well the time required
31

---

BoolQ
H5
Arc-F
OBQA
Arc
PIQA
MMLU
WG
Figure 19: Relation between tasks. Computed from data in Table
Table 8: Estimated time (hours or days) required for pruning 50% of the model using our method using 1,000 instances per dataset.
Model
Batch Size
Hardware
C4
LIMA
MathInstruct
CodeAlpaca
Llama 3-8B
x L40s
11.56 hrs
10.02 hrs
4.72 hrs
1.60 hrs
Llama 3-8B
64
2 x H100
7,46 hrs
4.68 hrs
3.23 hrs
0.83 hrs
Llama 3-70B
8
2 H100
8.49 days
6.85 days
3.39 days
1.12 days
to prune 50% of LLaMA-3-708B using two NVIDIA H100s. These estimates are derived from the timings reported in Table 3] along with additional inference runs performed on both models using the dual-H100 setup. For each dataset, we measured the runtime using the maximum feasible batch size and recorded the reduction runtime obtained after removing block. The resulting estimates, summarized in Table 88, show that additional compute substantially benefits method and that pruning to higher ratios even even for larger models is feasible.
Additionally, analyze how runtime scales with the size of the calibration dataset. Figure 20 shows the time per sample for different calibration-set sizes when pruning 25% of LLaMA-3-8B on NVIDIA L40S. The results indicate that, beyond approximately 250 samples, the time per sample becomes stable and even slightly decreases across all datasets. This suggests that, in the worst case, our method scales linearly with the number of calibration samples.
Reducing the computational cost of our approach remains an important direction for future work. Parallelizing relevance computation across multiple GPUs-for example, assigning different sub- sets of layers to each device- could substantially reduce runtime. Additional gains may come from inference-optimizze frameworks quantization, though the latter may affect pruning behavior and requires further study. Moreover, many optimized frameworks do not yet support model modifica- tion, limiting their applicability to our method.
E.7 HEALING
Given that our results so far have not used healing as a post-processing step. natural question arises: Could healing allow less computationally expensive methods, such as Cosine Similarity, achieve comparable performance? Moreover, are the blocks selected by our method truly less important for the task than those selected by other methods?
To address these questions, we applied healing process to our task-dependent setup using the training split of each benchmark (the same data used for calibration during pruning). Tables 9 10 and show comparison of our method, Cosine Similarity, and the selection of random blocks to prune the same benchmarks used in previous sections. After pruning at a 25% ratio and then healing (Ta our method performs similarly to Cosine Similarity. However, we do not interpret this as evidence that our method is selecting worse- or even equally important- boocc--locsss compared to Cosine Similarity. Instead, believe this behavior reflects the fact that I.LMA-3-8B pruned by
32

---

Duration per sample
C4
200
LIMA
Mathinstruct CodeAlpaca
150
100
50
200
400
600
800
1000
Number of samples
Figure 20:
Time per sample versus the number of calibration samples for our method. Results are shown across multiple datasets using an L40S GPU while pruning 25% of LLaMA-3-8B.
25% remains expressive enough to perform well on these tasks. Supporting this interpretation, observe that even randomly selecting blocks to prune, followed by healing, can sometimes achieve competitive results.
We repeated the same experiment at pruming ratios of 50% (Table 10 and 75% (Table IT At 50% pruning. method consistently outperforms Cosine Similarity even after healing. At 75%, it still outperforms the baselines in several cases. The cases where our method no longer leads, however, coincide with performance levels close random selection, suggesting that the model simply lacks sufficient parameters to solve the task at such extreme sparsity.
similar trend-where healing provides clear benefits other pruning methods only around the 50% pruning regime-was was also reported by (Gromov et al. 2025), who compared Cosine Similarity with an even simpler pruning method across multiple pruning ratios and tasks.
To implement the healing stage, we fine-tuned each pruned model for 10 epochs using the corre- sponding training set for each task (see Figure[2I]oo per-epoch performance). For each method-tase pair, the tables report the best- best-performing epoch within this window. Across all experiments, model performance consistently peaked during the 10-epoch schedule and then began decline, indicating the onset of overfitting to the training set.
Following prior work (Gromov et 2025), we employed the Hugging Face Trainer API
(Woff
et al. 2020), QLoRA quantization using the bi t sandbytes library (Dettmers et al.
2023 and
LoRA adapters (Hu et al.] (202)) implemented with the pe library (Mangrulkar al. fine-tuning configuration was follows:
2022 The
Applied modules: [gate.proj, down-proj, up-proj]
Batch size: 16
LoRA a: 2
LoRA rank: 2
Peak learning rate: 3e-4
LoRA dropout: 0.05
LR scheduler: cosine
Warmup steps: 100
33

---

Table 9: Results on the tasks after pruning 25% the model LlaMa-3-8B using our method,
cosine similarity, random block pruning, we show the results with and without healing stage.
Method
Healing
Arc-C
Arc-E
BoolQ
HS
OBQA
PIQA
WG
MMLU
Accuracy (Ours)
No
49.57
74.96
84.04
71.53
44.00
79.06
73.80
62.97
Yes
57.42
83,84
89.30
75.71
51.20
84.22
82.08
61.64
Cosine Similarity
No
45.73
67.80
66.33
69.52
38.60
72.91
71.35
44.05
56.48
82.07
76.08
53.80
81.66
83.03
58.76
Random
No
24.08
36.80
46.03
45.74
25.48
51.73
44.73
25.47
Yes
43.86
73.68
82.16
67.06
46.84
78.68
74.65
34.63
Table 10: Results on the 8 tasks after pruning 50% of the model LlaMa-3-8B using our method,
cosine similarity, random block pruning, we show the results with and without healing stage.
Method
Healing
Arc-C
Arc-E
BoolQ
HIS
OBQA
PIQA
WG
MMLU
Accuracy (Ours)
No
28.67
40.95
79.57
48.69
32.40
63.28
54.46
55.64
Yes
38.65
62.96
86.33
57.39
40.60
75.24
70.48
55.53
Cosine Similarity
No
25.34
27.78
42.72
26.64
29.40
52.77
50.51
22.95
Yes
33.96
59.68
78.38
51.31
40.40
73.01
66.14
26.11
Random
No
20.87
19.72
42.24
26.52
22.36
41.14
39.43
24.85
Yes
26.96
52.00
67.06
41.55
34.12
68.78
59.16
25.67
Table 11: Results the 8 tasks after pruning 75% of the model LlaMa-3-8B using our method, cosine similarity, or random block pruning, we show the results with and without healing stage.
Method
Healing
Are-C
Arc-E
BoolQ
HS
OBQA
PIQA
WG
MMLU
Accuracy (Ours)
No
26.11
28.66
62.17
27.56
26.80
55.66
50.51
25.46
Yes
25.09
40.91
63.06
30.43
31.00
65.02
51.70
25,83
Cosine Similarity
No
27.30
26.56
57.13
26.05
28.00
51.80
50.12
24.32
Yes
26.19
34.60
63.00
27.48
29.40
61.59
50.83
24.28
Random
No
20.90
20.39
37.99
26.50
22.80
40.97
40.68
24.32
Yes
24.78
38.57
61.11
28.50
28.00
61.10
51.74
25.22
ARC-C
ARC-E
BQ
H5
0.8
0.5
0.6
0.4
0.4
0.4
0.2
2.5
0.0
5.0
epochs
epochs
OBQA
PIQA
WG
MMLU
0.5
0.8
0.8
3.6
0.7
0.7
0.5
0.4
0.6
0.5
0.4
5.0
10.0
Train spachs
Train spochs
spochs
Train epochs
Accuracy (Durs)
Sim llanty
Random
0.25 Pruning
Pruning ratio
Pruning
Figure 21: Impact of healing after pruning across varying pruning ratios and train epochs.
34


Reviews:
[{"review_id": "xhC87lDcWQ", "reviewer": "Reviewer_J9R4", "summary": "This paper investigates whether cosine similarity between a layer's input and output is a reliable proxy for that layer's relevance in large language models. The authors prove a theoretical worst case showing a layer can have arbitrarily low cosine-similarity yet be crucial to performance because small changes it introduces are amplified downstream. They then empirically compare cosine-similarity rankings to a ground-truth relevance obtained by measuring the actual drop in task accuracy after ablating layers. Across multiple models and tasks the correlation is weak to moderate and cosine similarity misranks layers in the vast majority of cases. Motivated by these findings, the paper advocates using an accuracy-based relevance score for mechanistic interpretability and for structured pruning, and shows that pruning guided by this metric outperforms several established baselines in both task-dependent and task-independent settings, albeit at higher computational cost.", "questions": "See above.", "limitations": "", "rating": 6, "confidence": 4, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "The paper addresses an important and timely problem for both interpretability and model compression: how to evaluate which layers actually matter. The theoretical result is clear and convincing in demonstrating the possibility of pathological cases that invalidate cosine-similarity as a universal proxy. The empirical evaluation is broad and carefully presented, spanning multiple model families, many datasets, and both task-dependent and task-independent pruning regimes. The manuscript also provides actionable methodology: a fully defined accuracy-based relevance score, iterative pruning procedures, and cost accounting that clarifies the trade-offs between fidelity and compute. The analyses of variance across tasks, the examples where layer removal improves performance, and the distillation of insights back into pruning recommendations are all valuable for practitioners who want dependable diagnostics instead of relying on a cheap but misleading proxy.", "weaknesses": "While compelling, the work leaves several practical and methodological gaps that, if addressed, would strengthen the contribution. First, the accuracy-based metric is expensive. Please quantify wall-clock runtime and monetary cost for representative experiments and provide more detail on how costs scale with model size, number of layers, and calibration set size. Second, task-independent performance is sensitive to the calibration dataset. Please report more systematic ablations that identify which properties of a calibration set make it effective and whether simple ensemble calibration strategies mitigate sensitivity.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "HZ1caPY1Km", "reviewer": "Reviewer_BfoK", "summary": "This work discusses the issues of layer removal based on cosine similarity and proposes an alternative method which directly measures the impact of layer removal on the downstream performance.", "questions": "- line 15: \"On this work,\" -> \"In this work,\"\n- Line 294 \"a random baseline in the dataset\" is not the clearest way to express that the model is a random predictor. I assume that this is what the authors meant.", "limitations": "", "rating": 4, "confidence": 4, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "- Good motivation. Directly measuring the impact of removing layers on accuracy is ideal.\n- Outperforms prior methods.\n- Relatively simple.", "weaknesses": "- The main issue I have with the method is that it only measures the impact of removing a single layer. In the scenario where multiple layers are removed, the metric does not identify which layers are dependent to one another. The authors state: \"our method prunes blocks iteratively, re-evaluating the model after each step\". This can result in the removal of a layer which on its own does not result in any drastic drop in performance, but the joint removal of this layer and a subsequent cause drastic drop in performance. In contrast, there could be another layer which if removed first causes a greater drop in performance, but other layers not being as dependent on it, further removals might result in a lesser total performance drop. This is not something that is addressed in the paper, even just in discussion.\n- As the authors mentioned themselves \"when the calibration set is restricted to a single benchmark, performance varies significantly\". Hence this method might not be applicable in scenarios where the downstream application is unknown or very general.\n- The computational cost of different methods are reported as equations, but actual numbers in the tables would help.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "SyQMS5KfNP", "reviewer": "Reviewer_a5Py", "summary": "The paper addresses how to assess layer relevance in large language models (LLMs) and challenges the widespread use of cosine similarity between layer inputs and outputs as a proxy for layer importance. Through a theoretical worst-case analysis and broad empirical evidence, the authors show that cosine similarity can fail to capture true layer relevance. They propose an alternative metric based on the actual drop in model accuracy after layer removal and demonstrate its advantages for structured pruning.\nHowever, the practical feasibility of the proposed approach and certain implementation details of the numerical comparisons remain unclear. If these concerns were addressed, the paper would make a meaningful contribution to understanding layer relevance in large models and is likely to stimulate further work in this area.", "questions": "Q1. Could you quantify the computational cost of the proposed accuracy-drop metric relative to cosine similarity and other baselines?\n\nQ2. Have you tested alternative ablation mechanisms? If not, could differences in ablation strategy explain part of the observed performance drops?\n\nQ3. Relatedly, could the apparent weakness of cosine-guided pruning partly arise because cosine ignores magnitude, and your ablation protocol does not re-normalize downstream layers? In that case, the observed degradation might reflect an uncompensated magnitude mismatch rather than a true failure of cosine similarity.", "limitations": "", "rating": 4, "confidence": 3, "soundness": 2, "presentation": 3, "contribution": 2, "strengths": "The paper studies a widely used heuristic (cosine similarity) as a proxy for layer relevance, and demonstrates its unreliability. This would be an important contribution given the prevalence of cosine-based analysis in interpretability work. The paper is clearly written and well organized, making the arguments easy to follow.", "weaknesses": "W1. **Computational practicality**\n\nThe proposed accuracy-drop metric, while conceptually sound, is computationally intensive, as it requires re-evaluating model performance after removing each layer. However, the paper provides no quantitative assessment of this cost relative to cosine similarity or other baselines. Without such analysis, readers are left uncertain whether the approach is feasible for large-scale pruning or limited to research-scale evaluation.\n\nW2. **Effect of layer removal**\n\nIt is unclear whether the observed accuracy drops truly reflect layer relevance or artifacts of the chosen pruning method. The authors note that \"no healing or post-processing was applied.\" This raises the possibility that the measured performance degradation arises partly from architectural disruption rather than intrinsic irrelevance. Since cosine similarity ignores activation magnitude, a pruning operator without residual rescaling can make cosine-guided deletions appear disproportionately harmful. Therefore, the claim that \"cosine-based pruning drops performance more\" may hold only for some pruning methods and might not generalize to pruning frameworks that include rescaling or post-hoc recovery steps.\n\nIf the authors can address the two main concerns, I would be happy to raise my overall score.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "HI5H7Vq4ZP", "reviewer": "Reviewer_5sPj", "summary": "This paper critiques cosine similarity as a metric for layer relevance in transformers and proposes an accuracy-based alternative that directly measures performance degradation from layer removal. The authors provide theoretical proof that cosine similarity can arbitrarily misestimate layer importance and demonstrate their accuracy-based metric achieves better results in structured pruning tasks.", "questions": "see weaknesses", "limitations": "", "rating": 4, "confidence": 3, "soundness": 2, "presentation": 2, "contribution": 3, "strengths": "- The theoretical contribution (Theorem 1) formally proves that layers with arbitrarily low cosine similarity can still be critical for performance, providing rigorous justification for questioning this widely-used metric. The proof construction cleverly exploits the \"snowball effect\" where subtle layer modifications are amplified by downstream layers, offering valuable theoretical insight into transformer dynamics.\n  - The empirical evaluation is thorough, covering multiple models (LLaMA3-8B, Mistral-7B, OLMo) and eight diverse benchmarks, with careful ablations comparing iterative versus one-shot pruning and task-dependent versus task-independent settings. The visualizations effectively illustrate the discrepancies between cosine similarity and actual relevance, particularly the striking example of OLMo's layer 16.", "weaknesses": "- The computational cost of the proposed accuracy-based metric is a major practical limitation that receives insufficient treatment. While Section 6.1 mentions the method requires N × T forward passes compared to T forward passes for cosine similarity (where N is the number of layers), the paper lacks concrete wall-clock time comparisons, memory requirements, or strategies to make the approach tractable for large-scale models. For a 70B parameter model with 80 layers, computing layer-by-layer relevance becomes prohibitively expensive. The brief mention of \"parallel computation\" and future work on cost reduction does not adequately address whether this metric can realistically replace cosine similarity in practice.\n  - The assumption that accuracy on a calibration dataset is the \"ground truth\" for layer relevance may itself be problematic in ways not fully explored. The paper acknowledges strong sensitivity to calibration data choice (Table 6 shows performance varying from 56.34% to 63.18% depending on which task's training set is used), yet does not investigate: (1) whether small calibration sets produce stable relevance estimates, (2) how relevance rankings change with different calibration sizes, (3) whether the metric captures generalizable layer properties or just task-specific overfitting patterns. The task-independent results (Table 5) where cosine similarity outperforms the accuracy metric (59.69% vs 50.23%) raise questions about which metric truly captures layer importance.\n  - The connection between the theoretical worst-case construction (Theorem 1) and practical transformer behavior remains unclear. The proof constructs a contrived 3-layer model that perfectly overfits a dataset, but the paper does not demonstrate that similar pathological patterns actually occur in real trained transformers. Missing are analyses showing: (1) whether real transformer layers exhibit the \"snowball effect\" mechanism from the proof, (2) what proportion of layers in practice have low cosine similarity but high accuracy-based relevance, or (3) quantitative measures of the correlation between the two metrics across different model families and training stages. The empirical sections jump from the theorem to pruning experiments without bridging this gap.\n  - The evaluation methodology has potential confounds that could inflate the apparent superiority of the accuracy-based metric. In the task-dependent setting (Table 1), the calibration data is the training set of the target task, which may give the accuracy metric an unfair advantage since it directly optimizes for performance on data from the same distribution. A more rigorous evaluation would use separate calibration and evaluation splits from each task. Additionally, the paper does not control for the possibility that the accuracy metric simply overfits to the calibration data distribution. The finding that some layers have negative relevance (green in Figure 1A) — meaning accuracy improves upon their removal — suggests the metric may be capturing dataset-specific artifacts rather than fundamental layer importance. I will reconsider my score in the rebuttal.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}]

Author rebuttal:

Decision: Accept (Poster)