T-Robinson Hierarchical Attention
Implementation & benchmark of arXiv:2608.21248 — T-Robinson Spaces: Structure, Recognition, and Applications to Real Data
Source paper: T-Robinson Spaces: Structure, Recognition, and Applications to Real Data arXiv:2608.21248 ⓘ · analyzed Sep 1, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Replace flat all-pairs attention with attention neighborhoods induced by a compatible tree over tokens, patches, nodes, or retrieved items. Retain exact or approximate attention inside nearby tree subtrees and add a path-monotonicity regularizer so semantically distant endpoints are not more similar than intervening tree neighbors.
Formulas
Mathematical statement
The paper defines a T-Robinson dissimilarity space as one having a tree T with vertex set X such that every path P, ordered as x<y<z along that path, satisfies D(x,z) >= max{D(x,y),D(y,z)}. Here X is the set of neural items, D(x,y) is a symmetric nonnegative dissimilarity computed from embeddings, and T is a learned or periodically refreshed tree. For sampled ordered path triples, the exact violation is v(x,y,z)=[max(D_xy,D_yz)-D_xz]_+, where [a]_+=max(a,0). We minimize the average violation. The paper also defines the alpha-level graph G_alpha=(X,E_alpha), with xy in E_alpha iff D(x,y)<=alpha, and balls B_r(x)={z:D(x,z)<=r}; these give candidate local groups. We use tree distance d_T(i,j) and a tree neighborhood N_T(i) to sparsify attention.
Implementation notes
Integrate this into a Transformer self-attention layer over tokens or image patches. Every K training steps, construct a tree T over detached embeddings h_i from the current minibatch or a persistent memory bank. Define D_ij=||W h_i-W h_j||_2^2, first compute a k-nearest-neighbor graph, and run Kruskal on those candidate edges to obtain an approximate minimum-spanning tree. Define N_T(i) as the union of nodes within tree radius r of i, selected sibling subtrees, and optionally the top-m nearest items under D. Compute ordinary logits A_ij=q_i^T k_j/sqrt(d), add the bias -gamma d_T(i,j), and set logits outside N_T(i) to negative infinity. For the regularizer, sample tree paths, choose ordered triples x<y<z on each path, calculate D_xy, D_yz, and D_xz, and add lambda_TR times L_TR to the task loss. The exact transferred mathematics is the pathwise hinge violation; tree construction, refresh frequency, radius, and sampled-triple count are empirical approximations. First test on CIFAR-100 with ViT-S/4 and on a small language-model corpus, comparing dense attention, fixed local-window attention, and tree attention at equal hidden size. Measure validation accuracy or perplexity, attention FLOPs, peak memory, tree-refresh overhead, and the mean Robinson violation. Success means at least 1.5x lower attention memory or FLOPs at matched quality, with decreasing violations and no collapse into one branch.
Verification
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 9/10
Built an MVP with Kruskal MST construction, tree distances, Robinson path-violation computation, tree-radius sparse attention, and distance bias. The math checks confirmed zero violation for an exact line metric, exact hinge scaling after the predicted threshold with maximum error 0, exact radius-pair counting, and monotonically decreasing expected attended distance as gamma increased. In the toy denoising task, tree attention used 15.0% of dense attention pairs and improved MSE from 0.4991 to 0.2780; adding the distance bias improved it to 0.1941, providing a clear but synthetic signal.
- Agent confidence
- 9/10
- Baseline
- Dense attention: MSE 0.49907, 32.0 pairs/token, pair ratio 1.000
- Idea
- Tree-radius attention: MSE 0.27801, 4.8125 pairs/token, pair ratio 0.1504; tree attention plus gamma=0.5 bias: MSE 0.19407 at the same sparsity. Math checks: line violation 0; perturbation hinge maximum absolute error 0; radius pairs observed/predicted 154/154; expected tree distance decreased from 6.65 at gamma=0 to 0.0348 at gamma=4.
Limitations: The comparison uses synthetic line-structured data and a fixed line tree. Dynamic tree refresh, learned embeddings, sampled path regularization during training, CIFAR-100, language modeling, wall-clock speed, peak memory, and large-scale quality were not tested.
How to run: python3 tr_experiment.py
Stage 2 — Benchmark vs. tuned baseline (arXiv:2608.21248)
Ahead of the baseline (−9.6%) but not statistically significant (p=0.1923, wins 7 / 8 paired seeds).
- Benchmark
- Sequence modeling
- Model
- transformer_tiny
- Paired seeds
- 8
- Baseline mean
- 7.3591
- Idea mean
- 6.6508
- Effect (Δ)
- -0.7083 (−9.6%; negative = idea better)
- Wins
- 7 / 8 paired seeds
- p-value
- 0.1923 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- ±15.8%
- Mechanism
- Confirmed ✓
- Practical effect
- Inconclusive
- Baseline tuning
- swept over 3 configs
The workload was reduced to 1 epoch and 128 training/test samples per seed because Python-side per-batch MST construction exceeded the runtime budget. Wall-clock speed and peak memory were not measured, the path-violation regularizer was not added, and periodic refresh was not tested.
How to run: python3 bench_tr.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
Implemented T-Robinson tree-neighborhood attention on the structurally matched sequence forecast track with detached embedding MSTs, radius-2 masking, and tree-distance bias. The trained-model signature confirmed 15.17% attention pair usage and lower attended tree distance, but the MSE improvement was not statistically significant.
- Baseline
- Dense matched transformer, mean test MSE 7.3591 over 8 seeds, best lr=0.0015.
- Idea
- Tree attention, mean test MSE 6.6508 over 8 seeds, best lr=0.0015 and gamma=0.0; paired delta=-0.7083, 7/8 wins, permutation p=0.19225, pair ratio=0.1517.
Benchmark result
Ahead of the baseline (−9.6%) but not statistically significant (p=0.1923, wins 7 / 8 paired seeds).
- Benchmark
- Sequence modeling
- Model
- transformer_tiny
- Paired seeds
- 8
- Baseline mean
- 7.3591
- Idea mean
- 6.6508
- Effect (Δ)
- -0.7083 (−9.6%; negative = idea better)
- Wins
- 7 / 8 paired seeds
- p-value
- 0.1923 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- ±15.8%
- Mechanism
- Confirmed ✓
- Practical effect
- Inconclusive
- Baseline tuning
- swept over 3 configs
The workload was reduced to 1 epoch and 128 training/test samples per seed because Python-side per-batch MST construction exceeded the runtime budget. Wall-clock speed and peak memory were not measured, the path-violation regularizer was not added, and periodic refresh was not tested.
How to run: python3 bench_tr.py
Artifacts
- bench_report.json 3.2 KB View Raw
- bench_tr.py 8.6 KB View Raw
- report.md 1.5 KB View
- report_bench_2026-09-01T190307.md 4.6 KB View
- tr_experiment.py 4.8 KB View Raw