potentialpaper

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

Daniel Wolfson, Tal Wagner

HiLD @ ICML 2026

Edit this page

Or clone it with git

Run in a terminal:

Needs Git LFS. To push, use an API key from your profile as the password.

Or let your agent set it up

It checks and sets up everything: signing in, git, the clone, credentials and an SSH key.

TL;DR. Theoretical analysis of ALiBi via novel "positional LSH" which implies a near-linear time approximation for long-context attention with ALiBi

Abstract. Positional encoding in transformers is commonly implemented through positional embeddings, attention masks, or bias terms, but formal connections between these mechanisms remain limited. We study attention with positional bias through the lens of locality-sensitive hashing (LSH), focusing on Attention with Linear Biases (ALiBi). We show that the ALiBi bias matrix is the expectation of contiguous block-diagonal binary masks induced by a ``positional LSH'' scheme. The empirical mean of masks sampled from this scheme yields spectral norm and max-norm approximation guarantees with bounded block sizes with high probability. This structural theorem implies a uniform approximation theorem for ALiBi-biased attention: with high probability over the sampled masks, the approximate attention output is accurate simultaneously for all query-key-value inputs and can be computed in near-linear time in the context length, reducing long-context ALiBi to a collection of randomized short-context regular (positionally unbiased) attention operations. Conceptually, this connects positional bias, masks, and positional embeddings in a single formal framework and suggests an approach to efficient ALiBi-biased attention. Experiments on large language models validate our theoretical findings.

Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.

Claim this paper
How does this paper connect to your work? Write how you built on it, compared with it or reproduced it, or add a summary, a critique or errata.
Or make it interactive:
Start writing

edit · history

FromAToBDateVersionSubmitted toPDFEvidence
30 Apr 2026NeurIPS 2026submittedNeurIPS 2026Accept (poster)reviews ↓[1]PDF[1]
7 May 2026HiLD @ ICML 2026submittedHiLD @ ICML 2026Accepted · Poster—[1]
Their titles, abstracts and, where both have a PDF, the text.Missing a version?

NeurIPS 2026

Accept (poster) · 3 reviews · OpenReview

Updated 25 Nov 2026, 03:50 UTC.

Program Chairs · DecisionOpenReview ↗
Decision
Accept (poster)
Read decision
Meta-review

The paper introduces an algorithm for approximating Alibi rotational attention. The algorithm is based on LSH, specifically the Rahimi-Recht's random binning features. The experiments show that this approximation does not lose too much quality over (exact) Alibi.

The reviewers appreciated the solid theoretical contribution, with potential applications to practice. There were a few concerns, though, after the rebuttal, those were not deemed jeopardizing.

  • the algorithm is a rather straight-forward adaptation of Rahimi-Recht's LSH (designed specifically for this kernel). The main contribution is concentration bounds. The paper didn't articulate clearly why these concentration bounds are an important theorem.
  • the experiments were seems as small, and do not yet give evidence that the algorithm would have impact in practice.
  • the fact the algorithm is exclusively for Alibi has been seen as a downside (but it was recognized that Alibi is just sufficiently different from RoPE).
Final justification

Overall, after the rebuttal, the reviews leaned to being much more positive, moving the submission into the accept category.

Area Chair J2Ft · Meta-reviewOpenReview ↗
Read meta-review
Meta-review

The paper introduces an algorithm for approximating Alibi rotational attention. The algorithm is based on LSH, specifically the Rahimi-Recht's random binning features. The experiments show that this approximation does not lose too much quality over (exact) Alibi.

The reviewers appreciated the solid theoretical contribution, with potential applications to practice. There were a few concerns, though, after the rebuttal, those were not deemed jeopardizing.

  • the algorithm is a rather straight-forward adaptation of Rahimi-Recht's LSH (designed specifically for this kernel). The main contribution is concentration bounds. The paper didn't articulate clearly why these concentration bounds are an important theorem.
  • the experiments were seems as small, and do not yet give evidence that the algorithm would have impact in practice.
  • the fact the algorithm is exclusively for Alibi has been seen as a downside (but it was recognized that Alibi is just sufficiently different from RoPE).
Final justification

Overall, after the rebuttal, the reviews leaned to being much more positive, moving the submission into the accept category.

Reviewer 57LfOpenReview ↗
Rating
4/6
Confidence
2/5
Quality
4/4
Clarity
3/4
Significance
2/4
Originality
3/4
Contribution type
theory
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

