Skip to content
OpenTrain AIFor AI Companies

ReplaceMe: Network Simplification via Depth Pruning and Transformer Block Linearization

Dmitriy Shopkhoev, Ammar Ali, Magauiya Zhussip, Valentin Malykh, Stamatios Lefkimmiatis +2 morePublished May 5, 2025
arXiv PDF
Researcher verdict
Starting point
Use as implementation starting point
Benchmark evidence
Thin evidence
Verify before relying
Time to first repro
A few days
Plan setup time
Risk flags
3
Review before use

Abstract

Domain fit: AI-core · Core AI workload signals detected from paper context and implementation/artifact evidence.

We introduce ReplaceMe, a generalized training-free depth pruning method that effectively replaces transformer blocks with a linear operation, while maintaining high performance for low compression ratios. In contrast to conventional pruning approaches that require additional training or fine-tuning, our approach requires only a small calibration dataset that is used to estimate a linear transformation, which approximates the pruned blocks. The estimated linear mapping can be seamlessly merged with the remaining transformer blocks, eliminating the need for any additional network parameters. Our experiments show that ReplaceMe consistently outperforms other training-free approaches and remains highly competitive with state-of-the-art pruning methods that involve extensive retraining/fine-tuning and architectural modifications. Applied to several large language models (LLMs), ReplaceMe achieves up to 25\% pruning while retaining approximately 90\% of the original model's performance on open benchmarks - without any training or healing steps, resulting in minimal computational overhead. We provide an open-source library implementing ReplaceMe alongside several state-of-the-art depth pruning techniques, available at https://github.com/mts-ai/ReplaceMe

Results and benchmarks

Freshness tier: cold
We introduce ReplaceMe, a generalized training-free depth pruning method that effectively replaces transformer blocks with a linear operation, while maintaining high performance for low compression ratios.
Task Dataset Metric Value Source
Transformer Llama3 8B instruct Sciq Accuracy. 0.93 paper-derived
Transformer UIDL Sciq Accuracy. 0.687 paper-derived
Transformer Ours (LSTSQ) Sciq Accuracy. 0.89 paper-derived

Audit each benchmark finding before selecting an implementation path. Evidence refs map to the disclosure below.

Implementation

Best maintained implementation now

Recommended
Confidence: High
Reproducibility: Limited

mts-ai/ReplaceMe

43 stars · 7 forks · Last push May 27, 2025

  • License
  • CI
  • Dependencies
  • Docker

Official implementation from Papers with Code · Repository link is mentioned in the paper metadata · Community adoption signal (43 stars)

Why this implementation
Confidence: high

mts-ai/replaceme is the strongest maintained implementation based on ranking signals.

Open mts-ai/replaceme
Reproduction risks
  • License metadata missing
  • No CI workflows detected
  • Dependency manifest is missing
  • Selected mts-ai/replaceme as the strongest maintained implementation for new work.
  • Repository activity is within the last 24 months.

Reproduction readiness

Time to first repro: days
Last checked: Aug 23, 2026

Major work

No dependency manifest, manual reconstruction required

  • mts-ai/replaceme has no requirements.txt, environment.yml, pyproject.toml, or Dockerfile.
  • You will need to reverse-engineer dependencies from import statements in the source code.
  • Last push was 455 days ago.
Open mts-ai/replaceme

Hardware requirements

  • Expect multi-day setup/compute for meaningful reproduction based on current guidance.

Hugging Face artifacts

No direct paper-linked artifacts were found. Showing strongest curated related artifacts for faster exploration.

Datasets

No trustworthy datasets matches right now.

Search datasets on Hugging Face

Spaces

No trustworthy spaces matches right now.

Search spaces on Hugging Face

Research context

Tasks

Transformer

Methods

Transformer

Domains

Natural Language Processing

Evaluation and human feedback data

Open this paper in HFEPX to review benchmark signals, evaluation modes, and human-feedback protocol context.

Open in HFEPX
Explore similar papers

Jump to Paper2Code search queries derived from this paper's research context.

Data includes links from Papers with Code ( CC-BY-SA-4.0 ).