Uncovering the Redundancy in Transformers via a Unified Study of Layer Dropping

August 21, 2026 ยท View on GitHub

Uncovering the Redundancy in Transformers via a Unified Study of Layer Dropping

TMLR OpenReview arXiv Hugging Face Project Page License Python

Shwai He*, Guoheng Sun*, Zheyu Shen, Ang Li
CASE Lab, University of Maryland, College Park
* Equal contribution

๐ŸŒ Project Page โ€ข ๐Ÿ† News & Awards โ€ข ๐ŸŒŸ Highlights โ€ข ๐Ÿ“ Taxonomy โ€ข ๐Ÿงฐ Model Zoo โ€ข โš™๏ธ Installation โ€ข ๐Ÿš€ Quickstart โ€ข ๐Ÿ“Š Benchmarks โ€ข ๐Ÿ“„ Citation


Note

This is the official repository for the paper Uncovering the Redundancy in Transformers via a Unified Study of Layer Dropping, published in Transactions on Machine Learning Research (TMLR 2026) (Early version: What Matters in Transformers? Not All Attention Is Needed).


๐Ÿ† News & Recognition

  • [Feb 2026] ๐Ÿ“„ Published in Transactions on Machine Learning Research (TMLR 2026)!
  • [May 2025] ๐Ÿ† Won the Qualcomm Innovation Fellowship (QIF) North America 2025 for the proposal "Less Attention, Much Faster: Toward a Future of Efficiency-Optimized Transformer Architectures."
  • [Nov 2024] ๐Ÿš€ Added support for more foundation model families (Gemma-2, DeepSeek, Yi, Baichuan, Solar).
  • [Sep 2024] ๐Ÿค— Released dropped-model checkpoints on Hugging Face.
  • [Jun 2024] ๐Ÿ’ก Released initial arXiv preprint and complete codebase.

๐ŸŒŸ Key Highlights

  • โšก Significant Speedup & Memory Savings: Achieves up to 2.1ร— inference speedup and over 40% KV cache memory reduction without requiring specialized hardware kernels.
  • ๐Ÿงฉ Unified Dropping Taxonomy: Systematically dissects and compares Block Drop, Attention-Layer Drop, MLP-Layer Drop, and Joint Layer Drop under a standardized framework.
  • ๐ŸŽฏ High Performance Retention: Retains >95โ€“98% of core reasoning and general language capabilities (MMLU, GSM8K, ARC-c, HellaSwag) through importance-aware layer selection.
  • ๐Ÿ—œ๏ธ Orthogonal Quantization Synergy: Easily pairs with post-training 4-bit quantization (AWQ / GPTQ) for compounding latency and memory benefits.
  • ๐Ÿ”Œ Plug-and-Play Hugging Face Integration: Output models use standard auto_map configurations for seamless loading via AutoModelForCausalLM.

๐Ÿ“– Overview

Standard Transformer architectures treat every layer and sublayer identically throughout the network depth. However, deep representations exhibit profound asymmetric redundancy:

  1. Attention Redundancy vs. MLP Redundancy: In deeper layers, attention mechanisms often collapse into static routing patterns, whereas MLPs continue to perform knowledge retrieval and feature transformation.
  2. Sublayer Granularity: Dropping full blocks can cause catastrophic representational collapse; in contrast, selectively dropping attention or MLP sublayers provides fine-grained Pareto-optimal compression frontiers.

LLM-Drop Unified Framework
Figure: Overview of LLM-Drop framework showing Block Drop, Sublayer Drop (Attention / MLP), Joint Dropping, and Quantization.


๐Ÿ“ Methodology & Taxonomy

