Alphabeta Math
TheoremStatement: Literature-sourcedProof: AI-generatedPipeline-generatedprecheck passjudge pass (gpt-6-luna)
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 O(1), the forward and reverse procedures of the exact tiled softmax attention algorithm use O(n2(d+v)) arithmetic operations. The forward procedure retains the Q,K,V inputs, the n×v output, and two scalar statistics per query, requiring O(n(d+v)) stored input and output scalars, with at most O(b+v) additional live scalars for one block's scores and weighted-value summary. The reverse procedure additionally takes G and returns dQ,dK,dV; counting these as input and output arrays, it also uses O(n(d+v)) stored input and output scalars and at most O(b+v) additional live scalars. Neither procedure materializes an n×n 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 O(n2) 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.

Facts & Assumptions

Given: The positive integers n,d,v,b, fixed allowed-key sets, and the two procedures of the exact tiled softmax attention algorithm.

[F1]

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.

[F2]

Stable summary of an attention key block: a nonempty block summary stores one scalar maximum, one scalar normalizer, and one vector in Rv; an empty block stores no numeric state.

[F3]

Tiled attention and its recomputed reverse pass are exact: the two procedures return the dense masked attention and its exact vector-Jacobian product.

[F4]

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.

[A1]

The mask membership accessor is read-only, has O(1) query cost, and any storage for its representation is caller-owned input storage rather than algorithmic scratch.

[A2]

The operation count is scalar arithmetic, exponential evaluation, comparisons, and mask membership queries; all are unit cost in this model.

Proof

technique · count the live arrays, block workspace, and operations in the explicit loops
1.1F1F2A1givenalgebra

The forward procedure retains Q,K,V,Y and (mi,ℓi)i=1n. Their scalar counts are nd+nd+nv+nv+2n=O(n(d+v)) because d,v≥1. At any query and key block it stores at most b scores and the current and block weighted-value vectors of length v, plus a constant number of scalars. This is O(b+v) extra live storage, and it discards the block workspace before moving to the next block.

1.2F1F2A2givenalgebra

The forward loops examine at most n2 query-key pairs. For each pair, the score dot product uses O(d) operations; its normalized exponential and weighted-value contribution use O(1+v) operations. Block maxima, membership queries, and scalar loop overhead cost O(n2) in total. There are at most n⌈n/b⌉≤n2 block visits, each summary copy or merge costs O(v), and final row divisions cost O(nv). Thus forward arithmetic is O(n2(d+v)). Only one block's scores and weighted-value summaries are live, so no n×n score or probability array is allocated.

1.3F4A1givenalgebra

The reverse procedure's retained arrays are Q,K,V,Y,G,dQ,dK,dV and the 2n row statistics. Their scalar counts are all O(n(d+v)). 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 O(b+v). It does not store the recomputed probabilities across pairs.

2.1F3F4A2givenalgebra∎

Each query-key pair in the reverse pass costs O(d+v) operations: one score, one inner product with Vj, and vector updates with lengths d and v. There are at most n2 pairs, and the finite loop overhead is at most O(n2), so reverse arithmetic is O(n2(d+v)). Since scores and probabilities are recomputed one at a time, this pass also creates no n×n 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