Neural Attention Search Linear: Towards Adaptive Token-Level Hybrid Attention Models
Abstract
Lay Summary
Humans do not need to remember every word they read when recalling something from context. Instead, they focus more on the more informative context and pay less attention to other irrelevant words. We believe that a language model could achieve similar results, delivering both strong performance and lower latency. We design a model that automatically decides whether to apply expensive but strong nonlinear softmax attention operations or cheaper but weaker linear attention operations for each token. The model will determine which operation to apply on its own and does not necessarily need to follow any pre-defined fixed rule. This decision process can be learned end-to-end with minimal computational overhead. Experiments showed that our token-level hybrid attention model, Neural Attention Search Linear (NAtS-L), achieves better retrieval performance with lower computational cost in long-context scenarios.