Spectral-gap local mixing
Implementation & benchmark of arXiv:2608.26906 — Waveguiding in systems of high contrast resonators: Theory and fast computations
Source paper: Waveguiding in systems of high contrast resonators: Theory and fast computations arXiv:2608.26906 ⓘ · analyzed Aug 29, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Replace a dense graph-attention or token-mixing matrix by a resolvent-like interaction operator and truncate it to graph neighborhoods whose radius is selected from an estimated spectral gap. Unlike fixed-window sparse attention, the sparsity level is tied to a measurable stability parameter and has an explicit exponential tail criterion.
Formulas
Mathematical statement
The paper uses the exterior spectral-gap condition $$\inf_{\alpha\in\widetilde{Y}^{*}}\operatorname{dist}\Big(\frac{\omega_{0}^{2}}{v^{2}},\sigma(-\Delta_{\alpha,\mathrm{Dir}};\widetilde{\Omega}_{\mathrm{line}})\Big)>0,$$ where $\omega_{0}$ is the reference frequency, $v$ is the exterior wave speed, $\alpha$ is a quasi-periodic Bloch parameter, $\sigma(\cdot)$ is the Dirichlet spectrum, and $\widetilde{\Omega}_{\mathrm{line}}$ is the exterior line-defect domain. Under this uniform separation, the compressed capacitance operator $\mathcal{C}(\omega_{0})$ has exponentially decaying coefficients; write the transferable consequence as $|\mathcal{C}_{ij}(\omega_{0})|\leq C_{0}e^{-\mu d(i,j)}$, where $i,j$ index resonant sites, $d(i,j)$ is graph distance, $C_{0}$ is a prefactor, and $\mu>0$ depends on the spectral separation. Truncating at radius $R$ gives the tail bound $\|\mathcal{C}(\omega_{0})-\mathcal{C}^{(R)}(\omega_{0})\|\lesssim C_{1}e^{-\mu R}$, where $C_{1}$ also absorbs graph growth. The neural adaptation treats a graph Laplacian $L$ as the exterior operator and uses the resolvent-like filter $K_{ au}=( au I+L)^{-1}$, with $ au>0$, as the mixing matrix.
Implementation notes
Integrate this at the token-mixing step of a graph transformer or vision model, after the value projection and before the MLP. Construct a sparse adjacency graph over tokens: use k-nearest neighbors for images or the physical graph edges for graph data. Let $L=D-A$ be the symmetric normalized or unnormalized graph Laplacian. For an MVP: (1) estimate the largest eigenvalue $\widehat{\lambda}_{\max}$ of $L$ with 10--20 power or Lanczos iterations; (2) choose a positive resolvent shift $\tau$; (3) set a conservative decay estimate $\widehat{\mu}=c\sqrt{\tau/(\widehat{\lambda}_{\max}+\tau)}$, with $c$ tuned on a validation split; (4) choose $R=\lceil\log(C_{1}/\varepsilon)/\widehat{\mu}\rceil$, where $\varepsilon$ is the permitted mixing error; (5) compute $Z\approx(\tau I+L)^{-1}V$ using a truncated Chebyshev polynomial or local iterative solve; and (6) apply the residual update $Y=\operatorname{LayerNorm}(X+\eta Z)$. Pseudocode is: L=D-A; lmax=power_iteration(L); mu=c*sqrt(tau/(lmax+tau)); R=ceil(log(C1/eps)/mu); mask=graph_distance<=R; Z=local_resolvent_solve(tau*I+L,V,mask); Y=LayerNorm(X+eta*Z). The paper-derived quantities are the spectral-gap-to-locality principle and the exponential truncation law; $\widehat{\mu}$ and $C_{1}$ are engineering proxies. On small graphs, estimate the true error by comparing the local result with a dense solve and fit $C_{1},\mu$ from a log-linear plot of error versus $R$. First test on CIFAR-10 using a six-layer ViT, comparing dense attention, fixed-window attention with equal edge count, and this adaptive layer at equal FLOPs. Success means at least 1.5x lower mixing cost, no loss spikes, validation accuracy within 0.5 percentage points of dense attention, and an approximately exponential decrease in measured operator error as $R$ increases.
Verification
Stage 1 · Toy mechanism gate: Passed ✓
Stage 2 · Mechanism transferred to benchmark: Confirmed ✓
Stage 2 · Practical benchmark result: Significant win ✓
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 and numerically verified a graph-resolvent local mixing MVP on cycle graphs. Measured truncation decay matched the exact exponential rate to numerical precision, the small-shift scaling exponent was 0.4969 versus the predicted 0.5, and the adaptive radius stayed below the 1e-3 operator-error target for all tested shifts. The adaptive method achieved 2.46x structural cost reduction at 5.35e-7 relative error, although practical wall-clock speed was not established because the prototype uses dense NumPy masked matrices.
- Agent confidence
- 9/10
- Baseline
- Dense resolvent: 25,600 structural entries and zero truncation error; fixed radius R=6: 2,080 entries, 12.31x structural reduction, relative error 0.0546.
- Idea
- Adaptive radius at tau=0.2: R=32, 10,400 entries, 2.46x structural reduction, relative error 5.35e-7; fitted-to-exact decay ratios were approximately 1.0 across all shifts; small-tau log-log slope was 0.4969 versus predicted 0.5.
Limitations: Only cycle-graph resolvents were tested; no CIFAR-10, graph transformer, learned parameters, validation accuracy, GPU implementation, true sparse-kernel benchmark, or irregular-graph spectral-gap estimation was evaluated. The conservative proxy radius was about 2x the radius obtained from the exact decay rate at tau=0.2.
How to run: python3 spectral_gap_local_mixing.py
Stage 2 — Benchmark vs. tuned baseline (arXiv:2608.26906)
Beats the tuned baseline by 29.3% (p=0.0081, wins 8 / 8 paired seeds; metric: lower is better).
- Benchmark
- Sequence modeling
- Model
- transformer_tiny
- Paired seeds
- 8
- Baseline mean
- 0.9203
- Idea mean
- 0.6502
- Effect (Δ)
- -0.2701 (−29.3%; negative = idea better)
- Wins
- 8 / 8 paired seeds
- p-value
- 0.0081 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- ±9.8%
- Mechanism
- Confirmed ✓
- Practical effect
- Helps
- Baseline tuning
- swept over 3 configs
Only the built-in sequence track was tested, using 400 training examples, 200 test examples, 12 epochs, and 32 tokens. No CIFAR-10, irregular graph, large transformer, learned/KNN graph, or true sparse-kernel wall-clock benchmark was tested.
How to run: python3 bench_spectral_gap.py
Verdict computed by deterministic test code from paired-seed statistics — not by the language model.
Stage 2 — Benchmark latest Worked ✓
Agent confidence: 8/10
The structurally matched sequence benchmark shows a significant win for spectral-gap local mixing: mean test MSE 0.650217 versus 0.920288 for tuned dense attention, with all 8 paired wins and permutation p=0.0081. The mechanism signature was also confirmed at 32-token scale, with observed decay rate 0.736780 versus predicted 0.693147. This is a small forecasting benchmark, so the result does not establish large-model or practical sparse-kernel speed gains.
- Baseline
- Dense attention; tuned lr=0.0015; mean MSE 0.920288, std 0.064178, per-seed [0.944131, 0.813517, 0.977725, 0.933876, 0.990902, 0.824132, 0.974821, 0.903201].
- Idea
- Local resolvent mixer; tuned idea config lr=0.0015, tau=0.25, eps=0.01, eta=0.5; mean MSE 0.650217, std 0.108490, per-seed [0.564416, 0.572530, 0.597854, 0.573143, 0.888212, 0.590781, 0.655600, 0.759201].
Benchmark result
Beats the tuned baseline by 29.3% (p=0.0081, wins 8 / 8 paired seeds; metric: lower is better).
- Benchmark
- Sequence modeling
- Model
- transformer_tiny
- Paired seeds
- 8
- Baseline mean
- 0.9203
- Idea mean
- 0.6502
- Effect (Δ)
- -0.2701 (−29.3%; negative = idea better)
- Wins
- 8 / 8 paired seeds
- p-value
- 0.0081 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- ±9.8%
- Mechanism
- Confirmed ✓
- Practical effect
- Helps
- Baseline tuning
- swept over 3 configs
Only the built-in sequence track was tested, using 400 training examples, 200 test examples, 12 epochs, and 32 tokens. No CIFAR-10, irregular graph, large transformer, learned/KNN graph, or true sparse-kernel wall-clock benchmark was tested.
How to run: python3 bench_spectral_gap.py
Artifacts
- REPORT.md 1.9 KB View
- bench_report.json 3.6 KB View Raw
- bench_spectral_gap.py 5.1 KB View Raw
- report.md 1.6 KB View
- report_bench_2026-08-30T142149.md 4.3 KB View
- results.json 2.6 KB View Raw
- spectral_gap_local_mixing.py 5.3 KB View Raw