Core Context Aware Transformers for Long Context Language Modeling

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Chen, Yaofo, You, Zeng, Zhang, Shuhai, Li, Haokun, Li, Yirui, Wang, Yaowei, Tan, Mingkui
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866913973823078400
author Chen, Yaofo
You, Zeng
Zhang, Shuhai
Li, Haokun
Li, Yirui
Wang, Yaowei
Tan, Mingkui
author_facet Chen, Yaofo
You, Zeng
Zhang, Shuhai
Li, Haokun
Li, Yirui
Wang, Yaowei
Tan, Mingkui
contents Transformer-based Large Language Models (LLMs) have exhibited remarkable success in extensive tasks primarily attributed to self-attention mechanism, which requires a token to consider all preceding tokens as its context to compute attention. However, when the context length L becomes very large (e.g., 128K), the amount of potentially redundant information in the context tends to increase. The redundant context not only hampers the modeling representation performance but also incurs unnecessary computational and storage overhead. In this paper, we propose a plug-and-play Core Context Aware (CCA) Attention for efficient long-context modeling, comprising two complementary modules: 1) Globality-aware pooling module groups input tokens and dynamically compresses each group into one core token based on their significance. In this way, our method automatically focuses and strengthens core context while diminishing redundancy during the learning process, leading to effective long-term dependency modeling. 2) Locality-preserving module incorporates neighboring tokens to preserve local context for detailed representation. Notably, our CCA-Attention is able to replace the self-attention module in existing LLMs with minimal fine-tuning cost. Extensive experimental results show the superiority of our method in both long-context modeling and computational efficiency over state-of-the-art methods.
format Preprint
id arxiv_https___arxiv_org_abs_2412_12465
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Core Context Aware Transformers for Long Context Language Modeling
Chen, Yaofo
You, Zeng
Zhang, Shuhai
Li, Haokun
Li, Yirui
Wang, Yaowei
Tan, Mingkui
Computation and Language
Machine Learning
Transformer-based Large Language Models (LLMs) have exhibited remarkable success in extensive tasks primarily attributed to self-attention mechanism, which requires a token to consider all preceding tokens as its context to compute attention. However, when the context length L becomes very large (e.g., 128K), the amount of potentially redundant information in the context tends to increase. The redundant context not only hampers the modeling representation performance but also incurs unnecessary computational and storage overhead. In this paper, we propose a plug-and-play Core Context Aware (CCA) Attention for efficient long-context modeling, comprising two complementary modules: 1) Globality-aware pooling module groups input tokens and dynamically compresses each group into one core token based on their significance. In this way, our method automatically focuses and strengthens core context while diminishing redundancy during the learning process, leading to effective long-term dependency modeling. 2) Locality-preserving module incorporates neighboring tokens to preserve local context for detailed representation. Notably, our CCA-Attention is able to replace the self-attention module in existing LLMs with minimal fine-tuning cost. Extensive experimental results show the superiority of our method in both long-context modeling and computational efficiency over state-of-the-art methods.
title Core Context Aware Transformers for Long Context Language Modeling
topic Computation and Language
Machine Learning
url https://arxiv.org/abs/2412.12465