Radar: Fast Long-Context Decoding for Any Transformer

Yongchang Hao, Mengyao Zhai, Hossein Hajimirsadeghi, Sepidehsadat Hosseini, Frederick Tung
3/13/2025
cs.LG

No official code found. Best implementation: BorealisAI/radar-decoding (9 stars, LGPL-3.0, last commit 2025-02-28).

Abstract

Transformer models have demonstrated exceptional performance across a wide range of applications. Though forming the foundation of Transformer models, the dot-product attention does not scale well to long-context data since its time requirement grows quadratically with context length. In this work, we propose Radar, a training-free approach that accelerates inference by dynamically searching for the most important context tokens. For any pre-trained Transformer, Radar can reduce the decoding time complexity without training or heuristically evicting tokens. Moreover, we provide theoretical justification for our approach, demonstrating that Radar can reliably identify the most important tokens with high probability. We conduct extensive comparisons with the previous methods on a wide range of tasks. The results demonstrate that Radar achieves the state-of-the-art performance across different architectures with reduced time complexity, offering a practical solution for efficient long-context processing of Transformers.

View on arXivView PDF

Code Implementations(1)

LGPL-3.0
90PythonFeb 27, 20251 years agoLGPL-3.0

Similar Papers

Cite this paper

@article{hao2025radar,
  title  = {Radar: Fast Long-Context Decoding for Any Transformer},
  author = {Yongchang Hao and Mengyao Zhai and Hossein Hajimirsadeghi and Sepidehsadat Hosseini and Frederick Tung},
  year   = {2025},
  eprint = {2503.10571},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2503.10571v1},
  journal = {ICLR 2025 2025}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2503.10571.svg)](https://codeofpaper.com/paper/2503.10571)

Discussion