Unverified 2026

Regular Linear Hypergraph Attention

Implementation & benchmark of arXiv:2607.16854 — Linear Turán Numbers of Uniform Hypertrees

Usefulness6/10
Difficulty5/10
Novelty6/10

Source paper: Linear Turán Numbers of Uniform Hypertrees arXiv:2607.16854 ⓘ · analyzed Aug 30, 2026

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

Idea description

Construct attention groups as hyperedges of a linear r-uniform hypergraph: every pair of tokens is allowed to share at most one group, while each token participates in approximately the same number of groups. Apply local attention inside each group and aggregate the outputs across groups. The construction inherits the paper's sharp capacity bound and prevents both redundant pair interactions and high-degree token hubs.

Formulas

$$\operatorname{ex}^{\mathrm{lin}}_{r}(n,S_{k}^{r})\leq \frac{n(k-1)}{r}.$$
$$\sum_{v\in V}d(v)=r|E|,\qquad d(v)=k-1\ \forall v\ \Longrightarrow\ |E|=\frac{n(k-1)}{r}.$$
$$\forall e\neq f\in E:\ |e\cap f|\leq 1,\qquad \forall u\neq v\in V:\ |\{e\in E:u,v\in e\}|\leq 1.$$
$$\mathcal{L}(H)=\sum_{u<v}\max\left(0,\sum_{e\in E}M_{ue}M_{ve}-1\right)^2+\lambda_d\sum_{v\in V}(d(v)-q)^2.$$

Mathematical statement

A linear r-uniform hypergraph H=(V,E) has |V|=n vertices, hyperedges E each containing exactly r vertices, and every unordered pair of vertices belongs to at most one hyperedge. The r-uniform star S_k^r consists of k hyperedges sharing a common vertex. Theorem 1 gives ex_r^lin(n,S_k^r) <= n(k-1)/r, where ex_r^lin is the maximum number of hyperedges in an n-vertex linear r-uniform hypergraph avoiding S_k^r. Equality holds precisely for a (k-1)-regular linear r-uniform hypergraph, meaning every vertex v has degree d(v)=k-1. Since each hyperedge contributes r incidences, sum_v d(v)=r|E|, so regularity gives |E|=n(k-1)/r. We use this as an architectural design rule: with group size r and per-token group degree q=k-1, create at most nq/r local-attention groups, with no pair repeated across groups.

Implementation notes

Integrate this into a transformer attention block by replacing one dense self-attention head with hypergraph group attention. Let the sequence length be n, choose group size r, for example 8 or 16, and choose target token degree q, for example 2 or 4. Store an incidence matrix M in {0,1}^{n x m}, where M[v,e]=1 means token v belongs to group e; require each column to contain r ones, each row to contain q ones, and m=nq/r. At initialization, generate groups using a randomized greedy procedure: repeatedly sample an r-subset whose every pair has not appeared before, reject candidates that exceed degree q, and restart or use exact-cover/backtracking repair if construction stalls. For each group e, gather Q,K,V for its r tokens, compute softmax(Q_e K_e^T/sqrt(d)), and scatter-add the result back to the participating tokens; divide by q or apply a learned degree-normalized gate. During a learned-routing variant, produce token embeddings z_v, score candidate groups with a small router, and use a straight-through top-r assignment while adding the displayed linearity and degree penalties. The exact mathematical constraint is the pairwise co-occurrence condition; the penalty is an engineering relaxation for dynamic groups. Measure actual attention edges, peak activation memory, wall-clock time, and validation loss against dense attention and block-sparse attention at equal model width. First test on a 6-layer 256-token toy transformer trained on CIFAR-10 patches or a small language corpus, using r=8 and q=2. Success means approximately O(nrq) rather than O(n^2) score computation, no pair-overlap violations in fixed routing, lower peak memory, and equal or better validation loss at matched FLOPs.

Verification

This idea has not been verified yet.

Verification happens in two stages: Stage 1 — a mechanism check on a toy system confirms the claimed mathematical phenomenon reproduces; Stage 2 — a benchmark implements the idea on a real (small) neural network task and compares it against a tuned baseline over 8 paired seeds with a permutation test.

Artifacts

Artifacts unavailable.