How statement and proof provenance work
The first chip identifies the source of the statement or construction; the second identifies the source of its local proof or verification.
- Literature-sourced: the exact statement appears in a cited source; only wording and notation differ.
- AI-adapted: a semantically identical restatement of literature-sourced material, modulo indexing, notation, and boundary cases adopted by the library.
- AI-generated: a genuinely novel statement formulated by AI, with no source for the claim itself.
These labels describe origin, not correctness: citations and verification chips remain separate evidence.
Tiled attention uses linear retained memory and quadratic arithmetic
Statement
In the unit-cost real-arithmetic model where scalar arithmetic, exponential evaluation, comparisons, and one allowed-key membership query each cost , the forward and reverse procedures of the exact tiled softmax attention algorithm use arithmetic operations. The forward procedure retains the inputs, the output, and two scalar statistics per query, requiring stored input and output scalars, with at most additional live scalars for one block's scores and weighted-value summary. The reverse procedure additionally takes and returns ; counting these as input and output arrays, it also uses stored input and output scalars and at most additional live scalars. Neither procedure materializes an score or probability array. Storage for a caller-owned mask representation is input storage and is not part of the additional workspace; if it is a dense array, its own entries must be counted separately. The exactness of the forward and reverse outputs is the assertion of the tiled-attention exactness theorem. No hardware I/O or floating-point operation count is asserted.
Statement references
Facts & Assumptions
Given: The positive integers , fixed allowed-key sets, and the two procedures of the exact tiled softmax attention algorithm.
Exact tiled softmax attention with block-recomputed vector-Jacobian products: the forward procedure processes one query row and one key block at a time, while the reverse procedure recomputes each permitted score and accumulates gradients into output arrays.
Stable summary of an attention key block: a nonempty block summary stores one scalar maximum, one scalar normalizer, and one vector in ; an empty block stores no numeric state.
Tiled attention and its recomputed reverse pass are exact: the two procedures return the dense masked attention and its exact vector-Jacobian product.
Exact tiled softmax attention with block-recomputed vector-Jacobian products: the reverse procedure recomputes each block's scores and does not store a full score or probability matrix.
The mask membership accessor is read-only, has query cost, and any storage for its representation is caller-owned input storage rather than algorithmic scratch.
The operation count is scalar arithmetic, exponential evaluation, comparisons, and mask membership queries; all are unit cost in this model.
Proof
The forward procedure retains and . Their scalar counts are because . At any query and key block it stores at most scores and the current and block weighted-value vectors of length , plus a constant number of scalars. This is extra live storage, and it discards the block workspace before moving to the next block.
The forward loops examine at most query-key pairs. For each pair, the score dot product uses operations; its normalized exponential and weighted-value contribution use operations. Block maxima, membership queries, and scalar loop overhead cost in total. There are at most block visits, each summary copy or merge costs , and final row divisions cost . Thus forward arithmetic is . Only one block's scores and weighted-value summaries are live, so no score or probability array is allocated.
The reverse procedure's retained arrays are and the row statistics. Their scalar counts are all . For one row and one key it recomputes one score and one probability, forms scalar inner products, and updates entries in the already allocated gradient arrays; it needs only a constant number of additional scalars, which is within . It does not store the recomputed probabilities across pairs.
Each query-key pair in the reverse pass costs operations: one score, one inner product with , and vector updates with lengths and . There are at most pairs, and the finite loop overhead is at most , so reverse arithmetic is . Since scores and probabilities are recomputed one at a time, this pass also creates no array. The separate exactness claim is supplied by [F3].
Depends on
Used by
Dependency tree · two levels
9 results within two dependency steps of this one, each drawn at its shortest distance from it. An arrow runs from a result to what uses it, so the chart reads left to right and ends at this result, which carries a heavier outline. Every node is a link to that result. Click elsewhere on the chart to enlarge it.
Sources
- Tri Dao et al., FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness, §3.1, Appendix B.2–B.4, and Appendix C (standard reference, not scraped)
- Maxim Milakov and Natalia Gimelshein, Online normalizer calculation for softmax, §3 (standard reference, not scraped)