ReplaceMe: Network Simplification via Depth Pruning and Transformer Block Linearization

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Shopkhoev, Dmitriy, Ali, Ammar, Zhussip, Magauiya, Malykh, Valentin, Lefkimmiatis, Stamatios, Komodakis, Nikos, Zagoruyko, Sergey
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866910027029151744
author Shopkhoev, Dmitriy
Ali, Ammar
Zhussip, Magauiya
Malykh, Valentin
Lefkimmiatis, Stamatios
Komodakis, Nikos
Zagoruyko, Sergey
author_facet Shopkhoev, Dmitriy
Ali, Ammar
Zhussip, Magauiya
Malykh, Valentin
Lefkimmiatis, Stamatios
Komodakis, Nikos
Zagoruyko, Sergey
contents 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
format Preprint
id arxiv_https___arxiv_org_abs_2505_02819
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle ReplaceMe: Network Simplification via Depth Pruning and Transformer Block Linearization
Shopkhoev, Dmitriy
Ali, Ammar
Zhussip, Magauiya
Malykh, Valentin
Lefkimmiatis, Stamatios
Komodakis, Nikos
Zagoruyko, Sergey
Computation and Language
Artificial Intelligence
Machine Learning
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
title ReplaceMe: Network Simplification via Depth Pruning and Transformer Block Linearization
topic Computation and Language
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2505.02819