DepthGraft: Structural Regularization through Hierarchical Cross-Layer KV Reconstruction

Xiaohan Qin, Xiangdong Zhang, Yu Wang, Huaijin Wu, Zhuo Xia, Yebin Yang, Junchi YanarXiv 2026 · arXiv

TL;DR

DepthGraft reimagines cross-layer Key-Value (KV) sharing not just as a trick for saving memory, but as a powerful structural regularizer for training. By reconstructing deep-layer KV pairs from a hierarchical mix of shallow and middle layers, it reduces KV cache by one-third while simultaneously boosting performance—achieving a massive 7.0% absolute gain on MMLU-Pro for a 16B Mixture-of-Experts (MoE) model.

What Problem Does This Paper Address?

As Large Language Models (LLMs) get deeper, they often suffer from depth-wise information dilution. In standard architectures, information from early layers must pass through a long chain of residual blocks to reach the end. By the time it gets to the deepest layers, the signal can become "blurry," making it difficult for the model to effectively utilize its full depth.

While researchers have tried adding direct "shortcuts" between distant layers, these usually come with a heavy tax: more computation, more memory access, or complex system engineering. Previous attempts at "KV sharing" (where multiple layers reuse the same Key and Value tensors) were designed primarily to save memory during inference, often at the cost of a slight dip in model quality. DepthGraft flips this script, asking: Can we design a sharing topology that actually makes the model smarter?

Methods

The authors propose a hierarchical architecture called DepthGraft. Instead of every layer having its own unique KV projections, the network is partitioned into three stages: Shallow, Middle, and Deep.

  1. Shallow & Middle Stages: These layers compute their KV tensors normally.
  2. Deep Stage: These layers do not have their own KV projections. Instead, they reconstruct their KV tensors using a stride-aligned pair from the earlier stages. Specifically, a deep layer $\ell$ combines one source from the shallow stage and one from the middle stage using learnable, channel-wise coefficients.
The DepthGraft workflow showing how deep layers reconstruct KV from shallow and middle sources, creating a direct gradient path back to early layers.

This "stride-aligned" approach ensures that the gradient flow is distributed evenly across the early layers rather than congesting a few "global anchors." It also allows the deep layers to draw from two different levels of abstraction: the lexical/local patterns of shallow layers and the semantic/abstract states of middle layers.

Datasets

The models were trained from scratch and evaluated on a comprehensive suite of downstream benchmarks:

  • Knowledge & Understanding: MMLU, MMLU-Pro, LAMBADA, C-Eval, CMMLU.
  • Reasoning & Math: ARC-Challenge, SIQA, GSM8K.
  • Code Generation: HumanEval, MBPP, LCBench.
  • Long Context: RULER (needle-in-a-haystack, variable tracking, etc.).

The experiments covered both dense models (0.5B to 1.5B) and MoE models (3B to 16B).

Key Insights and Ideas

  • KV Sharing as Regularization: The "aha moment" is that every KV reuse edge is a direct highway for gradients. When a deep layer reuses a shallow layer's KV, the shallow layer receives training signals directly from the deep layer's task demands.
  • Asymmetric Geometry: This cross-layer gradient flow reshapes the "geometry" of the representations. It forces Keys to become more compact and discriminative (sharpening retrieval) while pushing Values to cover a richer, more diverse content subspace.
Evolution of KV representation geometry. DepthGraft leads to a lower effective rank for Keys (more compact) and a higher effective rank for Values (richer content) compared to the baseline.
  • Topology Matters: The authors show why previous methods were sub-optimal. Adjacent sharing (sharing with the next layer) provides too little diversity in signals. Global-anchor sharing (everyone sharing one or two specific layers) creates "gradient congestion," overloading a few layers with too many conflicting objectives. DepthGraft’s distributed, hierarchical approach strikes the perfect balance.
Comparison of gradient distribution. Global-anchor methods (YOCO, FusedKV) concentrate gradient mass on a few layers, whereas DepthGraft distributes it healthily across the source stages.

Key Results

  • Performance Boost: On the 16B MoE model, DepthGraft achieved a 7.0% absolute improvement on MMLU-Pro, 6.6% on CMMLU, and 6.4% on C3 compared to a standard Grouped-Query Attention (GQA) baseline.
  • Efficiency Gains: It reduces the KV cache size by approximately one-third. Because the deep layers don't need to wait for their own KV to be computed, "prefill" (the time it takes to process the initial prompt) is significantly faster—reducing Time-to-First-Token (TTFT) by up to 28.8% at 128K context.
  • Scaling: The advantages were consistent across all model sizes, from tiny 0.5B models to 16B MoE architectures.
Results on the 16B MoE model showing consistent training advantages and significant reductions in TTFT and KV cache usage.

Limitations and Future Work

  • Kernel Optimization: While the theoretical speedups are clear, the authors note that reaching the full potential of decoding speed requires specialized CUDA kernels to handle the reconstruction step efficiently.
  • Theoretical Depth: While the paper provides a spectral analysis of the regularization effect, a more rigorous mathematical framework for how different sharing topologies affect the "effective depth" of Transformers remains an open area for research.
  • Data Privacy: The pretraining corpus used was proprietary, which makes exact replication of the training dynamics difficult for the broader community, though the architectural code is public.

Summary updated

Abstract

Scaling depth is a key route to stronger large language models, but Pre-LN architectures often suffer from depth-wise information dilution, limiting the effective use of deep layers. While cross-layer connectivity has proven effective at mitigating this problem, existing designs usually introduce additional computation or memory access. We revisit cross-layer KV sharing as an efficient form of such connectivity. Beyond cache compression, each KV reuse edge creates a direct gradient path from deep layers to source KV projections, turning KV sharing into an implicit structural regularizer for KV representation geometry. We provide a systematic analysis of this mechanism, showing that proper sharing topologies sharpen key retrieval directions while enriching the value content subspace, whereas existing adjacent or global-anchor designs do not fully exploit this effect. Motivated by this, we propose DepthGraft, a hierarchical KV-sharing architecture that reconstructs deep-layer KV from stride-aligned shallow-middle source pairs. DepthGraft distributes non-local gradient flow across source layers, while preserving prefill early completion and reducing KV cache by roughly one third. Experiments on dense and MoE models from 0.5B to 16B parameters show consistent downstream improvements under both GQA and MLA. Notably, on the 16B MoE model, DepthGraft achieves a 7.0% absolute improvement on MMLU-Pro, along with gains of 6.6% on CMMLU and 6.4% on C3. These results validate the potential of DepthGraft as a scalable design for large-scale pretraining. The project page is available at https://github.com/jianke0604/DepthGraft.
BibTeX
@misc{qin2026depthgraft,
  author = {Xiaohan Qin and Xiangdong Zhang and Yu Wang and Huaijin Wu and Zhuo Xia and Yebin Yang and Junchi Yan},
  title = {{DepthGraft: Structural Regularization through Hierarchical Cross-Layer KV Reconstruction}},
  year = {2026},
  eprint = {2611.03142},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.03142},
}
Figure