Strongly-convex superwind attention
Implementation & benchmark of arXiv:2607.04452 — Superwind and navigation of least time on Riemannian manifolds
Source paper: Superwind and navigation of least time on Riemannian manifolds arXiv:2607.04452 ⓘ · analyzed Aug 29, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Use a learned asymmetric Finsler-like cost instead of the symmetric Euclidean distance in attention logits. The metric has a Riemannian quadratic part and a directional drift term, while a differentiable barrier enforces the strong-convexity condition derived for the paper's extended $(\alpha,\beta)$-metrics. This lets each attention head prefer one direction in feature space without producing pathological, non-convex distance landscapes.
Formulas
Mathematical statement
The paper's equation (44) contains the principal strong-convexity expression for an extended $(\alpha,\beta)$-metric: $\phi-s\phi_2+(b^2-s^2)\phi_{22}$. Here $\alpha(x,y)=\sqrt{h_{ij}(x)y^iy^j}$ is the Riemannian norm of tangent vector $y$, $\beta(x,y)=b_i(x)y^i$ is its directional projection onto covector $b$, $s=\beta/\alpha$, $b^2=h^{ij}b_i b_j$ is the squared dual norm of $b$, $\phi(s,b^2)$ is the scalar profile defining the Finsler metric, $\phi_2=\partial\phi/\partial s$, and $\phi_{22}=\partial^2\phi/\partial s^2$. The corresponding neural metric is $F_\theta(x,y)=\alpha_\theta(x,y)\phi_\theta(s_\theta(x,y),q_\theta(x))$, with $\alpha_\theta=\sqrt{y^\top H_\theta(x)y}$, $\beta_\theta=b_\theta(x)^\top y$, $s_\theta=\beta_\theta/\alpha_\theta$, and $q_\theta=b_\theta^\top H_\theta^{-1}b_\theta$. The paper's condition is used as a sampled positivity constraint $g_\theta=\phi_\theta-s_\theta\phi_{\theta,s}+(q_\theta-s_\theta^2)\phi_{\theta,ss}>\epsilon$; this is a sufficient practical safeguard for the principal curvature direction, but full validation should additionally check the numerical Hessian of $F_\theta^2/2$.
Implementation notes
(1) Integration point: modify the attention-logit computation in a standard Transformer head. For each query token $i$ and key token $j$, set $y_{ij}=q_i-k_j$. Give each head a positive diagonal matrix $H=\operatorname{diag}(\operatorname{softplus}(h)+10^{-4})$ and a learned drift vector $b$; optionally make $b$ a small linear projection of the query. Compute the asymmetric cost $F_\theta(y_{ij})$ and use $-F_\theta(y_{ij})^2/\tau$ as the logit. Implement $\phi_\theta(s,q)$ as a two-layer scalar MLP, initialized near $\phi(s,q)=1+0.1s$, with softplus output so the cost remains positive. (2) Pseudocode: H=softplus(h)+eps; y=Q[:, :, None, :]-K[:, None, :, :]; alpha=sqrt(sum(H*y*y,-1)+eps); beta=sum(b*y,-1); s=beta/alpha; q=sum(b*b/H); phi=phi_mlp(s,q); logits=-(alpha*phi)**2/tau + mask; attn=softmax(logits);. During training sample 32--128 $(x,y)$ pairs per batch, use autodiff to compute phi_s and phi_ss, form g=phi-s*phi_s+(q-s*s)*phi_ss, and add lambda_conv * mean(softplus(eps-g)**2) to the task loss. (3) Computed from the paper's mathematics: the $(\alpha,\beta)$ decomposition and the convexity expression $g$. Estimated empirically: the metric parameters $H,b,\phi$, the barrier weight, and whether $F^2/2$ has a positive Hessian. Every few hundred steps, finite-difference or autodiff-test the smallest eigenvalue of the Hessian of $0.5F(y)^2$ at random directions; reject or clip updates producing eigenvalues below $-10^{-4}$. (4) First experiment: train a 4-layer, 8-head Transformer on WikiText-2, comparing standard dot-product attention, unconstrained asymmetric attention, and this convexity-regularized version at equal parameter count. Measure validation perplexity, attention entropy, fraction of negative-curvature samples, gradient norm spikes, and loss variance. The expected signal is improved validation performance or head specialization over symmetric attention, while the convexity barrier prevents the instability seen in the unconstrained asymmetric baseline.
Verification
Stage 1 · Toy mechanism gate: Failed ✗
Stage 2 · Mechanism transferred to benchmark: Not tested
Stage 2 · Practical benchmark result: Not run
Methodology: Toy-system gate first; the benchmark stage runs only after a pass. How verification works
Stage 1 — Mechanism check agent confidence 8/10
Built a PyTorch MVP for asymmetric Finsler-style attention with diagonal positive H, learned drift b, scalar profile phi, convexity barrier, and Hessian sanity checks. The math check behaved as expected: phi=1+0.25s gave g approximately 1 and positive sampled Hessian minimum 0.694, while a deliberately nonconvex profile produced a negative minimum of -11.70. However, on the matched tiny synthetic next-token task, constrained metric attention did not beat standard dot attention: final loss was 0.01861 versus 0.01768, so the promised practical win was not observed.
- Agent confidence
- 8/10
- Baseline
- Dot attention: final loss 0.01768; last-20 mean 0.01968; loss std 0.00411; max gradient 0.934; attention entropy 0.748.
- Idea
- Constrained asymmetric metric: final loss 0.01861; last-20 mean 0.02085; loss std 0.00447; max gradient 0.949; negative-g fraction 0; attention entropy 0.000002.
Limitations: Only a tiny synthetic task and one random seed were tested; no WikiText-2, multi-head/deep Transformer, equal-parameter analysis, finite-difference Hessian sweep during training, or multi-seed statistical comparison was performed. The sampled Hessian evidence validates local behavior, not global Finsler strong convexity.
How to run: python3 experiment.py
Verdict computed by deterministic test code from paired-seed statistics — not by the language model.
Artifacts
- experiment.py 6.4 KB View Raw
- report.md 1.5 KB View
- results.json 1.0 KB View Raw