Attention Entropy is a Key Factor: An Analysis of Parallel Context Encoding with Full-attention-based Pre-trained Language Models

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Zhang, Zhisong, Wang, Yan, Huang, Xinting, Fang, Tianqing, Zhang, Hongming, Deng, Chenlong, Li, Shuaiyi, Yu, Dong
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866909659469709312
author Zhang, Zhisong
Wang, Yan
Huang, Xinting
Fang, Tianqing
Zhang, Hongming
Deng, Chenlong
Li, Shuaiyi
Yu, Dong
author_facet Zhang, Zhisong
Wang, Yan
Huang, Xinting
Fang, Tianqing
Zhang, Hongming
Deng, Chenlong
Li, Shuaiyi
Yu, Dong
contents Large language models have shown remarkable performance across a wide range of language tasks, owing to their exceptional capabilities in context modeling. The most commonly used method of context modeling is full self-attention, as seen in standard decoder-only Transformers. Although powerful, this method can be inefficient for long sequences and may overlook inherent input structures. To address these problems, an alternative approach is parallel context encoding, which splits the context into sub-pieces and encodes them parallelly. Because parallel patterns are not encountered during training, naively applying parallel encoding leads to performance degradation. However, the underlying reasons and potential mitigations are unclear. In this work, we provide a detailed analysis of this issue and identify that unusually high attention entropy can be a key factor. Furthermore, we adopt two straightforward methods to reduce attention entropy by incorporating attention sinks and selective mechanisms. Experiments on various tasks reveal that these methods effectively lower irregular attention entropy and narrow performance gaps. We hope this study can illuminate ways to enhance context modeling mechanisms.
format Preprint
id arxiv_https___arxiv_org_abs_2412_16545
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Attention Entropy is a Key Factor: An Analysis of Parallel Context Encoding with Full-attention-based Pre-trained Language Models
Zhang, Zhisong
Wang, Yan
Huang, Xinting
Fang, Tianqing
Zhang, Hongming
Deng, Chenlong
Li, Shuaiyi
Yu, Dong
Computation and Language
Large language models have shown remarkable performance across a wide range of language tasks, owing to their exceptional capabilities in context modeling. The most commonly used method of context modeling is full self-attention, as seen in standard decoder-only Transformers. Although powerful, this method can be inefficient for long sequences and may overlook inherent input structures. To address these problems, an alternative approach is parallel context encoding, which splits the context into sub-pieces and encodes them parallelly. Because parallel patterns are not encountered during training, naively applying parallel encoding leads to performance degradation. However, the underlying reasons and potential mitigations are unclear. In this work, we provide a detailed analysis of this issue and identify that unusually high attention entropy can be a key factor. Furthermore, we adopt two straightforward methods to reduce attention entropy by incorporating attention sinks and selective mechanisms. Experiments on various tasks reveal that these methods effectively lower irregular attention entropy and narrow performance gaps. We hope this study can illuminate ways to enhance context modeling mechanisms.
title Attention Entropy is a Key Factor: An Analysis of Parallel Context Encoding with Full-attention-based Pre-trained Language Models
topic Computation and Language
url https://arxiv.org/abs/2412.16545