This paper studies ALiBi attention through the lens of locality-sensitive hashing over positional indices, showing that its exponential distance bias can be expressed as the expectation of contiguous block-diagonal binary attention masks. Based on this formulation, the authors derive spectral norm and uniform approximation guarantees for finite-sample estimates of the ALiBi bias matrix, and connect these results to a near-linear-time approximation of ALiBi attention via randomized block decomposition. The proposed method reduces attention computation to a mixture of short-range block attentions and is empirically validated to preserve approximation quality and downstream model behavior as sample size increases.

Strengths and weaknesses

Strengths

  • The paper presents a novel and conceptually clean connection between ALiBi positional bias and locality-sensitive hashing over sequence positions, which provides a unified view of positional bias and sparse attention mechanisms.
  • The authors establish non-trivial theoretical results, including spectral norm and max-norm convergence guarantees as well as uniform approximation bounds for ALiBi-biased attention under the proposed positional LSH framework.
  • The work offers a useful abstraction that connects positional embeddings, attention bias, and block-sparse attention, which may provide a foundation for further theoretical study of structured attention mechanisms.

Weaknesses

  • The paper does not demonstrate any measurable system-level benefit such as wall-clock speedup or improved throughput over optimized attention implementations (e.g., FlashAttention), making the practical efficiency claims largely theoretical.
  • The empirical evaluation focuses on approximation error and perplexity preservation, but does not provide evidence that the proposed decomposition yields advantages in realistic long-context or downstream LLM tasks.
  • The work is centered on ALiBi, which limits its broader relevance given that RoPE-based positional encodings dominate current large-scale language model architectures.
Questions
  • The paper claims a near-linear-time approximation for ALiBi attention, but it is unclear whether this leads to actual runtime speedups in practice. Could the authors clarify under what settings (e.g., sequence length or number of samples) the proposed method would outperform optimized implementations such as FlashAttention?
  • The proposed framework focuses on ALiBi as a specific instance of positional bias. Could the authors elaborate on whether the positional LSH construction can be extended to other commonly used positional encodings (such as RoPE-based methods), and what obstacles may arise in generalizing the current analysis beyond exponential distance kernels?
Limitations

yes

Final justification

The rebuttal clarifies my concerns regarding practical runtime and the scope of the framework, so I have raised my score from 3 to 4. As some aspects of the theoretical analysis are slightly outside my primary area of expertise, I would defer to reviewers with stronger theoretical backgrounds regarding its correctness and significance.

Formatting concerns

No issues related to formatting, anonymity, or compliance with the NeurIPS submission guidelines were identified.

2 comments
Authors · RebuttalOpenReview ↗
Rebuttal

Thank you for your review and feedback!

The paper claims a near-linear-time approximation for ALiBi attention, but it is unclear whether this leads to actual runtime speedups in practice. Could the authors clarify under what settings (e.g., sequence length or number of samples) the proposed method would outperform optimized implementations such as FlashAttention?

In our response to uzAm, we explain in more detail the reasons behind the gap between the asymptotic prediction and the empirical performance versus FlashAttention at the context lengths in our experiments. In brief, our approximation replaces one large, highly optimized attention operation with a collection of smaller block-attention operations. At the context lengths available to us, the substantial hardware and systems advantages of the former dominate. Since exact attention scales quadratically while our method is near-linear, we expect the relative advantage of our approach to improve as context length grows, though we cannot predict the practical cross-over point.

The proposed framework focuses on ALiBi as a specific instance of positional bias. Could the authors elaborate on whether the positional LSH construction can be extended to other commonly used positional encodings (such as RoPE-based methods), and what obstacles may arise in generalizing the current analysis beyond exponential distance kernels?

The key distinction is between extensions to other positional bias kernels and extensions to other positional encoding mechanisms such as RoPE. For other multiplicative positional biases, the basic positional-LSH framework applies whenever the corresponding kernel admits an LSH representation. The stronger spectral and runtime guarantees then require analyzing the particular hash family and positional geometry, analogously to our ALiBi analysis. In our response to uzAm we detail specific examples for kernels where our approach extends and also limitations to kernels where it does not.

RoPE presents a different but potentially promising direction. Unlike ALiBi and similar positional bias methods, which cleanly disentangle the context embedding of the token and its positional information, RoPE intertwines positional information with the query–key geometry rather than introducing a separate position-only bias matrix, so our current analysis does not transfer verbatim. Nevertheless, RoPE is itself based on a highly structured geometric transformation. LSH approaches are robust in facilitating efficient approximation methods in geometric settings, and it may be possible to develop an LSH construction that acts jointly on positional rotations and query/key embeddings to approximate RoPE. We view this as an interesting direction for future research on the positional-LSH perspective.

