arXiv(opens in a new tab)cs.CVAug 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2608.25068

SHIFT-LLM: Distribution Shift Correction in Depth-Pruned LLMs

Ali Bahri, Hang Li, Hongliang Li, Zhitang Chen

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

Abstract

Depth pruning removes entire Transformer blocks to reduce the inference cost of large language models, but disrupts the hidden-state distributions expected by downstream layers, leading to significant accuracy loss. We introduce SHIFT-LLM, a training-free post-pruning correction framework that inserts a Linear Residual Adapter (LRA) at each pruning site. Each LRA preserves the identity pathway of the original residual block and adds a lightweight affine residual correction. This correction is calibrated via closed-form least-squares regression on a small held-out set, without gradient computation, to approximate the missing residual update produced by the pruned block. Together with the preserved identity pathway, the resulting LRA output approximates the hidden state produced by the original block, thereby mitigating the distributional mismatch introduced by layer removal while avoiding the expensive attention and feed-forward computations of the removed blocks. The resulting LRAs support low-rank factorization and exact merging across consecutive pruned layers for additional compression, and combine naturally with parameter-efficient fine-tuning for further recovery beyond fine-tuning the pruned model alone. Experiments on five model families, six layer-selection criteria, and seven zero-shot benchmarks show that SHIFT-LLM consistently recovers accuracy lost to depth pruning across most configurations, achieving gains up to +15.7 points on Llama-3.1-8B-Instruct while requiring only a few hundred calibration samples and no gradient computation.

1 Introduction

Transformer-based Large Language Models (LLMs) [27] have achieved remarkable success across many applications, but their growing scale imposes substantial computational costs that hinder practical deployment in resource-constrained settings. To address this challenge, model compression methods such as quantization [9, 14, 28], knowledge distillation [11, 29], and pruning [25, 1] have been widely studied. Among them, structured pruning is especially attractive because it removes entire components, such as neurons or layers, enabling more direct hardware efficiency and inference speedup.

Pruning improves model efficiency by removing parameters or structural components while preserving performance as much as possible. Structured pruning [4, 17, 3, 15] removes entire neurons or layers rather than sparsifying individual weights [19, 25], enabling more direct practical speedups and hardware efficiency. Recent studies further show that depth pruning can provide reliable small-batch latency gains while remaining competitive with structured width pruning [13, 20].

However, despite their practical appeal, existing depth pruning methods often suffer from significant performance degradation and require extensive fine-tuning to recover performance. In this work, we identify post-pruning distribution shift as a key underlying cause of this degradation.

Preprint.

Specifically, removing an intermediate Transformer block eliminates the residual update that contributes to its output hidden state, causing downstream layers to receive hidden states that differ from those produced by the original pretrained model and therefore follow a shifted distribution. This shift can propagate through subsequent layers and lead to substantial performance degradation. Therefore, the challenge of depth pruning is not only to determine which blocks are removable, but also to mitigate the distribution shift induced by their removal.

This perspective also helps explain why post-pruning fine-tuning is effective. By adapting the remaining parameters to the shifted hidden-state distributions, fine-tuning can provide strong recovery, but requires additional optimization, compute, and training time. This motivates a lightweight alternative for settings where such post-pruning

Figure

Figure 1: The proposed LRA partially restores the hidden-state distribution toward that of the original model.

training is undesirable: directly approximating the missing residual update without gradient-based optimization. Moreover, when fine-tuning is available, this explicit correction can be used jointly with it to provide complementary recovery.

Motivated by this observation, we introduce SHIFT-LLM, a training-free post-pruning correction framework for depth-pruned LLMs. Its core component is the Linear Residual Adapter (LRA), which preserves the identity pathway of the original residual block and adds a lightweight affine residual correction. This correction is calibrated via closed-form least-squares regression on a small held-out set, without gradient computation, to approximate the missing residual update. Together with the preserved identity pathway, the LRA output approximates the hidden state produced by the original block, thereby mitigating the post-pruning distribution shift while avoiding its expensive attention and feed-forward computations.

This formulation relies on two key design principles. First, existing layer-selection methods are designed to prune redundant or less critical layers, making their missing residual updates more amenable to low-complexity approximation and allowing a lightweight affine correction to capture their dominant effect. Second, the LRA preserves the residual structure of the original Transformer block by retaining the identity pathway and approximating only the missing residual update. This makes the approximation problem easier than directly reconstructing the full output hidden state, since the affine residual correction only needs to approximate the missing residual update. Moreover, retaining the identity pathway preserves the residual computation structure on which the original model was pretrained, allowing the corrected hidden state to better match the output of the original block. Figure 1 supports this view: the pruned model exhibits a clear shift in hidden-state space, whereas the proposed LRA moves the hidden states substantially closer to the original distribution. For additional efficiency, the resulting LRAs can be compressed via low-rank factorization and merged across consecutive pruning sites. Overall, these results suggest that approximating the missing residual updates while preserving the residual structure provides a simple, general, and effective complement to depth pruning. Our contributions are summarized as follows:

• We introduce SHIFT-LLM, a training-free framework that explicitly corrects the distribution shift caused by structured depth pruning in LLMs. Its core Linear Residual Adapter (LRA) preserves the identity pathway of the original residual block, while its affine residual correction approximates the missing residual update introduced by layer removal.

• SHIFT-LLM is a general and modular post-pruning correction framework that can be applied across a wide range of existing layer-selection strategies for depth pruning, without being tied to any specific pruning criterion.

• We conduct extensive experiments showing that SHIFT-LLM provides strong training-free recovery across diverse LLMs, pruning strategies, and evaluation settings, while remaining complementary to post-pruning fine-tuning and further improving its performance in most evaluated settings.

References (32)