△ Mechanism confirmed, baseline not beaten 2026

Biclique-free hierarchical attention

Implementation & benchmark of arXiv:2608.25464 — Almost-linear Zarankiewicz bounds in $1$-semi-equational theories

Usefulness6/10
Difficulty6/10
Novelty6/10

Source paper: Almost-linear Zarankiewicz bounds in $1$-semi-equational theories arXiv:2608.25464 ⓘ · analyzed Aug 29, 2026

AI-generated research hypothesis, automatically tested. Not peer-reviewed.

Idea description

Replace dense token-to-token attention by a learned binary relation generated from a small number of hierarchical predicates, while rejecting masks that contain a fixed K_{t,t} biclique. The paper's incidence bound predicts near-linear active edges for these structured relations, giving sparse attention with a measurable worst-case complexity target rather than relying only on average sparsity.

Formulas

$$|E|=O_{k,t,m}\!\left(n\bigl(1+\log(1+n)\bigr)^{(m-1)(k-1)}\right),\qquad n=|V|+|W|,$$
$$E=\left\{(a,b)\in V\times W:\Psi\left(\mathbf 1_{\phi_1(a;b)},\ldots,\mathbf 1_{\phi_m(a;b)}\right)=1\right\},\qquad K_{t,t}\nsubseteq E,$$
$$A_{ij}=\mathbf 1\!\left[\Psi\left(p_1(q_i,k_j),\ldots,p_m(q_i,k_j)\right)=1\right],\qquad \operatorname{Attention}(Q,K,V)_i=\sum_{j:A_{ij}=1}\operatorname{softmax}_{j}\!\left(\frac{q_i k_j^{\top}}{\sqrt d}\right)v_j.$$

Mathematical statement

The main bipartite result states that if \(\phi_1(x;y),\ldots,\phi_m(x;y)\) are \((k,1)\)-semi-equations and \(\Psi:\{0,1\}^m\to\{0,1\}\) combines their truth values, then for finite token sets \(V,W\), with \(n=|V|+|W|\), the relation \(E=\{(a,b)\in V\times W:\Psi(\mathbf 1_{\phi_1(a;b)},\ldots,\mathbf 1_{\phi_m(a;b)})=1\}\) satisfies \(|E|=O_{k,t,m}(n(1+\log(1+n))^{(m-1)(k-1)})\) whenever it is \(K_{t,t}\)-free. Here \(K_{t,t}\) is the complete bipartite graph with \(t\) query-side vertices and \(t\) key-side vertices, and \(k,m,t\) are fixed constants. The transferable property is that structured predicate combinations plus biclique exclusion prevent quadratic edge growth. In the neural adaptation, \(\phi_i\) are binary hierarchical or bucket predicates on query/key representations, \(\Psi\) is a Boolean routing rule, and the mask is additionally repaired to eliminate sampled \(K_{t,t}\) patterns. The theorem is used as a complexity hypothesis: if the learned predicates empirically satisfy the required laminar-like structure and the mask is \(K_{t,t}\)-free, active edges should scale approximately as \(n\operatorname{polylog}(n)\).

Implementation notes

Integrate this into a Transformer self-attention block before the softmax. For every token, compute query and key vectors \(q_i,k_j\), plus \(m\) cheap binary predicates \(p_l(q_i,k_j)\). Start with predicates that are implementable by hierarchical buckets: shared coarse cluster, shared tree ancestor at depth \(d\), same local window, or a learned product-quantization code match. Define \(\Psi\) as a small Boolean circuit, for example OR over selected predicate conjunctions. Construct candidate edges \((i,j)\) from inverted bucket indices rather than materializing all \(n^2\) pairs. Before attention, enforce the biclique constraint with a greedy repair: maintain key-neighborhood bitsets for query nodes; when adding an edge \((i,j)\), reject it if there already exist \(t-1\) other queries sharing at least \(t-1\) common keys with \(i\) and \(j\). Use \(t=2\) or \(3\) initially, since exact biclique detection is expensive for larger values. Run sparse softmax only on retained edges and add a fixed number of global landmark tokens so information can still propagate. The mathematical quantity computed exactly is the edge count \(|E|\); the theorem's exponent \((m-1)(k-1)\) is a predicted scaling law, while predicate laminarity and biclique-freeness must be checked empirically by sampling neighborhoods and searching for small bicliques. First experiment on a 2-layer GPT-style model trained on WikiText-103 or C4 using 1K-token contexts. Compare dense attention, local-window attention, and the proposed mask at equal hidden size. Measure active edges, attention FLOPs, peak memory, validation perplexity, and perplexity versus sequence length. Success is at least 4x fewer attention edges and subquadratic growth with less than 1% relative perplexity degradation.

Verification

