NeurIPS 2026QuestionsPapersAreasAboutMarkdown

Positional LSH: Binary Block Matrix Approximation for Attention with Linear Biases

Daniel Wolfson, Tal Wagner

NeurIPS page · OpenReview · alphaXiv · Open on the map

Category: Efficient LLM Inference & Training › Efficient Attention Mechanisms · Type: new method · Keywords: attention mechanisms, ALiBi, locality-sensitive hashing, binary block matrices, efficient transformers, theoretical approximation

Areas: Model Architectures & Sequence Modeling › Language Model Architectures › Efficient Attention

Summary

Positional LSH introduces a binary block matrix approximation that links ALiBi bias to random masks, enabling near-linear time efficient attention for long contexts in large language models.

Explained to a 5-year-old

Transformers are computer programs that read words and remember their order. Sometimes they add a special hint to remember which words are close together. This paper shows how to make that hint using simple random blocks. By using these blocks, the program can work faster on long texts. It helps the computer understand more words without getting too slow.

Explained to a 5-year-old, longer

A transformer is a kind of computer brain that processes sentences. It needs to know where each word belongs in the sentence. To do this, it can use three tricks: special numbers, masks, or extra hints. This paper looks at one of those hints called ALiBi and connects it to a random-block idea. By creating many small random blocks that point to nearby words, the model can approximate the hint. These blocks are easy to compute, so the whole attention step becomes faster. The theory says that using enough blocks will keep the answers accurate. In practice, the method was tested on big language models and worked as expected, making long texts easier to handle.

For a technical reader

The paper shows that the bias used in ALiBi attention can be seen as the average of simple binary masks generated by a locality-sensitive hashing scheme. By sampling these masks, the authors approximate the bias with provable guarantees on spectral and max norms. This approximation lets them break down long-range attention into many short-range, unbiased attention operations, achieving near-linear time complexity. Experiments on large language models confirm the theoretical speed-accuracy trade-off.

Problem

Transformers use positional encodings via embeddings, masks, or biases, but the relationships among these mechanisms are not well understood, and efficiently computing attention with positional bias over long sequences remains challenging.

Method

The approach samples binary block-diagonal masks from a locality-sensitive hashing scheme, averages them to approximate the linear bias matrix, and uses these masks to decompose long-context biased attention into many short-context unbiased attention operations.

Results

Experiments on large language models confirm that the approximate attention maintains accuracy while achieving near-linear time scaling.

Contributions

The paper provides a theoretical connection between ALiBi bias and random binary masks, proves uniform approximation guarantees, and shows how to reduce long-context biased attention to many short-context unbiased operations.

Practical relevance

The findings enable more scalable long-context inference for large language models, potentially reducing computational cost in real-world applications.

Research questions this paper is counted under

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction