Modular Transformers: Compressing Transformers into Modularized Layers for Flexible Efficient Inference

Wangchunshu Zhou, Ronan Le Bras, Yejin Choi
6/4/2023
cs.CLcs.LG

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

Pre-trained Transformer models like T5 and BART have advanced the state of the art on a wide range of text generation tasks. Compressing these models into smaller ones has become critically important for practical use. Common neural network compression techniques such as knowledge distillation or quantization are limited to static compression where the compression ratio is fixed. In this paper, we introduce Modular Transformers, a modularized encoder-decoder framework for flexible sequence-to-sequence model compression. Modular Transformers train modularized layers that have the same function of two or more consecutive layers in the original model via module replacing and knowledge distillation. After training, the modularized layers can be flexibly assembled into sequence-to-sequence models that meet different performance-efficiency trade-offs. Experimental results show that after a single training phase, by simply varying the assembling strategy, Modular Transformers can achieve flexible compression ratios from 1.1x to 6x with little to moderate relative performance drop.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{zhou2023modular,
  title  = {Modular Transformers: Compressing Transformers into Modularized Layers for Flexible Efficient Inference},
  author = {Wangchunshu Zhou and Ronan Le Bras and Yejin Choi},
  year   = {2023},
  eprint = {2306.02379},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2306.02379v1}
}

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/2306.02379.svg)](https://codeofpaper.com/paper/2306.02379)

Discussion