Additional responses to AC questions

The main contribution is concentration bounds. But it is unclear how informative the math behind concentration bounds is. What exactly do we learn from that?

There are a few important takeaways from our concentration bounds that do not follow from generic or prior LSH/RBF analysis:

  • Simultaneous approximation for all inputs: scalar RBF concentration controls one input at a time. Our matrix-norm concentration bounds lead to controlling the error for all attention inputs Q,K,V simultaneously with high probability (Theorem 2.2, line 95). Thus, the same sampled masks can be fixed once and reused across different inferences, which is essential for LLMs that remain frozen at inference mode.

  • Block size control: in generic LSH there is no bound on the number of points per hash bucket; in general all points could land in the same bucket. Our analysis shows that specifically for RBF on ALiBi, the block sizes are strongly concentrated. This is what yields the near-linear time approximation guarantee in Theorem 2.2

  • Input-dependent stability: our analysis doesn’t just give a worst-case error rate for all inputs - it also yields the input-specific ∥P∥2,∞\lVert P\rVert_{2,\infty} term in the error rate in Theorem 2.2, which follows from the spectral norm approximation bounds in Theorem 2.1. The interpretation of this term is that the error decays faster for diffuse attention rows than sharply concentrated ones.

it is hard to put the experiments in context: how should one evaluate the loss in perplexity/accuracy?

Those experiments are meant to demonstrate that the perplexity and accuracy of positional LSH approach those of ALiBi as the number of samples increases. The relevant quantity is the excess perplexity or accuracy deficit relative to exact ALiBi, and the experiments show that increasing ss consistently reduces this gap, validating the theoretical results on concrete LLMs. The purpose is thus not to establish performance gains but to demonstrate the convergence.

how does this compare to other methods for approximating attention?

The approximation target is different: most prior methods approximate attention without positional bias, i.e., the approximation target is AVAV or its normalized form (D[A])−1AV(D^{[A]})^{-1}AV. Our positional LSH method approximates attention with ALiBi (or potentially other positional bias schemes), i.e., the approximation target is (D[A⊙L])−1(A⊙L)V(D^{[A\odot L]})^{-1}(A\odot L)V. These are not interchangeable: an approximation guarantee for ordinary attention does not control the interaction between the raw attention scores AA, the positional bias LL, and the resulting change in row normalization. These prior methods could potentially be used together with ours, though they are not substitutes and not directly comparable.

is a message that one should use Alibi instead of RoPE?

We do not advocate for ALiBi over RoPE or other positional encoding/bias methods. Rather, we develop a theoretical framework for analyzing and approximating attention with positional bias, with ALiBi as a concrete rigorous instantiation. Potential extensions of our LSH framework to RoPE-based methods is an interesting future direction.

Reviewer 57Lf · CommentOpenReview ↗

Thank you for the detailed response. The rebuttal addresses most of my concerns, and I have raised my score from 3 to 4.

Reviewer uzAmOpenReview ↗
Rating
5/6
Confidence
2/5
Quality
3/4
Clarity
3/4
Significance
2/4
Originality
3/4
Contribution type
theory
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

The authors study Attention with Linear Biases(ALiBi) using a Locality Sensitive Hashing(LSH) framework. The main result shows that ALiBi matrix can be approximated by a linear combination of binary contiguous block-diagonal matrices. This given an interpretation that attention with linear bias can be approximated by attention with mask, where masks are obtained from LSH collision of positional embeddings.

The authors use this to design an efficient approximation algorithm (with provable guarantees) for long- context ALiBi. They also give some empirical validation of their theory.

Strengths and weaknesses

Strengths:

  1. The paper is very nicely written.
  2. The main theoretical result, of interpreting positional bias via LSH on positional embeddings is pretty interesting.
  3. The paper uses some nice results from random matrix theory in proving their main theorems

Weaknesses:

  1. The scope of the paper is rather limited. The results extend in case of natural extensions of ALiBi, but does not readily extend to any general positional bias scheme.
  2. Despite coming up with a theoretically more efficient algorithm (in terms of complexity), the approximation algorithm does not seem to give significant advantages in practice over existing ALiBi implementations. This restricts the paper's significance to a practitioner.
Questions
  1. Could you explain more on how your Theorem 2.1 would extend to other positional bias schemes than ALiBi? Maybe could you give an example where your framework does not extend and where it does, so that the reader may get an idea of what works and what breaks? A discussion on this would be nice.
  2. Intuitively, what is the computational bottleneck of your approximation scheme that does not make it beat existing ALiBi implementations despite having better complexity?
