HodgeFormer: Transformers for Learnable Operators on Triangular Meshes through Data-Driven Hodge Matrices
Project page: https://hodgeformer.github.io/
Paper: https://arxiv.org/abs/2509.01839
Code: https://github.com/hodgeformer/hodgeformer
Currently, prominent Transformer architectures applied on graphs and meshes for shape analysis tasks employ traditional attention layers that heavily utilize spectral features requiring costly eigenvalue decomposition-based methods. To encode the mesh structure, these methods derive positional embeddings that heavily rely on eigenvalue decomposition based operations, e.g. on the Laplacian matrix, or on heat-kernel signatures, which are then concatenated to the input features.
This paper proposes a novel approach inspired by the explicit construction of the Hodge Laplacian operator in Discrete Exterior Calculus as a product of discrete Hodge operators and exterior derivatives, i.e.
Our approach results in a computationally-efficient architecture that achieves comparable performance in mesh segmentation and classification tasks, through a direct learning framework, while eliminating the need for costly eigenvalue decomposition operations or complex preprocessing operations.
Existing methods for 3D mesh analysis using spectral features rely on costly eigendecomposition of Laplacian matrices, creating a computational bottleneck and exhibiting high complexity.
Alternatives convolutional based methods are often constrained by architectural limitations: some require specific mesh connectivity to construct their operators or use fixed operators that cannot adapt to the underlying data.
Modern Transformer-based still depend on pre-computed spectral features for positional encoding. This reliance on expensive, rigid, and often complex preprocessing steps limits the efficiency, scalability, and flexibility of deep learning on meshes.
This paper proposes a novel approach inspired by the explicit construction of the Hodge Laplacian operator in Discrete Exterior Calculus as a product of discrete Hodge operators and exterior derivatives, i.e.
The mathematical foundation relies on two key DEC constructs:
Discrete Exterior Derivatives: Sparse signed incidence matrices that capture topological connectivity:
-
$d_0$ : maps vertex features to edge features -
$d_1$ : maps edge features to face features
Discrete Hodge Star Operators: Encode metric information (angles, lengths, areas) and are traditionally represented as diagonal matrices. The paper's key insight is to reinterpret these operators in a data-driven context, learning them as general (non-diagonal) matrices through attention mechanisms.
The Hodge Laplacian operator, which acts on k-forms (features on vertices, edges, or faces), is constructed as:
for vertices, with similar expressions for edges and faces.
- 3D vertex coordinates
$(x, y, z)$ - Vertex normal (weighted average of incident face normals)
- Vertex-associated cell area (weighted average of incident face areas)
- 3D coordinates of the two edge vertices
- 3D coordinates of vertices opposite to the edge (from incident faces)
- Edge normal (average of incident vertex normals)
- Edge lengths of edges belonging to incident faces
- 3D coordinates of the three face vertices (ordered by face orientation)
- Face normal vector
- Face area
Preprocessing: All meshes are zero-centered and scaled to the unit sphere. During training, random rotations and small perturbations along mesh edges are applied for data augmentation.
The adjacency matrices
For sparse attention, a sparsity pattern
-
$\sqrt{n}$ neighbors total - 4:1 ratio of local neighbors (from BFS) to random connections
The embedding layer transforms input features into latent representations by aggregating one-hop neighborhood information:
where:
-
$x_v \in \mathbb{R}^{n_v \times d}$ ,$x_e \in \mathbb{R}^{n_e \times d}$ ,$x_f \in \mathbb{R}^{n_f \times d}$ are the latent embeddings -
MLP is a two-layer feedforward network with:
- Input dimension:
$d_{k_{in}}$ (feature-dependent) - Hidden dimension:
$d_h = 512$ - Output dimension:
$d = 256$ - Activation: ReLU
- Input dimension:
where
For each mesh element type
where:
-
$W_{Q_k}, W_{K_k} \in \mathbb{R}^{d \times d_k}$ with$d_k = d_h / h = 512 / 4 = 64$ -
$W_{V_k} \in \mathbb{R}^{d \times d}$ with$d = 256$ -
$h = 4$ is the number of attention heads
These are learnable parameters initialized using standard PyTorch defaults
For each element
where the attention weight is:
This defines the learned Hodge Star operator
where
For the inverse Hodge Star operators
The Hodge Laplacian operator for vertices is constructed as:
Expanding with attention mechanisms:
where:
-
$d_0 \in {-1, 0, 1}^{n_e \times n_v}$ is the vertex-to-edge incidence matrix (signed, sparse) -
$d_0^T \in {-1, 0, 1}^{n_v \times n_e}$ is its transpose
The updated vertex features are computed by applying the Laplacian to the value vectors:
For
where each head
with separate
After attention, a position-wise feed-forward network is applied with residual connections:
where
The complete HodgeFormer layer with residual connections is:
where
Nousias, A. and Nousias, S., 2025. HodgeFormer: Transformers for Learnable Operators on Triangular Meshes through Data-Driven Hodge Matrices. arXiv preprint arXiv:2509.01839.
@article{nousias2025hodgeformer,
title={HodgeFormer: Transformers for Learnable Operators on Triangular Meshes through Data-Driven Hodge Matrices},
author={Nousias, Akis and Nousias, Stavros},
journal={arXiv preprint arXiv:2509.01839},
year={2025}
}