- Rating
- 4
- Clarity
- 3
- Confidence
- 3
- Originality
- 3
- Quality
- 3
- Significance
- 3
Read review
Summary
This paper analyzes the I/O complexity of approximating softmax attention; to be more specific, this work focuses on the softmax attention approximation that uses the polynomial method and low rank approximation. The main contribution of this paper is to provide the I/O complexities lower and upper bounds across regimes determined by the memory size M, dimension d, and polynomial degree g, and . In the best case, the authors obtain tight when , which matches the lower bound and improving over Flash Attention's I/O cost.
Strengths and weaknesses
For the strengths, this paper is well organized and provides enough details and background for the general audience to understand the problem the authors are working on. The motivation and research problem are clear and significant, as there is indeed a lack of research on I/O complexity in the fast attention series [1,2,3,4,5,6]. The framing of this research is strong, as modern attention bottlenecks are often memory movement, not just FLOPs.
The main technical idea is quite interesting and elegant, as the authors explore the fact that the entries of and are not stored inputs but can be generated from subsets of rows of Q and K. Moreover, this work provides a comprehensive regime analysis, from Case I to Case IV. The lower bound result is nontrivial, and the use of red-blue pebbling and S-partitions is well aligned with prior I/O complexity theory.
For the weaknesses, as the authors also mention, the assumptions of [1] are impractical and thus make this line of research remain on the theoretical side. There are two assumptions from [1], and , where is the maximum entry from and , and the major problem is with the assumption on . Because of this assumption, this line of work is hard to implement in practice. I think one thing the authors can consider is what would happen if were removed. How would it affect the I/O complexity or the correctness of the algorithm? Furthermore, there is a new work called support basis [7], which removes the assumption on in exchange for some sacrifice in time complexity, while still remaining sub-quadratic. I think it would be helpful to the community if the authors could explore the I/O complexity in a more practical setting and provide some empirical insights.
[1] Alman and Song. Fast Attention Requires Bounded Entries. NeurIPS'23
[2] Alman and Song. The Fine-Grained Complexity of Gradient Computation for Training Large Language Models. NeurIPS'24
[3] Alman and Song. How to capture higher-order correlations? generalizing matrix softmax attention to kronecker computation. ICLR'24
[4] Liang et al. Tensor Attention Training: Provably Efficient Learning of Higher-order Transformers.
[5] Alman and Song. Fast RoPE Attention: Combining the Polynomial Method and Fast Fourier Transform.
[6] Chen et al. Fast Gradient Computation for RoPE Attention in Almost Linear Time.
[7] Aliakbarpour et al. Support Basis: Fast Attention Beyond Bounded Entries. AISTATS'26 Oral
Questions
Q1: How would the proposed I/O bounds change if the bounded-entry assumption () is relaxed or removed?
Q2: Are the lower bounds specific to the algorithm from [1], or do they have broader implications for approximating attention algorithms?
Q3: The analysis shows strong theoretical I/O improvements over Flash Attention. Can the authors provide some simple empirical validations to show the advantages of the algorithm?
I understand that the practical setting may hurt the accuracy of the algorithm from [1], but it would be nice to see the computational time and I/O improvements.
[1] Alman and Song. Fast Attention Requires Bounded Entries. NeurIPS'23
Limitations
yes
Paper formatting concerns
N/A
Final justification
I am satisfied with the theoretical contribution of this work, and I will keep score 4 due to the lack of empirical validation. 4 is reasonable as asking for empirical result for this line of work is non-trivial, and slightly out of scope of this work.
We would like to sincerely thank the reviewer for their time and effort reviewing the paper. We reflect on the concrete questions below.
Q1. How would the proposed I/O bounds change if the bounded-entry assumption (B=o(log(n))) is relaxed or removed?
By default, this case is not covered by the Alman-Song algorithm. However, this does not really say a lot about practical scenarios for several reasons:
In practical settings, there is often no reason to assume that the entry magnitude B grows with or depends on the context length n; B is an independent parameter, and it should be treated as such.
Even if we argue that B=Ω(log(n)), in practice g would be eventually chosen empirically as a moderate constant g=10 or g=20. This will still provide good approximations in most cases, just without worst-case theoretical guarantees. This practical algorithm would have the same I/O cost.
As a side note, even though FlashAttention is often advertised as an exact attention algorithm, it also has an implicit dependence on the size of the matrix entries under-the-hood, since exponentials are approximated instead of being computed exactly.
However, these observations were only regarding the original Alman-Song algorithm - the recent work of Aliakbarpour et al [7] allows an even more complete and satisfying answer to the question.
Firstly, we would like to thank you very much for pointing us towards this work. This is a new and interesting paper that is an excellent fit to our results: in the decomposition of [7], the dense matrices are exactly as in Alman-Song, whereas the sparse matrices have at most nα non-zero entries for some α<1. This sparsity allows even the simpler techniques in our Lemma 3.1 to compute the sparse matrix multiplications without incurring an overhead of more than O(n⋅d), hence not affecting the total I/O cost. As such, this work of [7] is exactly the kind of tool that would allow to easily extend our upper bounds to matrices with larger entries, as addressed in your question.
We can add a brief new appendix to the paper to summarize this generalization opportunity.
Q2. Are the lower bounds specific to the algorithm from [1], or do they have broader implications for approximating attention algorithms?
We are happy to further clarify this for the final version of the paper.
The lower bound of Case I only depends on the input/output requirements of the problem, and as such, it is problem-specific: it holds for any algorithm or parameter regime. In contrast, the lower bounds in Cases II-IV are indeed inherently specific to the algorithm (as shown e.g. in their dependence on r).
Finding universal (algorithmic-agnostic) lower bounds is rather challenging: depending on the approach and the accepted error, new methods might execute very different arithmetic operations (similarly to how the Alman-Song method multiplies entirely different matrices than classical attention). Due to this, the emergence of stronger universal lower bounds seems unlikely.
On the other hand, we believe that the proof strategies in our lower bounds are general ideas that can carry over to a wide range of potential attention algorithms. The tools in our S-partition-based proofs (case separation based on the I/O steps per row, restriction to specific sub-matrices, etc.) are natural techniques to prove lower bounds for different variants of matrix multiplication. While new algorithms to compute (exact or approximate) Attention may emerge in the future, even the more exotic ones will likely reduce to some form of matrix multiplication problems, e.g. on specially generated or sparse matrices. As such, we believe that the impact of these proofs may extend well beyond the analysis of the Alman-Song algorithm.
Besides this, the work by Aliakbarpour et al. mentioned above is another great example, showing that while some of our lower bounds are developed for the Alman-Song method, they might naturally generalize to several similar algorithms.
Q3. Can the authors provide some simple empirical validations to show the advantages of the algorithm?
We would be delighted to provide experimental evaluations to demonstrate realistic cases where the algorithm is competitive. The algorithm is unfortunately rather impractical and at the current stage the results are purely theoretical. The main source of the "impracticality" arises due to the combinatorial explosion of the parameter r=(gd+g) in the algorithm of Alman and Song. For the algorithm to be competitive, the context length n needs to be larger than r. For some idealistic values d=64 and g=20, r is in the order of 1019, which is still much larger than typical context lengths.
Even if there were concrete parameter regimes where the algorithm is competitive, we would certainly not be able to beat FlashAttention in experiments during the rebuttal period. FlashAttention has been optimized for years, and the optimizations go way beyond trivial tiling techniques (architecture-specific optimizations, and so on). It would take months to arrive to a concrete "high-performance" implementation to provide any meaningful comparisons.
The best that we can do for now is to provide some insights on which parts of our analysis can be beneficial for practical purposes. For example, it is well-known that, in many deep learning applications, very coarse approximations are often sufficient. We may not need to satisfy the very strict element-wise approximation guarantees that the algorithm exhibits: it might be very well the case that g=10 is enough, leading to manageable values of r and entering the "realistic" parameter regimes.
Another implication of our work would be to inspire and guide the more thorough I/O-analysis of other (more practical) approximate attention algorithms. For example, the HyperAttention algorithm of Han et al (citation [14]) has much weaker approximation guarantees than the algorithms discussed here, but HyperAttention is very competitive in practice. Can we significantly reduce the I/O complexity of HyperAttention? This is a very intriguing question that merits a dedicated study, and might be significantly influenced by our proofs and techniques.