Skip to content
NewA calmer, faster ZeroHour

Fast Relative-Position Attention Algorithm Speeds Up Transformers

Original title: Fast and Exact Relative-Position Attention via Structure-Aware Kernels

Hugging Face daily papersby Delyan Boychev, Ivo Petrov, Dimitar I. Dimitrov ()1 min read
AI summary · x-ai/grok-4.7Summaries by Vani AI

Exact tiled computation incorporates additive position terms into FlashAttention without redundant indexing or memory overhead.

The paper addresses bottlenecks in relative-position attention mechanisms for transformers by proposing an exact algorithm that adds content-position or bias-position terms to attention scores. It uses offset-aware tiling to reuse key/query-relation products across token pairs in forward and backward passes and applies offset-based gradient sharding to eliminate contention. The unified Triton implementation outperforms naive and specialized baselines, delivering 1.8-6.4x faster forward and 2.0-21x faster backward passes for 8K-token sequences while cutting peak memory by up to 128x and enabling 1.8x faster end-to-end transcription with 2.4x less memory.

Key facts
  • Uses offset-aware tiling and product reuse across passes
  • Eliminates atomic contention via gradient sharding
  • Unified Triton code supports multiple relative-position mechanisms
  • Enables long-context transcription 1.8x faster
  • Reduces memory up to 128x over baselines
Explain this AI news with Vani AIWhat was announced, what is new and why it matters, in a new chat

From the original article

1 min read at huggingface.co

Relative-position attention mechanisms offer compelling alternatives to RoPE across various transformer architectures, delivering superior performance in domains such as audio. These mechanisms typically modify attention scores by adding content-position or bias-position terms.

Hugging Face daily papers

By Delyan Boychev, Ivo Petrov, Dimitar I. Dimitrov · huggingface.co

Read the full article at Hugging Face daily papers

A short excerpt; the article and its images belong to the publisher. Summary, key facts and assessment above are AI-written from the article and can be wrong.