cs.LGOct 1, 2026

Let the Heads Talk: Beyond Diagonal Graph Attention

Authors: Riccardo Ali, Alessio Borgi, Mario Severino, Alessio Gravina, Davide Bacciu, Pietro Liò, Christopher Irwin

Organizations: Department of Computer Science and Technology, University of Cambridge · Department of Computer, Control and Management Engineering, Sapienza University of Rome · Department of Information Engineering, University of Padua · Department of Computer Science, University of Pisa

Abstract

Sheaf Neural Networks generalize scalar-weighted message passing by replacing scalar edge weights with linear transport maps between local feature spaces. Yet the role of this matrix-valued transport is entangled with the broader sheaf-diffusion construction. We isolate the transport primitive through quiver representations and establish a direct connection with multi-head attention. Treating attention heads as coordinates of a local transport space reveals that standard multi-head attention implements diagonal edge maps: along each directed interaction, a source head can contribute only to the corresponding receiver head. Allowing off-diagonal entries instead enables edge-conditioned communication across heads before neighborhood aggregation. We show that this operation cannot, in general, be absorbed into a single shared linear map applied after aggregation. Building on this characterization, we introduce Topological Attention (Top-A), a multi-head attention that learns edge-dependent off-diagonal routes while preserving the original same-head paths and exactly recovering vanilla attention when the additional routing vanishes. We evaluate Top-A on relational reasoning, heterogeneous graph learning, and algorithmic reasoning, including out-of-distribution generalization, with heterophilic node classification as a contrast setting. The results show that cross-head transport is most useful when the task benefits from interaction-dependent transformations, while heterophily alone provides no systematic advantage. These findings identify edge-conditioned cross-head communication as a distinct computational primitive of matrix-valued transport.

Explore similar work

Aug 4, 2026cs.LG

Provably Learning Multi-Head Attention with Queries

We study the problem of learning multi-head softmax attention from black-box input-output access. The learner may query arbitrary real-valued token sequences and observe only the scalar output at the final token. Recent work gives an algorithm using O(d2)O(d^2) value queries to recover the single-head parameters (W,v)(W,v). For multiple heads, the same work establishes identifiability under the assumption that the heads occupy pairwise orthogonal subspaces. Applying the single-head recovery algorithm separately to the heads additionally requires bases for these subspaces to be known. We recover a canonical representation by merging heads with the same WhW_h, summing their corresponding vhv_h, and discarding a merged head when this sum is zero, without these subspace assumptions. By varying the number of copies of a token, our algorithm obtains samples of a rational function whose interpolation separates the canonical heads. Additional queries formed by adding selected token vectors then match the same head across different queries. When the oracle outputs and all subsequent computations are exact, the learner chooses its query vectors at random and recovers the canonical pairs {(Wh,vh):h∈[H]}\{(W_h,v_h):h\in[H]\} up to permutation with probability one. When HH is known, it uses exactly 4Hd2−2H+14Hd^2-2H+1 value queries of maximum length 2H+12H+1. If only a known upper bound H0H_0 is available, the algorithm uses 4H0d2−2H0+14H_0d^2-2H_0+1 value queries of maximum length 2H0+12H_0+1. For approximate oracle outputs, we give conditions under which the parameter error is at most a model- and query-dependent constant multiple of the output error. Finally, we extend our result to a one-layer Transformer with multi-head attention followed by a bias-free ReLU feed-forward network. Under additional conditions, we recover a functionally equivalent Transformer without relying on a separate algorithm for learning the feed-forward network.
Aug 3, 2026cs.LG

When Should Graph Attention Be Sparse? Learning a Per-Edge Tsallis Index

Graph attention normalizes neighborhood scores with softmax, the maximum-entropy choice under Shannon statistics. But homophilic and heterophilic graphs want different attention shapes, and one fixed normalization cannot serve both. We propose \textbf{LTGA} (\textbf{L}earnable \textbf{T}sallis \textbf{G}raph \textbf{A}ttention), a graph attention layer whose Tsallis entropic index qq is learned jointly with the weights, interpolating continuously between heavy-tailed (q ⁣< ⁣1q\!<\!1), softmax (q ⁣= ⁣1q\!=\!1) and compact-support (q ⁣> ⁣1q\!>\!1) attention at four granularities from a global scalar to a per-edge index, under a bounded reparameterization that starts every model at the GAT baseline. Across eight benchmarks at ten seeds, LTGA-Edge takes the best average rank (2.752.75), but the omnibus test does not reject (p ⁣= ⁣0.199p\!=\!0.199) and learning qq does not beat searching it: a validation-tuned frozen grid reaches 61.4%61.4\%, tuned αα-entmax 62.2%62.2\% and a capacity-matched q ⁣≡ ⁣1q\!\equiv\!1 control 62.0%62.0\%, against 61.7%61.7\% for LTGA-Edge. What the learned index buys is one run instead of a grid, and an interpretable mechanism: where qq leaves 11, it prunes 42%42\% of attention coefficients to exactly zero, and those edges are selectively the wrong ones, restoring them costs 7.17.1 points, while random pruning at the same rate costs 13.013.0 more. Project page: https://kleyt0n.github.io/ltga
May 6, 2026cs.LG

Self-Attention as Transport: Limits of Symmetric Spectral Diagnostics

When a language model processes a hallucinated response, its attention routing tends to fail in one of two shapes: over-concentrating on a narrow set of positions, or spreading so diffusely that relevance is diluted, and the shape of the failure carries diagnostic signal. We study these shapes as a diagnostic characterization, computed from attention matrices under \emph{forced scoring} of benchmark-labeled responses rather than during live generation. A widely used family of spectral methods analyzes the symmetric component of the degree-normalized attention operator, which governs transport \emph{capacity}; we prove that every transpose-invariant spectral diagnostic of this operator is structurally \emph{orientation-blind} (it cannot distinguish an operator from its transpose, and therefore cannot detect information-flow direction), with a converse to the blindness theorem bounding any Lipschitz diagnostic's transpose sensitivity by the asymmetry coefficient GG. Pairing this with a closed-form bipartite-Cheeger landscape for canonical causal architectures, we show that uniform causal attention satisfies an nn-independent floor φ≥1/5φ\ge 1/5, while window attention pierces the floor as O(w/n)O(w/n); failure modes are shape-different, not just value-different. This floor is an idealized-architecture benchmark, not an empirical attractor: the fraction of real attention heads that pierce it is itself an architectural signature. The resulting two-axis diagnostic (φφ for capacity, GG for direction) yields a falsifiable polarity prediction: bottleneck- and diffuse-dominated benchmarks should exhibit opposite polarity. Under length-controlled evaluation, transport features retain interpretable signal (0.62-0.84 LC-AUROC) across the tested decoder-only, encoder-only, and encoder-decoder models, with polarity reversing as predicted between HaluEval and MedHallu.