Learning When Not to Attend Globally

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Luo, Xuan, Zhang, Kailai, Yan, Xifeng
Formato: Preprint
Publicado: 2025
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866908734460002304
author Luo, Xuan
Zhang, Kailai
Yan, Xifeng
author_facet Luo, Xuan
Zhang, Kailai
Yan, Xifeng
contents When reading books, humans focus primarily on the current page, flipping back to recap prior context only when necessary. Similarly, we demonstrate that Large Language Models (LLMs) can learn to dynamically determine when to attend to global context. We propose All-or-Here Attention (AHA), which utilizes a binary router per attention head to dynamically toggle between full attention and local sliding window attention for each token. Our results indicate that with a window size of 256 tokens, up to 93\% of the original full attention operations can be replaced by sliding window attention without performance loss. Furthermore, by evaluating AHA across various window sizes, we identify a long-tail distribution in context dependency, where the necessity for full attention decays rapidly as the local window expands. By decoupling local processing from global access, AHA reveals that full attention is largely redundant, and that efficient inference requires only on-demand access to the global context.
format Preprint
id arxiv_https___arxiv_org_abs_2512_22562
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Learning When Not to Attend Globally
Luo, Xuan
Zhang, Kailai
Yan, Xifeng
Computation and Language
Artificial Intelligence
When reading books, humans focus primarily on the current page, flipping back to recap prior context only when necessary. Similarly, we demonstrate that Large Language Models (LLMs) can learn to dynamically determine when to attend to global context. We propose All-or-Here Attention (AHA), which utilizes a binary router per attention head to dynamically toggle between full attention and local sliding window attention for each token. Our results indicate that with a window size of 256 tokens, up to 93\% of the original full attention operations can be replaced by sliding window attention without performance loss. Furthermore, by evaluating AHA across various window sizes, we identify a long-tail distribution in context dependency, where the necessity for full attention decays rapidly as the local window expands. By decoupling local processing from global access, AHA reveals that full attention is largely redundant, and that efficient inference requires only on-demand access to the global context.
title Learning When Not to Attend Globally
topic Computation and Language
Artificial Intelligence
url https://arxiv.org/abs/2512.22562