Beyond Adjacent Layers: Graph-Guided Layer Fusion for Compressing Large Language Models
Organizations: Braindeck Inc Seoul, Republic of Korea
Abstract
Existing depth-compression methods for large language models (LLMs) score layers individually or group only adjacent or contiguous layers, implicitly assuming that functional redundancy is local. We test this assumption by computing full pairwise Centered Kernel Alignment (CKA) similarity matrices for thirteen LLMs from six architecture families (1.6B-14B parameters). Non-adjacent layers have 3.6-15.9x more high-similarity pairs than adjacent ones, a structure that prior similarity-based layer merging has not systematically exploited. We propose Fusion via Community Mining (FCM), which builds the full L x L similarity graph, uses spectral community detection to find clusters of functionally equivalent layers, keeps the highest-Block-Influence layer in each cluster, and applies LoRA recovery; a pre-specified rule computed only on calibration data chooses between cosine and CKA similarity. At 2x compression, FCM lowers mean perplexity below ShortGPT on twelve of thirteen models, significantly on ten (Welch's t-test with Holm-Bonferroni correction; up to 50% on Qwen3-4B), with Mistral-7B the only loss (+13.4%). Against FlattenGPT, SWM, and DeltaLLM under matched calibration and recovery, FCM gives the best perplexity on ten of thirteen models (mean rank 1.15), and it also outperforms MKA on three anchor models. FCM matches or exceeds ShortGPT on 15 of 20 zero-shot reasoning cells and also improves MMLU, LAMBADA, HumanEval pass@1, and free-form generation quality. The 2x-compressed Qwen2.5-7B has 46% fewer parameters, 42% lower peak VRAM, and 84% higher decode throughput on a single A100. Spectral grouping outperforms Fisher contiguous segmentation by 41% and uniform partitioning by 51%, and FCM's advantage grows beyond a 2x crossover up to 3x and persists at the 14B scale. Code: https://github.com/Usama1002/fcm-layer-fusion
Figures & tables
| Method | Similarity signal | Grouping | Non-adjacent? |
|---|---|---|---|
| ShortGPT ( Men et al., 2025 ) | Per-layer BI | None (individual) | N/A |
| Gromov et al. ( Gromov et al., 2025 ) | Per-layer BI | Contiguous block | No |
| LLM-Streamline ( Chen et al., 2025 ) | Per-layer importance | Contiguous block | No |
| FlattenGPT ( Xu et al., 2026 ) | None (adjacent pairs) | Adjacent pairs | No |
| SWM ( Ding et al., 2026 ) | RKHS correlation | Sliding window | No |
| GRASP ( Liu et al., 2025 ) | Gradient attribution | None (individual) | N/A |
| Model | Family | Base | ShortGPT | FCM (ours) | |
| FCM significant wins (10/13): | |||||
| Qwen3-4B † | Qwen3 | 13.17 | 116.20 8.12 | 58.15 9.45 ∗∗ | 50.0% |
| Qwen2.5-7B † | Qwen2 | 6.67 | 44.92 2.85 | 26.65 0.94 ∗∗ | 40.7% |
| Qwen3-1.7B † | Qwen3 | 11.82 | 74.20 3.10 | 46.45 1.80 ∗ | 37.4% |
| StableLM-2-1.6B | StableLM | 12.45 | 52.60 2.40 | 33.24 1.10 ∗ | 36.8% |
| Qwen3-8B † | Qwen3 | 6.12 | 39.80 1.90 | 28.45 1.10 ∗ | 28.5% |
| Model | ShortGPT | FlattenGPT | SWM | DeltaLLM | FCM (ours) | |
| StableLM-2-1.6B | 52.60 2.40 | 48.90 2.10 | 51.20 2.80 | 44.10 1.80 | 33.24 1.10 ∗ | 24.6% |
| Qwen3-1.7B | 74.20 3.10 | 64.50 2.90 | 71.10 3.80 | 58.60 2.40 | 46.45 1.80 ∗ | 20.7% |
| Gemma-2-2B | 68.40 2.90 | 63.10 2.40 | 66.80 3.10 | 61.20 2.10 | 54.58 1.65 ∗ | 10.8% |
| Qwen2.5-3B | 48.50 2.10 | 44.20 1.90 | 46.80 2.30 | 42.10 1.65 | 35.40 1.20 ∗ | 15.9% |
| LLaMA-3.2-3B | 55.36 2.12 | 58.20 2.30 | 61.10 3.40 | 54.80 1.95 | 52.60 1.85 † | 4.0% |
| SmolLM3-3B | 41.80 1.65 | 43.20 1.80 | 46.10 2.10 | 40.50 1.40 | 39.85 1.30 † | 1.6% |
| Model | Ratio | ShortGPT | FlattenGPT | DeltaLLM | FCM (ours) | SGPT ZS | FCM ZS |
|---|---|---|---|---|---|---|---|
| Qwen2.5-7B | 12.28 0.35 | 12.95 0.40 | 11.85 0.28 | 12.45 0.32 | 58.4 | 58.1 | |
| 44.92 2.85 | 38.15 1.42 | 35.60 1.05 | 26.65 0.94 | 49.3 | 55.5 | ||
| 148.50 9.20 | 112.40 6.80 | 98.60 5.10 | 64.20 3.85 | 28.5 | 38.2 | ||
| 412.80 28.5 | 315.60 21.0 | 268.40 18.2 | 142.50 11.4 | 21.2 | 29.8 | ||
| LLaMA-3.1-8B | 11.45 0.28 | 12.10 0.35 | 11.60 0.30 | 11.82 0.31 | 62.1 | 61.8 | |
| 42.75 1.70 | 40.12 0.95 | 38.25 0.82 | 35.25 1.15 | 52.2 | 54.9 |
| Model | Method | ARC-E | ARC-C | HellaSwag | WinoGrande | PIQA | Avg |
|---|---|---|---|---|---|---|---|
| Qwen2.5-7B | Uncompressed | 79.8 | 54.2 | 78.1 | 72.4 | 80.2 | 72.94 |
| ShortGPT | 54.2 | 32.1 | 46.8 | 52.4 | 61.2 | 49.34 | |
| FCM (ours) | 61.8 | 38.4 | 54.2 | 56.8 | 66.5 | 55.54 | |
| LLaMA-3.1-8B | Uncompressed | 81.2 | 56.4 | 79.4 | 74.1 | 81.8 | 74.58 |
| ShortGPT | 56.4 | 35.2 | 50.1 | 55.8 | 63.4 | 52.18 | |
| FCM (ours) | 59.2 | 37.8 | 53.6 | 58.2 | 65.8 | 54.92 |
Appendix figures & tables19 assets
Supplementary material from the paper’s appendix.
Appendix
| Method | Profiling metric | PPL | vs. ShortGPT |
|---|---|---|---|
| ShortGPT | Block Influence | 28.36 0.54 | – |
| FCM (mean-pooled) | Cosine of mean activations | 32.16 1.20 | |
| FCM (full-token) | Full-token CKA | 29.86 1.87 |
| Model | Family | Layers | Scale |
|---|---|---|---|
| Qwen2.5-14B, Qwen2.5-7B, Qwen2.5-3B ( Qwen et al., 2024 ) | Qwen2 | 48, 28, 36 | 14B, 7B, 3B |
| Qwen3-14B, Qwen3-8B, Qwen3-4B, Qwen3-1.7B ( Yang et al., 2025 ) | Qwen3 | 40, 36, 36, 28 | 14B, 8B, 4B, 1.7B |
| Mistral-7B-v0.3 ( Jiang et al., 2023 ) | Mistral | 32 | 7B |
| LLaMA-3.1-8B ( Grattafiori et al., 2024 ) , LLaMA-3.2-3B ( Meta AI, 2024 ) | LLaMA | 32, 28 | 8B, 3B |
| SmolLM3-3B ( Bakouch et al., 2025 ) | SmolLM | 36 | 3B |
| Gemma-2-2B ( Gemma Team et al., 2024 ) | Gemma | 26 | 2B |
| Method | Sim. Metric | Grouping / Merge | PPL (raw) | PPL (+LoRA) |
| Baseline (no compression) | – | – | 6.67 | – |
| FCM grouping/merge variants (centrality-based selection): | ||||
| FCM | Cosine | Spectral / Select | 288 | 35.01 |
| FCM | CKA | Spectral / Select | 1,481 | 48.92 |
| FCM | Cosine | Spectral / Average | 2,784 | 57.23 |
| FCM | CKA | Fisher / Select | 2,710 | 82.93 |
| PPL (raw) | PPL (+LoRA) | |
|---|---|---|
| 64 | 282.11 | 39.65 |
| 128 | 282.11 | 40.66 |
| 256 | 282.11 | 39.59 |
| 512 | 287.88 | 38.97 |
| 1024 | 282.11 | 39.54 |
| Model | (%) | Hedges’ | Verdict | ||
|---|---|---|---|---|---|
| Qwen3-4B | 5 | 0.0004 | 5.92 | ∗∗ | |
| Qwen2.5-7B | 5 | 0.0008 | 4.85 | ∗∗ | |
| Qwen3-1.7B | 5 | 0.0012 | 3.68 | ∗ | |
| StableLM-2-1.6B | 3 | 0.0015 | 3.55 | ∗ | |
| Qwen2.5-14B | 3 | 0.0084 | 2.61 | ∗ | |
| Qwen3-14B | 3 | 0.0092 | 2.54 | ∗ |
| Anchor | Baseline | df | Verdict | |||
|---|---|---|---|---|---|---|
| Qwen2.5-7B | ShortGPT | 10.54 | 2.43 | 0.00436 | 0.03001 | ∗ |
| Qwen2.5-7B | FlattenGPT | 11.70 | 3.47 | 0.00066 | 0.00721 | ∗ |
| Qwen2.5-7B | SWM | 10.74 | 2.74 | 0.00257 | 0.02568 | ∗ |
| Qwen2.5-7B | DeltaLLM | 11.00 | 3.95 | 0.00041 | 0.00497 | ∗ |
| LLaMA-3.1-8B | ShortGPT | 6.33 | 3.51 | 0.00489 | 0.03001 | ∗ |
| LLaMA-3.1-8B | FlattenGPT | 5.65 | 3.86 | 0.00535 | 0.03001 | ∗ |
| Configuration | Parameters | Peak VRAM | Prefill | Decode |
| (seq=2048) | (seq=512, tok/s) | (tok/s) | ||
| Uncompressed ( ) | 7.61 B | 16.2 GiB | 1,540 | 68 |
| ShortGPT ( ) | 4.12 B | 9.3 GiB | 2,880 | 125 |
| FCM (ours, ) | 4.12 B | 9.3 GiB | 2,880 | 125 |
| vs. uncompressed (FCM/ShortGPT) |
| Model | Method | MMLU (5-shot) | LAMBADA Acc | LAMBADA PPL | HumanEval@1 |
|---|---|---|---|---|---|
| Qwen2.5-7B | Uncompressed | 71.4 | 74.2 | 3.42 | 48.2 |
| ShortGPT | 44.2 | 48.5 | 18.42 | 18.5 | |
| DeltaLLM | 48.6 | 52.1 | 14.15 | 22.4 | |
| FCM (ours) | 54.8 ∗ | 59.4 ∗ | 8.65 ∗ | 29.8 ∗ | |
| LLaMA-3.1-8B | Uncompressed | 68.5 | 72.8 | 3.65 | 34.1 |
| ShortGPT | 46.1 | 50.2 | 16.85 | 14.2 |
| Method | Distinct-2 | Distinct-3 | Self-BLEU | MAUVE | Degen. failure |
|---|---|---|---|---|---|
| Uncompressed | 0.684 | 0.852 | 0.185 | 0.982 | 0.0% |
| ShortGPT | 0.412 | 0.564 | 0.485 | 0.615 | 24.0% |
| DeltaLLM | 0.485 | 0.642 | 0.382 | 0.742 | 11.0% |
| FCM (ours) | 0.612 | 0.785 | 0.245 | 0.894 | 2.0% |
| Model | Cosine | Metric | ||||||
|---|---|---|---|---|---|---|---|---|
| StableLM-2-1.6B | 24 | 12 | 0.892 | 0.208 | 0.865 | 0.250 | Normal | Cosine |
| Qwen3-1.7B | 28 | 14 | 0.584 | 0.536 | 0.881 | 0.286 | Degen. | CKA |
| Gemma-2-2B | 26 | 13 | 0.612 | 0.462 | 0.874 | 0.269 | Degen. | CKA |
| Qwen2.5-3B | 36 | 18 | 0.915 | 0.194 | 0.852 | 0.222 | Normal | Cosine |
| LLaMA-3.2-3B | 28 | 14 | 0.884 | 0.214 | 0.831 | 0.286 | Normal | Cosine |
| SmolLM3-3B | 36 | 18 | 0.542 | 0.583 | 0.849 | 0.250 | Degen. | CKA |
| Model | Stage | ShortGPT | FlattenGPT | SWM | DeltaLLM | FCM (ours) |
|---|---|---|---|---|---|---|
| Qwen2.5-7B | Raw | 176,657 | 91,493 | 886 | 19,519 | 2,280 |
| +LoRA | 44.92 | 38.15 | 41.20 | 35.60 | 26.65 | |
| LLaMA-3.1-8B | Raw | 142,311 | 68,412 | 1,241 | 12,840 | 1,845 |
| +LoRA | 42.75 | 40.12 | 44.55 | 38.25 | 35.25 | |
| Qwen2.5-14B | Raw | 84,120 | 42,181 | 612 | 8,940 | 413 |
| +LoRA | 32.45 | 29.80 | 31.40 | 27.95 | 24.18 |
| Model | MKA raw | MKA +LoRA | FCM raw | FCM +LoRA | (PPL) |
|---|---|---|---|---|---|
| Qwen2.5-7B | 14,210 | 34.80 1.15 | 2,280 | 26.65 0.94 ∗ | |
| LLaMA-3.1-8B | 11,840 | 39.40 1.22 | 1,845 | 35.25 1.15 ∗ | |
| Qwen2.5-14B | 6,411 | 28.50 0.92 | 413 | 24.18 0.82 ∗ |
| Model | Calibration | ARI | Jaccard | Flips | PPL |
|---|---|---|---|---|---|
| Qwen2.5-7B | C4 (default) | 1.000 | 1.000 | 0 | 26.65 0.94 |
| WikiText-2 | 0.924 | 0.928 | 1 | 26.72 0.98 | |
| StarCoder (code) | 0.885 | 0.857 | 2 | 26.89 1.05 | |
| arXiv (math) | 0.892 | 0.857 | 2 | 26.81 1.01 | |
| LLaMA-3.1-8B | C4 (default) | 1.000 | 1.000 | 0 | 35.25 1.15 |
| WikiText-2 | 0.941 | 0.938 | 1 | 35.31 1.18 |
| Model | Length | ARI | Jaccard | PPL |
|---|---|---|---|---|
| Qwen2.5-7B | 64 | 0.942 | 0.928 | 26.78 0.96 |
| 128 (default) | 1.000 | 1.000 | 26.65 0.94 | |
| 256 | 0.968 | 0.928 | 26.68 0.95 | |
| 512 | 0.968 | 0.928 | 26.64 0.93 | |
| LLaMA-3.1-8B | 64 | 0.928 | 0.938 | 35.42 1.20 |
| 128 (default) | 1.000 | 1.000 | 35.25 1.15 |
| Community | Layers | Logit-lens | Attn. ent. | LOO PPL | Phase | Rep. |
|---|---|---|---|---|---|---|
| (bookend) | 0,1,2,25,26,27 | 0.02–0.78 | 1.42 | Embed/output | 27 | |
| 3,4,5,6 | 0.12–0.18 | 3.85 | Early processing | 3 | ||
| 7–12 | 0.21–0.24 | 4.12 | Identity drift | 9 | ||
| 13–17 | 0.26–0.31 | 4.08 | Identity drift | 13 | ||
| 18,19,20,21 | 0.35–0.52 | 3.15 | Semantic formation | 21 | ||
| 22,23,24 | 0.58–0.69 | 2.10 | Output preparation | 24 |
| Model | Attention | Top-5% var. | Max outlier | Gini | Mean-pool / Full-token PPL |
|---|---|---|---|---|---|
| Qwen2.5-7B | Dense | 14.2% | 42.5 | 0.185 | 26.65 / 36.83 |
| LLaMA-3.1-8B | Dense | 15.8% | 48.1 | 0.201 | 35.25 / 41.20 |
| Mistral-7B | Sliding-window | 68.4% | 412.8 | 0.742 | 32.16 / 29.86 |
| Model | Stage | Wallclock (s) | Peak VRAM (GB) |
| Qwen3-1.7B | Profiling ( ) | 4.2 | 4.2 |
| Similarity (cos/CKA) | 0.2 | 0.1 | |
| Clustering + selection | |||
| LoRA recovery (500 steps) | 412.0 | 14.8 | |
| Total (FCM overhead ) | 416.4 | 14.8 | |
| Qwen2.5-7B | Profiling ( ) | 11.5 | 12.4 |
LLM Compression
Large language model compression reduces the memory, compute, and context costs of LLMs while aiming to preserve their capabilities.
See all 283 papers