Mechanism confirmed, baseline not beaten

Stage 1 · Toy mechanism gate: Passed ✓

Stage 2 · Mechanism transferred to benchmark: Confirmed ✓

Stage 2 · Practical benchmark result: Inconclusive

Methodology: 8 paired seeds, permutation test (p<0.05) against a learning-rate-tuned baseline. How verification works

Stage 1 — Mechanism check agent confidence 8/10

Built dyadic hierarchical-bucket attention with inverted-index candidate generation and greedy K_{2,2} repair. The checks showed exact K_{2,2}-freeness, exhaustive detector agreement on all 3x3 bipartite graphs, and linear edge growth with log-log slope 1.0 versus dense quadratic growth with slope 2.0. At n=256 the repaired mask used 504 edges versus 65,536 dense and 3,784 local edges, but random-feature attention differed substantially from dense attention; language-model quality was not tested.

Agent confidence
8/10
Baseline
Dense: 65,536 edges at n=256; growth slope 2.000; Python attention time 0.03539 s/call.
Idea
Hierarchical plus greedy K_{2,2}-free repair: 504 edges at n=256, 130.0x fewer than dense and 7.51x fewer than local; growth slope 1.000; Python attention time 0.01389 s/call; maximum shared keys 1; relative dense-output error 8.516.

Limitations: This is a synthetic NumPy toy experiment, not a trained Transformer or WikiText/C4 perplexity evaluation. The hierarchy is fixed rather than learned, the greedy repair is not asymptotically optimized, and runtime uses an unvectorized Python sparse-attention implementation rather than a production GPU kernel.

How to run: python3 experiment.py

Stage 2 — Benchmark vs. tuned baseline (arXiv:2608.25464)

Ahead of the baseline (−1.7%) but not statistically significant (p=0.5718, wins 4 / 8 paired seeds).

Benchmark
Sequence modeling
Model
transformer_tiny
Paired seeds
8
Baseline mean
0.4825
Idea mean
0.4745
Effect (Δ)
-0.008 (−1.7%; negative = idea better)
Wins
4 / 8 paired seeds
p-value
0.5718 (permutation test, 20 000 shuffles)
Smallest detectable effect
±6.3%
Mechanism
Confirmed ✓
Practical effect
Inconclusive
Baseline tuning
swept over 3 configs
Limitations:

The benchmark used the built-in 400-training/200-test sequence subset and 10 epochs, rather than long-context language modeling. The mask was fixed from token positions rather than learned from representations, and the reported edge-scaling exponent was based on the fixed 32-token construction rather than a multi-length trained-model sweep. Wall-clock sparse-kernel speed and KV-cache behavior were not measured.

How to run: python3 bench_experiment.py

Verdict computed by deterministic test code from paired-seed statistics — not by the language model.

Stage 2 — Benchmark latest Failed ✗

Agent confidence: 9/10

Built a local biclique-free hierarchical-attention Transformer and evaluated it against the identical dense Transformer on the structurally matched sequence track. The idea reduced attention edges from 1024 to 94 (10.89x reduction) and maintained observed maximum shared keys of 1, but test MSE improved only from 0.48255 to 0.47450 (paired delta -0.00805) with permutation p=0.57185, so there was no significant neural-training win.

Baseline
8-seed dense transformer: mean test MSE 0.4825485, std 0.0335456; best lr=0.001, epochs=10; 1024 attention edges.
Idea
8-seed biclique-free hierarchical mask: mean test MSE 0.4744987, std 0.0526747; best lr=0.001, epochs=10; 94 active edges, 10.8936x fewer than dense; paired delta -0.0080498, p=0.57185.

Benchmark result

Ahead of the baseline (−1.7%) but not statistically significant (p=0.5718, wins 4 / 8 paired seeds).

Benchmark
Sequence modeling
Model
transformer_tiny
Paired seeds
8
Baseline mean
0.4825
Idea mean
0.4745
Effect (Δ)
-0.008 (−1.7%; negative = idea better)
Wins
4 / 8 paired seeds
p-value
0.5718 (permutation test, 20 000 shuffles)
Smallest detectable effect
±6.3%
Mechanism
Confirmed ✓
Practical effect
Inconclusive
Baseline tuning
swept over 3 configs
Limitations:

The benchmark used the built-in 400-training/200-test sequence subset and 10 epochs, rather than long-context language modeling. The mask was fixed from token positions rather than learned from representations, and the reported edge-scaling exponent was based on the fixed 32-token construction rather than a multi-length trained-model sweep. Wall-clock sparse-kernel speed and KV-cache behavior were not measured.

How to run: python3 bench_experiment.py

Artifacts

Implementation overview ⬇ Download all as ZIP 6 files · code, reports and structured results