Hodge Laplacian Positional Encodings
- H-LAPE is a framework that constructs topology- and mesh-aware positional encodings using discrete exterior calculus and learnable Hodge-star operators.
- It replaces computationally expensive spectral decompositions with multi-head attention, enabling end-to-end learning of Laplace-type operators on vertices, edges, and faces.
- Empirical evaluations demonstrate significant speed gains and improved accuracy in mesh classification and segmentation compared to traditional spectral methods.
Hodge Laplacian Positional Encodings (H-LAPE) are a framework for constructing mesh- and topology-aware positional encodings within neural architectures, notably Transformers, by leveraging the algebraic structure of Discrete Exterior Calculus (DEC) and replacing costly spectral decompositions with learnable Hodge-star operators parameterized by multi-head attention. Originally instantiated in the HodgeFormer model, H-LAPE enables end-to-end, data-driven learning of discrete Laplace-type operators acting on vertices, edges, and faces of triangular meshes without the need for precomputed eigenvectors or heat kernel embeddings (Nousias et al., 1 Sep 2025).
1. Foundations in Discrete Exterior Calculus
Let denote a 2-dimensional oriented triangular mesh specified by its sets of vertices (, ), edges (, ), and faces (, ). DEC introduces spaces of discrete -forms:
- $0$-forms (vertex values)
- 0-forms 1 (edge values)
- 2-forms 3 (face values)
Key incidence matrices encode the mesh topology:
- Vertex-to-edge (signed) incidence: 4
- Edge-to-face incidence: 5
The construction of DEC further involves three discrete Hodge-star matrices 6, 7, 8, which are typically symmetric positive definite and implement metric-dependent isomorphisms between primal 9-forms and dual 0-forms. Using the incidence and Hodge-star matrices, the standard discrete Hodge–Laplacians for functions on vertices, edges, and faces are: 1 These operators (2) are central to the structure of H-LAPE.
2. Learning Hodge-Star Operators via Multi-Head Attention
H-LAPE, as realized by HodgeFormer, replaces conventional fixed Hodge-star matrices with data-driven, learnable versions constructed through multi-head attention mechanisms. At Transformer layer 3, input features are given as 4 (vertices), 5 (edges), and 6 (faces), with embedding dimension 7 (set to 8 in experiments) and 9 attention heads (0).
For each 1 (representing degree), the following projections are learned: 2 these yield 3, 4, 5, each split across 6 heads of dimension 7.
Sparse attention patterns are enforced: for each mesh element 8, a neighborhood 9 of size 0 is constructed by combining one-hop BFS connectivity with additional randomized links in a 4:1 ratio, promoting both locality and representational expressivity. Attention weights are computed as: 1 Each 2 is identified as a row-stochastic, nonnegative learned Hodge-star matrix 3; its inverse 4 is parameterized analogously with separate 5 weights.
3. Construction and Application of Learned Laplacians
Given the attention-induced Hodge-star matrices and their inverses, these are assembled into discrete operators according to the DEC formulas. At each layer, the learned Laplacians are computed as:
6
These learned Laplacians are then used as mesh-aware positional encodings: 7 Consequently, the conventional decoupling of positional encoding and self-attention in standard Transformer layers is replaced by a process where the learned Laplacian serves as both positional operator and aggregator, acting directly on value vectors.
Notably, all computations are performed without explicit eigenvector calculation or heat kernel evaluation; the entire mechanism is trainable end-to-end through attention.
4. Training Dynamics and Computational Considerations
All attention and feed-forward weights are initialized using standard Xavier/He initialization. No explicit regularization is imposed to enforce symmetry or positive-definiteness, with the row-wise softmax guaranteeing row-stochastic, nonnegative Hodge-star matrices.
The per-layer computational complexity is: 8 where 9 and the 0 cost derives from 1-sparse attention neighborhoods. This compares favorably to traditional methods that require 2 operations for computing 3 Laplacian eigenvectors on sparse 4 matrices. H-LAPE thereby provides significant efficiency gains in training and inference on large meshes.
5. Empirical Evaluation
HodgeFormer, implementing H-LAPE, was benchmarked on several standard mesh analysis tasks.
Mesh Classification
| Dataset | Classes | Meshes | HodgeFormer Accuracy |
|---|---|---|---|
| SHREC-11 | 30 | 600 | 98.7% |
| Cube Engraving | 22 | 4,381 | 95.3% |
Mesh Segmentation
| Dataset | Face-wise Accuracy |
|---|---|
| Human (simpl.) | 90.3% |
| COSEG (Vase) | 94.3% |
| COSEG (Chair) | 98.8% |
| COSEG (Alien) | 98.3% |
Ablation studies reveal that substituting the HodgeFormer layer with a vanilla Transformer (identical embedding) results in a 4–5% performance decrease. "Neighbor-aware embedding" improves convergence rates. Varying sparse attention neighborhoods shows that local-only configurations are insufficient, with optimal results at 5 neighbors. On Human segmentation, HodgeFormer trains an epoch in 17.6 seconds versus Laplacian2Mesh’s 641 seconds (RTX 4090), and inferences in 1.97 s/mesh versus 2.96 s.
6. Distinctive Properties and Significance
H-LAPE enables topology- and geometry-sensitive positional encodings in neural mesh operators by learning the metric (Hodge-star operators) and assembling them into Laplacian operators at every Transformer layer. Unlike methods that concatenate fixed or spectral positional encodings to input features, H-LAPE models location, adjacency, and mesh structure in a unified, data-driven manner without reliance on eigen-decompositions or heat kernel preprocessing.
The approach generalizes standard spectral encoding pipelines and applies directly to vertices, edges, and faces, integrating seamlessly into deep learning frameworks. The resulting efficiency and empirical accuracy suggests multiple directions for further research and adoption in geometric machine learning and mesh-based data domains (Nousias et al., 1 Sep 2025).