Saved in:
Bibliographic Details
Main Authors: Wójcik, Bartosz, Devoto, Alessio, Pustelnik, Karol, Minervini, Pasquale, Scardapane, Simone
Format: Preprint
Published: 2023
Subjects:
Online Access:https://arxiv.org/abs/2312.10193
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866913616817553408
author Wójcik, Bartosz
Devoto, Alessio
Pustelnik, Karol
Minervini, Pasquale
Scardapane, Simone
author_facet Wójcik, Bartosz
Devoto, Alessio
Pustelnik, Karol
Minervini, Pasquale
Scardapane, Simone
contents While transformer models have been highly successful, they are computationally inefficient. We observe that for each layer, the full width of the layer may be needed only for a small subset of tokens inside a batch and that the "effective" width needed to process a token can vary from layer to layer. Motivated by this observation, we introduce the Adaptive Computation Module (ACM), a generic module that dynamically adapts its computational load to match the estimated difficulty of the input on a per-token basis. An ACM consists of a sequence of learners that progressively refine the output of their preceding counterparts. An additional gating mechanism determines the optimal number of learners to execute for each token. We also propose a distillation technique to replace any pre-trained model with an "ACMized" variant. Our evaluation of transformer models in computer vision and speech recognition demonstrates that substituting layers with ACMs significantly reduces inference costs without degrading the downstream accuracy for a wide interval of user-defined budgets.
format Preprint
id arxiv_https___arxiv_org_abs_2312_10193
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle Adaptive Computation Modules: Granular Conditional Computation For Efficient Inference
Wójcik, Bartosz
Devoto, Alessio
Pustelnik, Karol
Minervini, Pasquale
Scardapane, Simone
Machine Learning
While transformer models have been highly successful, they are computationally inefficient. We observe that for each layer, the full width of the layer may be needed only for a small subset of tokens inside a batch and that the "effective" width needed to process a token can vary from layer to layer. Motivated by this observation, we introduce the Adaptive Computation Module (ACM), a generic module that dynamically adapts its computational load to match the estimated difficulty of the input on a per-token basis. An ACM consists of a sequence of learners that progressively refine the output of their preceding counterparts. An additional gating mechanism determines the optimal number of learners to execute for each token. We also propose a distillation technique to replace any pre-trained model with an "ACMized" variant. Our evaluation of transformer models in computer vision and speech recognition demonstrates that substituting layers with ACMs significantly reduces inference costs without degrading the downstream accuracy for a wide interval of user-defined budgets.
title Adaptive Computation Modules: Granular Conditional Computation For Efficient Inference
topic Machine Learning
url https://arxiv.org/abs/2312.10193