COST-EFF: Collaborative Optimization of Spatial and Temporal Efficiency with Slenderized Multi-exit Language Models

Bowen Shen, Zheng Lin, Yuanxin Liu, Zhengxiao Liu, Lei Wang +1 more
10/27/2022
cs.CL

Official code: sbwww/COST-EFF (7 stars, Python, Apache-2.0, last commit 2022-10-20).

Abstract

Transformer-based pre-trained language models (PLMs) mostly suffer from excessive overhead despite their advanced capacity. For resource-constrained devices, there is an urgent need for a spatially and temporally efficient model which retains the major capacity of PLMs.

Show full abstract

However, existing statically compressed models are unaware of the diverse complexities between input instances, potentially resulting in redundancy and inadequacy for simple and complex inputs. Also, miniature models with early exiting encounter challenges in the trade-off between making predictions and serving the deeper layers. Motivated by such considerations, we propose a collaborative optimization for PLMs that integrates static model compression and dynamic inference acceleration. Specifically, the PLM is slenderized in width while the depth remains intact, complementing layer-wise early exiting to speed up inference dynamically. To address the trade-off of early exiting, we propose a joint training approach that calibrates slenderization and preserves contributive structures to each exit instead of only the final layer. Experiments are conducted on GLUE benchmark and the results verify the Pareto optimality of our approach at high compression and acceleration rate with 1/8 parameters and 1/19 FLOPs of BERT.

View on arXivView PDF

Code Implementations(1)

sbwww/COST-EFFOfficial100%
Apache-2.0

[EMNLP 2022] COST-EFF: Collaborative Optimization of Spatial and Temporal Efficiency with Slenderized Multi-exit Language Models

70Python, ShellOct 18, 20224 years agoApache-2.0

Similar Papers

Cite this paper

@article{shen2022costeff,
  title  = {COST-EFF: Collaborative Optimization of Spatial and Temporal Efficiency with Slenderized Multi-exit Language Models},
  author = {Bowen Shen and Zheng Lin and Yuanxin Liu and Zhengxiao Liu and Lei Wang and Weiping Wang},
  year   = {2022},
  eprint = {2210.15523},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2210.15523}
}

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

Discussion