Multipole Attention for Efficient Long Context Reasoning

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Hooper, Coleman, Zhao, Sebastian, Manolache, Luca, Kim, Sehoon, Mahoney, Michael W., Shao, Yakun Sophia, Keutzer, Kurt, Gholami, Amir
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866917143456514048
author Hooper, Coleman
Zhao, Sebastian
Manolache, Luca
Kim, Sehoon
Mahoney, Michael W.
Shao, Yakun Sophia
Keutzer, Kurt
Gholami, Amir
author_facet Hooper, Coleman
Zhao, Sebastian
Manolache, Luca
Kim, Sehoon
Mahoney, Michael W.
Shao, Yakun Sophia
Keutzer, Kurt
Gholami, Amir
contents Large Reasoning Models (LRMs) have shown promising accuracy improvements on complex problem-solving tasks. While these models have attained high accuracy by leveraging additional computation at test time, they need to generate long chain-of-thought reasoning in order to think before answering, which requires generating thousands of tokens. While sparse attention methods can help reduce the KV cache pressure induced by this long autoregressive reasoning, these methods can introduce errors which disrupt the reasoning process. Additionally, prior methods often pre-process the input to make it easier to identify the important prompt tokens when computing attention during generation, and this pre-processing is challenging to perform online for newly generated reasoning tokens. Our work addresses these challenges by introducing Multipole Attention, which accelerates autoregressive reasoning by only computing exact attention for the most important tokens, while maintaining approximate representations for the remaining tokens. Our method first performs clustering to group together semantically similar key vectors, and then uses the cluster centroids both to identify important key vectors and to approximate the remaining key vectors in order to retain high accuracy. We design a fast cluster update process to quickly re-cluster the input and previously generated tokens, thereby allowing for accelerating attention to the previous output tokens. We evaluate our method using emerging LRMs such as Qwen-8B, demonstrating that our approach can maintain accuracy on complex reasoning tasks even with aggressive attention sparsity settings. We also provide kernel implementations to demonstrate the practical efficiency gains from our method, achieving up to 4.5$\times$ speedup for attention in long-context reasoning applications. Our code is available at https://github.com/SqueezeAILab/MultipoleAttention.
format Preprint
id arxiv_https___arxiv_org_abs_2506_13059
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Multipole Attention for Efficient Long Context Reasoning
Hooper, Coleman
Zhao, Sebastian
Manolache, Luca
Kim, Sehoon
Mahoney, Michael W.
Shao, Yakun Sophia
Keutzer, Kurt
Gholami, Amir
Computation and Language
Machine Learning
Large Reasoning Models (LRMs) have shown promising accuracy improvements on complex problem-solving tasks. While these models have attained high accuracy by leveraging additional computation at test time, they need to generate long chain-of-thought reasoning in order to think before answering, which requires generating thousands of tokens. While sparse attention methods can help reduce the KV cache pressure induced by this long autoregressive reasoning, these methods can introduce errors which disrupt the reasoning process. Additionally, prior methods often pre-process the input to make it easier to identify the important prompt tokens when computing attention during generation, and this pre-processing is challenging to perform online for newly generated reasoning tokens. Our work addresses these challenges by introducing Multipole Attention, which accelerates autoregressive reasoning by only computing exact attention for the most important tokens, while maintaining approximate representations for the remaining tokens. Our method first performs clustering to group together semantically similar key vectors, and then uses the cluster centroids both to identify important key vectors and to approximate the remaining key vectors in order to retain high accuracy. We design a fast cluster update process to quickly re-cluster the input and previously generated tokens, thereby allowing for accelerating attention to the previous output tokens. We evaluate our method using emerging LRMs such as Qwen-8B, demonstrating that our approach can maintain accuracy on complex reasoning tasks even with aggressive attention sparsity settings. We also provide kernel implementations to demonstrate the practical efficiency gains from our method, achieving up to 4.5$\times$ speedup for attention in long-context reasoning applications. Our code is available at https://github.com/SqueezeAILab/MultipoleAttention.
title Multipole Attention for Efficient Long Context Reasoning
topic Computation and Language
Machine Learning
url https://arxiv.org/abs/2506.13059