Merging Feed-Forward Sublayers for Compressed Transformers

Neha Verma, Kenton Murray, Kevin Duh
1/10/2025
cs.CLcs.LG

No official code found. Best implementation: nverma1/merging-ffs-compression (12 stars, last commit 2025-10-16).

Abstract

With the rise and ubiquity of larger deep learning models, the need for high-quality compression techniques is growing in order to deploy these models widely. The sheer parameter count of these models makes it difficult to fit them into the memory constraints of different hardware. In this work, we present a novel approach to model compression by merging similar parameter groups within a model, rather than pruning away less important parameters. Specifically, we select, align, and merge separate feed-forward sublayers in Transformer models, and test our method on language modeling, image classification, and machine translation. With our method, we demonstrate performance comparable to the original models while combining more than a third of model feed-forward sublayers, and demonstrate improved performance over a strong layer-pruning baseline. For instance, we can remove over 21% of total parameters from a Vision Transformer, while maintaining 99% of its original performance. Additionally, we observe that some groups of feed-forward sublayers exhibit high activation similarity, which may help explain their surprising mergeability.

View on arXivView PDF

Code Implementations(1)

121Shell, PythonAug 12, 20241 years ago

Similar Papers

Cite this paper

@article{verma2025merging,
  title  = {Merging Feed-Forward Sublayers for Compressed Transformers},
  author = {Neha Verma and Kenton Murray and Kevin Duh},
  year   = {2025},
  eprint = {2501.06126},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2501.06126v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2501.06126.svg)](https://codeofpaper.com/paper/2501.06126)

Discussion