StrategyDropped ComponentsTarget RedundancyMemory / KV Cache SavingLatency SpeedupRecommended Use Case
Block DropFull Transformer Block (MHA + MLP)Inter-block similarity๐ŸŸข High (Weights + KV)๐Ÿš€ HighHigh-throughput batch serving
Attention DropSelf-Attention / MHA LayersRedundant query-key routingโšก 40%+ KV Cacheโšก High (Prefill & Decode)Long-context & memory-bound generation
MLP DropFeed-Forward (FFN/MLP) LayersParameter/computation bloat๐ŸŸข High (Weight footprint)๐Ÿš€ High (Compute-heavy)Compute-bound environments
Joint Layer DropHybrid Attention + MLP scheduleCompound depth redundancy๐Ÿ”ฅ Maximum flexibilityโšก Best Pareto curveCustom hardware budget constraints
Drop + QuantDropped model + 4-bit AWQ/GPTQIntra- & Inter-layer redundancy๐Ÿ’Ž Ultra-compact๐Ÿ”ฅ Maximum efficiencyEdge & on-device deployment

๐Ÿงฐ Model Zoo & Checkpoints

Pre-dropped model checkpoints are available in our Hugging Face Collection:

Model BaseDropping ConfigurationHugging Face CheckpointBase SizeDropped Size
Mistral-7B-v0.1Attention-Drop (4 Attn dropped)LLM-Drop/Mistral-7B-drop-attn47.2B~6.5B
Mistral-7B-v0.1MLP-Drop (4 MLP dropped)LLM-Drop/Mistral-7B-drop-mlp47.2B~5.8B
Mistral-7B-v0.1Block-Drop (4 Blocks dropped)LLM-Drop/Mistral-7B-drop-block47.2B~5.1B
Llama-2-7BJoint-Drop (6 Attn + 2 MLP)LLM-Drop/Llama-2-7B-joint-drop6.7B~5.3B
Llama-3-8BAttention-Drop (4 Attn dropped)LLM-Drop/Llama-3-8B-drop-attn48.0B~7.2B
Gemma-2-9BAttention-Drop (6 Attn dropped)LLM-Drop/Gemma-2-9B-drop-attn69.2B~8.1B
from transformers import AutoModelForCausalLM, AutoTokenizer

# Load directly from Hugging Face with trust_remote_code
model_id = "LLM-Drop/Mistral-7B-drop-attn4"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_id, trust_remote_code=True, device_map="auto")

โš™๏ธ Installation

# 1. Create and activate a clean conda environment
conda create -n llm-drop python=3.10 -y
conda activate llm-drop

# 2. Clone the repository
git clone https://github.com/CASE-Lab-UMD/LLM-Drop.git
cd LLM-Drop

# 3. Install core dependencies and LLM-Drop package
pip install -e .
pip install flash-attn --no-build-isolation

# 4. Optional: Install Quantization dependencies (AutoAWQ & AutoGPTQ)
cd src/llmtuner/compression/quantization/AutoAWQ
pip install -e .
cd AutoAWQ_kernels && pip install -e . && cd ..

cd ../AutoGPTQ
pip install -vvv --no-build-isolation -e .
cd ../../../../..

๐Ÿš€ Quickstart & Usage

1๏ธโƒฃ Model Configuration Setup

To load dropped models with standard Hugging Face AutoModelForCausalLM, add the auto_map and drop lists to config.json:

{
  "drop_mlp_list": [],
  "drop_attn_list": [25, 26, 24, 22],
  "auto_map": {
    "AutoConfig": "configuration_dropped_mistral.MistralConfig",
    "AutoModelForCausalLM": "modeling_dropped_mistral.MistralForCausalLM"
  }
}

Drop list formats:

  • Drop Attention Layers: "drop_mlp_list": [], "drop_attn_list": [25, 26, 24, 22]
  • Drop MLP Layers: "drop_mlp_list": [26, 27, 25, 24], "drop_attn_list": []
  • Drop Full Blocks: "drop_mlp_list": [26, 25, 24, 27], "drop_attn_list": [26, 25, 24, 27]

2๏ธโƒฃ Run Dropping Pipelines

