Hypergraph neural network

Also known as: HGNN

On this page 7

A hypergraph neural network (HGNN) is a neural network that learns representations on a hypergraph, a structure in which a single hyperedge can connect any number of nodes rather than exactly two. In graph learning, a branch of artificial intelligence, HGNNs extend graph neural networks to data where the natural unit of interaction is a group, such as the authors of one paper, the items in one shopping session or the proteins in one complex.

Ordinary graphs encode only pairwise relations, so a group of five co-authors must be broken into ten separate edges, which loses the fact that all five worked together. A hypergraph keeps that higher-order relation intact, and an HGNN propagates information through it to support node classification, link prediction, recommendation and other tasks.

How a hypergraph neural network passes messages

Most HGNNs use two-stage message passing. In the first stage, every hyperedge aggregates the features of its member nodes into a hyperedge representation. In the second stage, every node aggregates the representations of the hyperedges it belongs to and combines them with its own features. Stacking several such layers lets information travel across groups that share members.

The structure is stored in an incidence matrix H of size nodes by hyperedges, where an entry is one when a node belongs to a hyperedge. The original HGNN layer, proposed in 2019, applies a normalized propagation of the form Dv^-1/2 H W De^-1 H^T Dv^-1/2 X Θ, where Dv and De hold node and hyperedge degrees, W holds hyperedge weights, X holds node features and Θ is the learnable weight matrix. This operator generalizes the graph Laplacian used in a graph convolutional network to hyperedges of arbitrary size.

The table below lists the main building blocks of a typical HGNN layer and their role.

ComponentTypical formRole
Incidence matrixBinary nodes-by-hyperedges matrixEncodes group membership
Degree normalizationNode and hyperedge degree matricesPrevents large groups from dominating
Hyperedge weightsFixed or learned scalarsExpress the importance of each group
Node-to-hyperedge aggregationMean, sum, attention or set functionBuilds a group representation
Hyperedge-to-node aggregationMean, sum or attentionUpdates each member node
Nonlinearity and weightsLinear layer with ReLU or similarLearns task-specific features
Components of a hypergraph neural network layer

Main variants of hypergraph neural networks

Since the first spectral formulation, several architectural families have appeared. They differ mainly in how they aggregate inside a hyperedge and whether they reduce the hypergraph to an ordinary graph.

VariantKey ideaStrengthWeakness
HGNN (spectral)Hypergraph Laplacian convolutionSimple and efficientFixed, non-adaptive aggregation
HyperGCNApproximates each hyperedge with selected pairwise edgesLower cost on large hyperedgesDiscards part of the group signal
Hypergraph attention networksAttention weights inside and across hyperedgesLearns member importanceMore parameters and memory
UniGNNUnifies GNN layers for hypergraphsReuses GCN, GAT and GIN designsInherits their limits
AllSetLearnable multiset functions in both stagesVery expressive, permutation invariantHarder to train
Representative HGNN variants

The permutation invariance of each aggregation step is essential: the order in which members of a hyperedge are listed must not change the output. Set-based variants such as AllSet enforce this with Deep Sets or Set Transformer style functions.

Hypergraphs compared with graph expansions

A hypergraph can always be converted into an ordinary graph, but each expansion changes the information available to the model. The comparison explains why dedicated HGNNs exist instead of simply running a standard message passing neural network.

RepresentationConstructionInformation keptCost
Clique expansionEvery pair inside a hyperedge becomes an edgePairwise co-membership onlyQuadratic in hyperedge size
Star expansionHyperedge becomes a node linked to its membersFull membership, as a bipartite graphLinear in hyperedge size
Native hypergraphIncidence matrix used directlyFull group identity and sizeLinear in total memberships
Ways to represent group relations

Clique expansion is lossy: two different hypergraphs can produce the same clique graph, so a model on it cannot tell them apart. Star expansion is lossless and in fact underlies many HGNNs, which can be seen as specialized heterogeneous graph neural networks on a bipartite node-hyperedge graph.

Where hypergraph neural networks are applied

HGNNs are useful wherever interactions are inherently multi-way. Typical domains include citation and co-authorship networks, where a paper links all its authors; recommender systems, where a session or a group purchase links several items; and biomedicine, where a drug combination or protein complex involves more than two entities.

  • Academic data: classifying papers or authors on co-authorship and co-citation hypergraphs such as Cora, Citeseer and DBLP variants.
  • 3D object recognition: grouping multi-view or point features into hyperedges by nearest neighbors, as in experiments on ModelNet40.
  • Recommendation: modeling sessions, bundles and social groups as hyperedges.
  • Chemistry and biology: reactions, multi-drug interactions and gene sets.
  • Electronic health records: a hospital visit links many diagnoses and procedures.

When no explicit groups exist, practitioners often construct hyperedges from feature similarity, for example by linking each node with its k nearest neighbors. The quality of this hypergraph construction step frequently matters as much as the choice of architecture.

Limitations and practical pitfalls

HGNNs share the known weaknesses of graph neural networks and add some of their own. Over-smoothing appears quickly because a single large hyperedge mixes many nodes in one step, so most models remain shallow, often two or three layers.

ProblemCauseRemedy
Over-smoothingLarge hyperedges average many membersFewer layers, residual connections, degree normalization
Memory blow-upClique expansion of huge hyperedgesUse star expansion or sparse incidence operations
Poor heterophily performanceMembers of a group carry different labelsAttention or set-based aggregation
Weak constructed hypergraphArbitrary k in nearest-neighbor groupsTune k, learn structure or combine views
Misleading benchmarksSmall datasets and varying splitsReport several splits and strong graph baselines
Common problems and remedies

A common mistake is to assume that a hypergraph model is automatically better than a graph model. On several benchmarks, a carefully tuned GNN on the star or clique expansion performs similarly, so a fair baseline comparison remains necessary before adopting a more complex architecture.

A non-technical view

Most network models only understand links between two things. Real life often involves whole groups at once. A meeting, a team or a shopping basket brings many people or items together.

A hypergraph neural network treats each group as one connection. It first sums up what the members of a group have in common. Then it tells every member what its groups look like. This helps the model learn from teams, not just pairs.

A concrete example

An online grocery service wants to recommend items that complete a shopping basket. Its data contains about two million past orders, each listing between 3 and 40 products. The data science team builds a hypergraph in which every product is a node and every order is a hyperedge connecting all products bought together, with product category and price as node features.

A two-layer HGNN with attention-based aggregation learns product embeddings from this structure. Compared with a graph model trained on pairwise co-purchase edges, the hypergraph model better captures recipe-like groups, such as pasta, tomatoes, basil and parmesan. In an offline test, it raises the share of baskets where the next added item appears in the top ten suggestions by several percentage points, and the team moves it to an A/B test before full rollout.