Limitations

The authors have addressed the limitations

Final justification

The authors have answered my questions in their rebuttal, and I believe this is a genuinely interesting paper.

Formatting concerns

No major formatting concerns

2 comments
Authors · RebuttalOpenReview ↗
Rebuttal

Thank you for your review and feedback!

Discussion of positional LSH beyond ALiBi

Could you explain more on how your Theorem 2.1 would extend to other positional bias schemes than ALiBi? Maybe could you give an example where your framework does not extend and where it does, so that the reader may get an idea of what works and what breaks? A discussion on this would be nice.

Let L(u,u′)L(u,u') be a positional bias scheme between positions u,u’u,u’. The key distinction here is between two questions:

  • (i) whether LL has a corresponding LSH scheme H\mathcal{H} such that L(u,u’)=Pr⁡h∼H[h(u)=h(u’)]L(u,u’)=\Pr_{h\sim\mathcal{H}}[h(u)=h(u’)] (or an approximate version of this equality);

  • (ii) whether the resulting random partition of the token position space has additional structure (e.g., spectral approximation, bounded LSH buckets, etc), which we have for ALiBi and would need to be checked on a case-by-case basis for other positional bias schemes.

In Theorem 2.1, what follows for any LSH scheme (i.e., from (i)) is the unbiasedness property E[M]=L\mathbb{E}[M]=L and the max-norm bound (eq. (3)). What requires further structure (i.e., (ii)) is the spectral norm bounds (eqs. (1)-(2)) and block size bound (eq. (4)). We prove these in Section 3 using the special structure of ALiBi and RBFs.

In Theorem 2.2, what follows for any LSH scheme (i.e., from (i)) is a weaker approximation guarantee, with ΔP’=O(log⁡(n)/s)\Delta_P’=O(\sqrt{\log(n)/s)} instead of ΔP\Delta_P from the theorem. What requires further structure (i.e., (ii)) is the stronger approximation guarantee stated in the theorem, ΔP=min⁡(∥P∥2,∞,1)⋅Δ~P’\Delta_P=\min(\lVert P \rVert_{2,\infty},1)\cdot\tilde\Delta_P’ (which requires the spectral norm bounds), and the near-linear running time guarantee (which requires the block size bound).

Example where our approach extends: Consider a mixture of Laplacian kernels at different bandwidths, L(u,u’)=∑jwje−∣u−u’∣/σjL(u,u’)=\sum_j w_j e^{-|u-u’|/\sigma_j} with non-negative weights ∑jwj=1\sum_j w_j=1 and bandwidths σj>0\sigma_j>0. This is common for capturing kernel relationships at different distance scales. Such a mixture admits an LSH scheme by sampling jj with probability wjw_j and then running RBF with bandwidth σj\sigma_j.

A concrete example of this is the logarithmic positional bias in KERPLE (Chi et al., NeurIPS 2022). The additive bias they use is −r1⋅log⁡(1+r2∣u−u’∣)-r_1\cdot\log(1+r_2|u-u’|) with r1,r2>0r_1,r_2>0, which corresponds to L(u,u’)=e−r1⋅log⁡(1+r2∣u−u’∣)=(1+r2∣u−u’∣)−r1L(u,u’)=e^{-r_1\cdot\log(1+r_2|u-u’|)}=(1+r_2|u-u’|)^{-r_1}. One may observe this equals L(u,u’)=Eλ∼Γ(r1,r2)[e−λ∣u−u’∣]L(u,u’)=\mathbb{E}_{\lambda\sim\Gamma(r_1,r_2)}[e^{-\lambda|u-u’|}] (this follows from the formula for the MGF of the Gamma distribution), and hence this is a Gamma-weighted mixture of Laplace kernels, as above. The LSH scheme draws λ∼Γ(r1,r2)\lambda\sim\Gamma(r_1,r_2) and runs RBF with bandwidth λ−1\lambda^{-1}.

Where our approach isn’t possible: In [7], Charikar (2002) shows that if LL admits an LSH scheme then 1−L1-L must satisfy the triangle inequality. This in principle establishes cases of LL for which no LSH scheme exists and therefore could not be used as positional biases in our approach (at least in its exact form; approximate LSH schemes may still exist).

Empirical running time

Intuitively, what is the computational bottleneck of your approximation scheme that does not make it beat existing ALiBi implementations despite having better complexity?

Our approximation algorithm gains its asymptotic speedup by replacing full exact attention (time O(n2d)O(n^2d)) with a collection of small exact attention instances (total time O~(nds)\tilde O(nds)). However, in practice, dense matrix operations in general and full exact attention in particular are massively optimized operations at the lower system level (e.g., by FlashAttention). These system-level optimizations are very beneficial empirically, making a single attention call very efficient even when it is large. Multiple small attentions, on the other hand, have the empirical overhead of multiple function calls (launch, memory movement, etc), and furthermore they may under-utilize the GPU because of their different sizes.

Nonetheless, the asymptotic advantage of our method may become expressed empirically at sufficiently large context lengths where full quadratic time attention may be too expensive or prohibitive despite system-level optimizations. However, that would require longer-context experiments than those available to us.

Reviewer uzAm · CommentOpenReview ↗

I thank the authors for their response to my questions, both of which they have answered satisfactorily, and I am raising my score. I encourage them to include the main points from the discussions during the rebuttal in the final version of their paper.

Nonetheless, the asymptotic advantage of our method may become expressed empirically at sufficiently large context lengths where full quadratic time attention may be too expensive or prohibitive despite system-level optimisations. However, that would require longer-context experiments than those available to us.

I am genuinely curious to see if it may work for larger contexts, so hopefully someone with a larger GPU budget implements it!.

Reviewer hFHJOpenReview ↗
Rating
5/6
Confidence
3/5
Quality
3/4
Clarity
2/4
Significance
3/4
Originality
4/4
Contribution type
theory
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

The main contribution is "theoretico-practical", namely, a practical method backed by theory for constructing an efficient approximation of positional encoding using a set of block-diagonal masks. The main contributions are: (a) the idea itself; and (b) rigorous bounds on the approximation quality of the block-diagonal masks.

Strengths and weaknesses

The strengths of the paper are evident - theory that leads to a useful practical implication for transformer models. The main weakness of the paper is its writing. First, beyond the mathematical definition, it's not really LHS in the sense that the objective here is not hashing for search of nearby objects. The name LSH carries an association with the use of cheap search of nearby objects, and leads to confusion when reading the paper. Second, the paper's intro could make a significantly better job at conveying the main "theoretico-practical" idea of the paper - efficiency driven by rigorous theory. It positions itself as - we find lhs <--> ALiBi encoding relationship, rather than we use this relationship as a tool to get important insights, while explaining why these insights are important and worth pursuing.

I do not see the limited number of experiments as a weakness, since they are enough to be convinced of the results in at least some settings.

Questions

NA

Limitations

Yes

Final justification

The reviewers adequately addressed concerns, and the required changes of the paper are small enough to recommend acceptance.

Formatting concerns

NA

2 comments
Authors · RebuttalOpenReview ↗
Rebuttal

Thank you for your review and feedback!

The name LSH carries an association with the use of cheap search of nearby objects and leads to confusion when reading the paper

Thanks for bringing this up. We agree that our use of LSH differs from its conventional nearest neighbor search application that is most widely associated with it. It is LSH under its formal definition as a hashing scheme where the collision probability is related to a metric similarity measure, but we use it for approximating the similarity via sampling rather than search.

The deeper underlying connection is that attention with positional bias prioritizes keys in nearby positions to the query, which makes LSH a suitable tool for cheaply prioritizing those nearby tokens, thus obtaining fast approximation – this is in a nutshell the key idea of the paper – though it takes the form of importance sampling (nearer positions have higher probability of “1” in the sampled binary mask) rather than indexing and search. We agree this distinction is worth clarifying.

the paper's intro could make a significantly better job at conveying the main "theoretico-practical" idea of the paper - efficiency driven by rigorous theory

We also agree that the introduction could better convey the ALiBi–LSH relationship more as an enabling tool for the approximation algorithm – our technical contribution is not just in the re-interpretation of ALiBi but also its algorithmic implications. We will reorganize it accordingly.

Reviewer hFHJ · CommentOpenReview ↗

Thinking about it again, I do not see reasons not to recommend acceptance. Most of my concerns are quite easy to address by small (even though important) changes in positioning and introduction. Assuming the authors do what they promised - I am raising my score to "accept".

I slightly disagree with the comment about "what do we learn from that?" - it is not always trivial that going from density to sparsity preserves or well approximates the properties we desire.

Comments on the paper

1 comment
Authors · CommentOpenReview ↗

As the discussion phase draws to a close, we’d like to thank the reviewers for their constructive and supportive engagement in the discussion and the valuable suggestions. We are committed to implementing the points raised in the discussion in the revised version of the paper.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Missing a submission?

Loading the discussion…