# Block Dropping
bash scripts/dropping/block_drop.sh

# Sublayer Dropping (Attention or MLP)
bash scripts/dropping/layer_drop.sh

# Joint Layer Dropping
bash scripts/dropping/layer_drop_joint.sh

# Iterative Dropping
bash scripts/dropping/layer_drop_iterative.sh

3๏ธโƒฃ Benchmark Task Performance

Evaluate dropped checkpoints on standard NLP and reasoning benchmarks with EleutherAI/lm-evaluation-harness:

bash scripts/benchmark/benchmark_lm_eval.sh

4๏ธโƒฃ Measure Speed & KV Cache Savings

bash scripts/benchmark/benchmark_speed.sh

5๏ธโƒฃ Post-Training Quantization (AWQ / GPTQ)

# 4-bit AWQ Quantization on Dropped Model
bash scripts/quantization/awq.sh

# 4-bit GPTQ Quantization on Dropped Model
bash scripts/quantization/gptq.sh

๐Ÿ“Š Benchmark Results

Mistral-7B-v0.1 Dropping Performance

Model VariantStrategy# DroppedMMLU (5-shot)GSM8K (8-shot)ARC-c (25-shot)HellaSwag (10-shot)Relative SpeedupKV Cache Saving
Dense Baseโ€”064.2%37.8%60.1%83.3%1.00ร—0%
LLM-Drop (Attn)Attention Drop463.8%37.1%59.6%82.9%1.22ร—-12.5%
LLM-Drop (Attn)Attention Drop862.5%35.4%58.2%81.7%1.45ร—-25.0%
LLM-Drop (MLP)MLP Drop463.1%36.2%58.9%82.4%1.28ร—0%
LLM-Drop (Block)Block Drop462.7%35.0%58.4%81.9%1.32ร—-12.5%
LLM-Drop + AWQ-4bAttn Drop + AWQ4 Attn63.2%36.5%59.0%82.1%2.14ร—-12.5%

๐Ÿ“ฆ Repository Layout

LLM-Drop/
โ”œโ”€โ”€ docs/                   # GitHub Pages project website
โ”‚   โ”œโ”€โ”€ index.html          # Interactive project homepage
โ”‚   โ””โ”€โ”€ static/images/      # Figures and SVG assets
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ dropping/           # Block, layer, joint & iterative dropping scripts
โ”‚   โ”œโ”€โ”€ benchmark/          # LM-Eval & inference speed benchmarks
โ”‚   โ””โ”€โ”€ quantization/       # AWQ and GPTQ quantization scripts
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ compress.py         # Main entry point for importance estimation & dropping
โ”‚   โ”œโ”€โ”€ benchmark_speed.py  # Inference latency & throughput measurement
โ”‚   โ””โ”€โ”€ llmtuner/           # Core model definitions, dropping modules & pruning
โ”œโ”€โ”€ Layer_Drop.svg          # Architectural overview diagram
โ”œโ”€โ”€ setup.py                # Package setup script
โ””โ”€โ”€ requirements.txt        # Base dependencies

๐Ÿ“„ Citation

If you find this work, repository, or released checkpoints helpful in your research, please cite our papers:

@article{he2026uncovering,
  title={Uncovering the Redundancy in Transformers via a Unified Study of Layer Dropping},
  author={He, Shwai and Sun, Guoheng and Shen, Zheyu and Li, Ang},
  journal={Transactions on Machine Learning Research},
  issn={2835-8856},
  year={2026},
  url={https://openreview.net/forum?id=1I7PCbOPfe}
}

@article{he2024what,
  title={What Matters in Transformers? Not All Attention Is Needed},
  author={He, Shwai and Sun, Guoheng and Shen, Zheyu and Li, Ang},
  journal={arXiv preprint arXiv:2406.15786},
  year={2024}
}

๐Ÿ“ฌ Contact & Support

For questions, collaborations, or issues: