Saved in:
Bibliographic Details
Main Authors: Yun, Jungmin, Kim, Mihyeon, Kim, Youngbin
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2406.01283
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866929371170734080
author Yun, Jungmin
Kim, Mihyeon
Kim, Youngbin
author_facet Yun, Jungmin
Kim, Mihyeon
Kim, Youngbin
contents Transformer-based models have achieved dominant performance in numerous NLP tasks. Despite their remarkable successes, pre-trained transformers such as BERT suffer from a computationally expensive self-attention mechanism that interacts with all tokens, including the ones unfavorable to classification performance. To overcome these challenges, we propose integrating two strategies: token pruning and token combining. Token pruning eliminates less important tokens in the attention mechanism's key and value as they pass through the layers. Additionally, we adopt fuzzy logic to handle uncertainty and alleviate potential mispruning risks arising from an imbalanced distribution of each token's importance. Token combining, on the other hand, condenses input sequences into smaller sizes in order to further compress the model. By integrating these two approaches, we not only improve the model's performance but also reduce its computational demands. Experiments with various datasets demonstrate superior performance compared to baseline models, especially with the best improvement over the existing BERT model, achieving +5%p in accuracy and +5.6%p in F1 score. Additionally, memory cost is reduced to 0.61x, and a speedup of 1.64x is achieved.
format Preprint
id arxiv_https___arxiv_org_abs_2406_01283
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Focus on the Core: Efficient Attention via Pruned Token Compression for Document Classification
Yun, Jungmin
Kim, Mihyeon
Kim, Youngbin
Computation and Language
Artificial Intelligence
Transformer-based models have achieved dominant performance in numerous NLP tasks. Despite their remarkable successes, pre-trained transformers such as BERT suffer from a computationally expensive self-attention mechanism that interacts with all tokens, including the ones unfavorable to classification performance. To overcome these challenges, we propose integrating two strategies: token pruning and token combining. Token pruning eliminates less important tokens in the attention mechanism's key and value as they pass through the layers. Additionally, we adopt fuzzy logic to handle uncertainty and alleviate potential mispruning risks arising from an imbalanced distribution of each token's importance. Token combining, on the other hand, condenses input sequences into smaller sizes in order to further compress the model. By integrating these two approaches, we not only improve the model's performance but also reduce its computational demands. Experiments with various datasets demonstrate superior performance compared to baseline models, especially with the best improvement over the existing BERT model, achieving +5%p in accuracy and +5.6%p in F1 score. Additionally, memory cost is reduced to 0.61x, and a speedup of 1.64x is achieved.
title Focus on the Core: Efficient Attention via Pruned Token Compression for Document Classification
topic Computation and Language
Artificial Intelligence
url https://arxiv.org/abs/2406.01283