TL;DR
Fully Product-Stereographic Transformer (FPS-T) generalizes the Transformer architecture to operate entirely over product spaces of constant, learnable curvatures (hyperbolic, spherical, and Euclidean). Combined with graph tokenization and a novel kernelized non-Euclidean attention mechanism, FPS-T achieves linear computational complexity while embedding complex graph topologies far more effectively than Euclidean models.
What Problem Does This Paper Address?
Graph-structured data frequently contains complex structural patterns: hierarchies and trees embed best in hyperbolic spaces ($\kappa < 0$), cyclic structures fit spherical spaces ($\kappa > 0$), and flat structures belong in Euclidean spaces ($\kappa = 0$). While geometric Graph Neural Networks (GNNs) have been developed to handle non-Euclidean spaces, they rely on local message-passing. Consequently, they inherit well-known failure modes such as oversmoothing (node representations collapsing at depth) and oversquashing (information bottlenecks over long-range dependencies), rendering them fragile on heterophilic graphs (graphs where connected nodes often have different labels).
Graph Transformers address these bottlenecks via global self-attention across all nodes and edges. However, existing graph Transformers are strictly Euclidean, requiring high dimensions to capture non-Euclidean structures. FPS-T resolves this dilemma by merging global attention with mixed-curvature geometric priors.
Methods
FPS-T generalizes every fundamental building block of the standard Transformer into the stereographic model—a Riemannian formulation where geometric operations are smoothly differentiable across all real curvatures $\kappa \in \mathbb{R}$:
- Multi-Head Mixed-Curvature Attention: Each attention head $h$ is assigned a stereographic space with its own learnable curvature $\kappa_h$. Values reside directly on the manifold, while Queries and Keys are treated as tangent vectors. By parallel-transporting Query and Key vectors to the origin, attention weights are computed via Euclidean dot-products (since the metric tensor at the origin simplifies to $4I$). Values are then aggregated using the non-Euclidean Einstein midpoint.
- Stereographic Network Components: Linear mappings, layer normalization, activations, and classification logit layers are adapted via exponential and logarithmic maps. Representations move between layers with different curvatures by mapping through a shared tangent space at the origin.
- End-to-End Curvature Learning: All curvatures are initialized to $\kappa = 0$ (Euclidean) and learned via gradient descent, removing the need for manual hyperparameter grid searches over manifold combinations.
- Graph Tokenization & Cost Linearization: Adapting the TokenGT framework, nodes and edges are treated as individual sequence tokens. To overcome the quadratic cost $\mathcal{O}((N+M)^2)$ on sequence length, the authors derive a kernelized approximation for stereographic attention using $\phi(X) = \text{ELU}(X) + 1$, reducing time and memory complexity to linear $\mathcal{O}(N+M)$.
Datasets
The authors evaluate FPS-T across several synthetic and real-world benchmarks:
- Synthetic Graph Reconstruction: Trees ($\mathbb{H}$), Spheres ($\mathbb{S}$), Tori ($\mathbb{S} \times \mathbb{S}$), and Ring of Trees ($\mathbb{S} \times \mathbb{H}$).
- Real-World Graph Reconstruction: Four networks with varying average sectional curvatures:
WEB-EDU($\kappa \approx -0.63$),POWER($\kappa \approx -0.28$),FACEBOOK($\kappa \approx -0.08$), andBIO-WORM($\kappa \approx -0.03$). - Node Classification: Eight datasets spanning a wide spectrum of homophily $\mathcal{H}(G)$ (0.11 to 0.81):
- Heterophilic / Low-homophily:
TEXAS,CORNELL,WISCONSIN, andACTOR. - Homophilic / High-homophily:
AIRPORT,CITESEER,PUBMED, andCORA.
Key Insights and Ideas
- Geometry Emerges Automatically: Initialized as flat Euclidean spaces ($\kappa=0$), attention heads smoothly diverge to match the intrinsic topology of the data. For instance, on a synthetic Ring of Trees graph, a two-head FPS-T converged to one positive curvature ($\kappa_1 = +0.32$) and one negative curvature ($\kappa_2 = -3.31$), exactly mirroring $\mathbb{S} \times \mathbb{H}$.
- Global Attention Rescues Non-Euclidean GNNs on Heterophilic Graphs: Message-passing geometric GNNs regularly underperform a basic MLP on heterophilic datasets because local neighbor aggregation propagates noisy labels. Global attention sidesteps local bottlenecks, allowing FPS-T to significantly outperform both Euclidean Transformers and geometric GCNs.
- Extreme Parameter Efficiency: By leveraging appropriate curvatures, low-dimensional non-Euclidean spaces match or exceed the representation capacity of higher-dimensional Euclidean spaces.
Key Results
- Synthetic Reconstruction: FPS-T reduced distortion by orders of magnitude compared to Euclidean TokenGT (e.g., Tree distortion dropped from $0.0436$ to $0.0007$; Ring of Trees dropped from $0.0555$ to $0.0163$).
- Real-World Reconstruction: On
WEB-EDU, FPS-T achieved a 99.10% mAP, representing a $10.5\%$ improvement over TokenGT ($89.45\%$) and outperforming all GNN baselines. Furthermore, an FPS-T model with half the latent dimension ($d=8$) outperformed a full-sized Euclidean TokenGT ($d=16$). - Node Classification: FPS-T achieved the highest accuracy on 6 out of 8 benchmarks, holding the best average rank ($1.75$ vs. $2.50$ for TokenGT and $\ge 4.38$ for all message-passing baselines). On the heterophilic
ACTORdataset, FPS-T scored 39.61%, an 8.3% relative improvement over TokenGT ($36.59\%$).
Limitations and Future Work
- Constant Sectional Curvatures: Curvature is currently constant per attention head. Extending the model to heterogeneous manifolds with input-dependent (varying) sectional curvatures remains open.
- Numerical Stability: Riemannian operations under finite floating-point precision can encounter numerical instability, requiring further optimization.
- Domain Scope: The current empirical study focuses on graphs; extending mixed-curvature Transformers to other domains like natural language processing (NLP) and computer vision (CV) is highlighted as promising future work.
Summary updated