학술논문

문서 분류를 위한 토큰 프루닝 및 압축 기반의 효과적인 어텐션 경량화 / Focus on the Core: Efficient Attention via Pruned Token Compression for Document Classification
Document Type
Dissertation/ Thesis
Source
Subject
Language
Korean
Abstract
트랜스포머 기반 모델은 자연어 처리 분야에서 광범위하게 활용되며 많은 연구가 진행되고 있다. 그러나 다각적인 분야에서 우수한 성능 달성하고 있음에도 불구하고, BERT 와 같은 사전 학습된 트랜스포머 기반 모델은 분류 성능에 긍정적으로 기여하지 않는 토큰을 포함한 모든 토큰과 상호작용하는 셀프 어텐션 메커니즘으로 인해 많은 연산량을 처리하는 데 어려움을 겪고 있다. 본 논문에서는 이러한 문제를 극복하고 모델을 경량화하며 분류 성능을 향상시키기 위해, 토큰 프루닝과 토큰 결합 전략을 통합하는 방식을 제안한다. 토큰 프루닝은 레이어를 통과하는 동안 셀프 어텐션의 key 와 value 에서 상대적으로 중요하지 않은 토큰을 제거한다. 또한, 불확실성을 고려하고 각 토큰 중요도의 불균형한 분포로 인해 발생하는 잠재적인 잘못된 프루닝의 위험성을 완화하기 위해 퍼지 논리를 도입한다. 반면, 토큰 결합은 입력 시퀀스를 더 작은 크기로 결합하여 모델을 효율적으로 압축한다. 이 두 가지 50 접근 방식을 통합함으로써 모델의 분류 성능을 향상시키는 동시에 계산 비용을 줄일 수 있다. 다양한 분류 데이터셋을 사용한 실험 결과, 제안된 모델이 비교 모델들 대비 향상된 분류 성능을 보이는 것을 확인할 수 있다. 그뿐만 아니라 기존 BERT 모델 대비 정확도가 5%p, F1 점수가 5.6%p 향상되었으며, 메모리 비용은 0.61 배 감소하고, 속도는 1.64 배 빨라진 결과를 얻을 수 있었다.
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 52 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.