Unveiling Simplicities of Attention: Adaptive Long-Context Head Identification
Fuente:
arXiv
Guardado en:
| Autores principales: | , , , , , |
|---|---|
| Formato: | Preprint |
| Publicado: |
2025
|
| Materias: | |
| Acceso en línea: | |
| Etiquetas: |
Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
|
| _version_ | 1866916644087922688 |
|---|---|
| author | Donhauser, Konstantin Arnal, Charles Pezeshki, Mohammad Cabannes, Vivien Lopez-Paz, David Ahuja, Kartik |
| author_facet | Donhauser, Konstantin Arnal, Charles Pezeshki, Mohammad Cabannes, Vivien Lopez-Paz, David Ahuja, Kartik |
| contents | The ability to process long contexts is crucial for many natural language processing tasks, yet it remains a significant challenge. While substantial progress has been made in enhancing the efficiency of attention mechanisms, there is still a gap in understanding how attention heads function in long-context settings. In this paper, we observe that while certain heads consistently attend to local information only, others swing between attending to local and long-context information depending on the query. This raises the question: can we identify which heads require long-context information to predict the next token accurately? We demonstrate that it's possible to predict which heads are crucial for long-context processing using only local keys. The core idea here is to exploit a simple model for the long-context scores via second moment approximations. These findings unveil simple properties of attention in the context of long sequences, and open the door to potentially significant gains in efficiency. |
| format | Preprint |
| id |
arxiv_https___arxiv_org_abs_2502_09647 |
| institution | arXiv |
| publishDate | 2025 |
| record_format | arxiv |
| spellingShingle | Unveiling Simplicities of Attention: Adaptive Long-Context Head Identification Donhauser, Konstantin Arnal, Charles Pezeshki, Mohammad Cabannes, Vivien Lopez-Paz, David Ahuja, Kartik Computation and Language Machine Learning The ability to process long contexts is crucial for many natural language processing tasks, yet it remains a significant challenge. While substantial progress has been made in enhancing the efficiency of attention mechanisms, there is still a gap in understanding how attention heads function in long-context settings. In this paper, we observe that while certain heads consistently attend to local information only, others swing between attending to local and long-context information depending on the query. This raises the question: can we identify which heads require long-context information to predict the next token accurately? We demonstrate that it's possible to predict which heads are crucial for long-context processing using only local keys. The core idea here is to exploit a simple model for the long-context scores via second moment approximations. These findings unveil simple properties of attention in the context of long sequences, and open the door to potentially significant gains in efficiency. |
| title | Unveiling Simplicities of Attention: Adaptive Long-Context Head Identification |
| topic | Computation and Language Machine Learning |
| url | https://arxiv.org/abs/2502.09647 |