Manuscript Offprint

arXiv:2609.02083

XMerge: Cross-Axis Selection and Reconstructive Layer Merging for LLM Depth Compression

Jundong Hu, Shekar Ramachandran

Abstract

Removing complete transformer layers preserves a standard serving architecture, but existing depth-compression methods can lose substantial quality, and the loss varies unpredictably across models. We introduce XMERGE, a post-training method with two components. Cross-axis selection identifies a block with low relative-magnitude and angular hidden-state change, and local boundary reconstruction re-fits the adjacent surviving block to match the original two-block output. XMERGE uses no task labels or end-to-end fine-tuning, and it introduces neither architectural changes nor additional inference-time parameters. Across seven Llama and Qwen backbones (0.5B–8B), five published baselines, and three layer-reduction levels, its advantage over baselines is largest at the most aggressive removal: at k=4k=4 it ranks first on six of seven backbones on CORE (a 22-task aggregate) and, separately, on six of seven on MMLU (five of seven on both at once), while avoiding the large perplexity increases of several competing operators. In a task-level bootstrap, the 95% confidence intervals for the three largest CORE margins exclude zero; the remaining margins are consistent with ties. Across the 14 (model, regime) cells it is also the only evaluated operator that never collapses, ranking top-2 in both zero-shot and in-context regimes; on a first calibration probe (one backbone) it is the best-calibrated operator. Ablations show that local reconstruction provides most of the gain, while cross-axis fusion helps when the two selection axes disagree. The additional construction cost is recovered through per-token decode savings after roughly tens of thousands of requests.

1 Introduction

Motivation. Transformer depth drives inference latency and memory traffic: decode is sequential in layers, so removing whole blocks cuts wall-clock latency and key-value (KV) cache traffic. Unlike unstructured sparsity, which needs sparsity-aware kernels, or width pruning, which changes tensor dimensions Frantar and Alistarh [2023], Sun et al. [2024], Ma et al. [2023], depth compression removes entire layers while leaving hidden size, attention, vocabulary, and the serving interface untouched, so a shallower standard transformer runs on stock infrastructure. But layer dropping can cause disproportionate degradation, and prior methods disagree on which layers to compress and how the removed layer is absorbed: by dropping, averaging, collapsing, or reconstructing.

Depth compression is select-then-merge. Any depth-compression method decomposes into a selector SS (which block to remove) and a structural operator M\mathcal{M} (how an adjacent block absorbs it), C=M∘S\mathcal{C} = \mathcal{M} \circ S. This decomposition separates two failure modes: selecting an important block and failing to preserve the combined mapping of a safe block and its neighbor. We evaluate these two sources of error separately.

*Corresponding author (jundongh@alumni.upenn.edu). Jundong Hu led and carried out the research end to end.

Preprint.

Proposed solution. XMERGE implements both decisions explicitly. Cross-axis selection marks a block as safe to remove only when it is quiet on both a relative-magnitude axis and an angular axis. Reconstructive merging then merges that block with an adjacent neighbor, replacing the pair with one standard transformer block whose existing parameters are optimized to reproduce the pair's original output boundary states. The two components address different sources of degradation: reconstruction preserves the selected pair's local mapping, while cross-axis selection reduces the chance of selecting a harmful location.

References (44)