Heterophily

Also known as: heterophilic graphs

On this page 6

Heterophily is the property of a graph in which connected nodes tend to differ in their labels, classes or features, so that an edge signals dissimilarity rather than similarity. In graph learning, it is the opposite of homophily, and graphs with this property, often called heterophilic graphs, expose a core weakness of many graph neural networks that implicitly assume neighbors are alike.

The concept matters because the most common architectures, such as the graph convolutional network, compute a node representation by averaging or smoothing neighbor features. On a heterophilic graph, that averaging mixes signals from different classes and can make predictions worse than a model that ignores the graph entirely.

How heterophily is measured

Heterophily is quantified with homophily ratios, and a graph is called heterophilic when these ratios are low. The edge homophily ratio is the fraction of edges that connect nodes with the same label, while the node homophily ratio averages, over all nodes, the share of each node’s neighbors that share its label.

Both simple ratios are sensitive to class imbalance: a graph with one dominant class can look homophilous even when edges are random. Adjusted measures correct for this by comparing the observed agreement with the agreement expected by chance, which gives a more reliable picture on unbalanced data.

Heterophily is also a local property. A graph with a moderate global ratio can contain regions that are strongly homophilic and others that are strongly heterophilic, and a single number hides this variation. Practitioners therefore inspect the distribution of node homophily and the class compatibility matrix, which shows how often each pair of classes is connected.

The main metrics and their typical interpretation are summarized below.

MetricWhat it measuresInterpretation
Edge homophilyShare of same-label edgesBelow about 0.3 suggests strong heterophily
Node homophilyAverage same-label share per nodeCaptures uneven local mixing
Class-insensitive homophilyAgreement corrected per classRobust to many classes and imbalance
Adjusted homophilyAgreement minus chance expectationNegative values indicate true heterophily
Label informativenessInformation a neighbor label givesHigh even when labels differ consistently
Common metrics for homophily and heterophily

Why message passing struggles on heterophilic graphs

A message passing neural network updates each node by aggregating messages from its neighbors and combining them with the node’s own state. When aggregation is a mean or normalized sum, as in the graph convolutional network, the operation acts as a low-pass filter that pulls neighboring representations toward each other.

Under homophily this smoothing removes noise, but under heterophily it blends features from different classes, so the resulting embeddings lose discriminative information. Stacking more layers aggravates the effect and interacts with over-smoothing, where node representations converge to nearly identical vectors.

Heterophily is not automatically harmful. If neighbor labels differ in a consistent pattern, for example class A always links to class B, a model can learn that mapping. The real difficulty arises when neighborhoods are mixed and unpredictable, which is why label informativeness complements homophily ratios.

AspectHomophilic graphHeterophilic graph
Meaning of an edgeNodes are likely similarNodes are likely different
Effect of mean aggregationDenoises and helpsMixes classes and can hurt
Useful spectral contentMainly low frequenciesHigh frequencies also informative
Strong simple baselineGraph convolutional networkMLP on node features
Typical examplesCitation networksFraud rings, some web graphs
Homophily and heterophily compared

Architectures designed for heterophily

Models for heterophilic graphs change how neighbor information is combined rather than abandoning the graph. Recurring design principles include separating ego and neighbor embeddings, using higher-order neighborhoods, combining intermediate layer outputs and allowing signed or high-pass filters that can emphasize differences.

From the perspective of graph signal processing, a homophilic label signal varies slowly across edges and lives mostly in the low-frequency spectrum of the graph Laplacian, while a heterophilic signal changes sign between neighbors and carries high-frequency components. A fixed low-pass filter discards exactly the information that heterophilic tasks need, so adaptive filters are a principled remedy.

The following table lists representative approaches and the mechanism each relies on.

Model familyKey mechanismWhy it helps
H2GCNSeparate ego and neighbor parts, two-hop neighborsPreserves node identity, finds similar distant nodes
GPR-GNNLearnable weights per propagation stepWeights can turn negative for high-pass filtering
FAGCNSigned attention coefficientsAdds or subtracts neighbor signals
GraphSAGE with concatenationConcatenates self and neighbor featuresAvoids overwriting the node’s own signal
Graph rewiring and transformersNew edges or global attentionConnects nodes by similarity, not original links
Representative GNN designs for heterophily

Benchmark results have shown that carefully tuned classic models, especially GraphSAGE-style concatenation with residual connections, often match specialized architectures. Claimed gains should therefore be checked against strong baselines and corrected datasets.

Benchmarks and evaluation pitfalls

Early heterophily research relied on small datasets such as Texas, Cornell and Wisconsin web page graphs and the Chameleon and Squirrel Wikipedia graphs. Later analysis found that these sets are very small, and that Chameleon and Squirrel contain many duplicate nodes leaking across train and test splits, which inflated reported accuracy.

  • Use corrected or larger benchmarks, such as roman-empire, amazon-ratings or questions, to obtain stable comparisons.
  • Always report an MLP baseline, because a model that ignores edges is the honest reference point.
  • Report variance across many splits, since small graphs produce large accuracy fluctuations.
  • Measure heterophily with adjusted metrics rather than edge homophily alone.

These practices separate genuine architectural progress from dataset artifacts, a recurring issue in graph machine learning.

A non-technical view

Many networks connect similar things. Friends often share hobbies. Scientific papers cite papers on the same subject. This pattern is called homophily.

Heterophily is the reverse pattern. Connected things tend to be different. On a dating site, people often connect with someone unlike themselves. A fraudster connects with ordinary customers to hide. Standard graph models assume neighbors are similar, so they get confused on such networks. Special models learn to use the differences instead of blurring them.

A concrete example

A payment platform builds a transaction graph in which accounts are nodes and transfers are edges, and it wants to flag fraudulent accounts. Fraudsters rarely transfer money to each other directly. Instead, they connect to many legitimate accounts, so most edges around a fraud node lead to honest users and the edge homophily for the fraud class is very low.

A standard graph convolutional network averages neighbor features and makes each fraud account look like its honest neighbors, so its recall on fraud cases drops below that of a plain MLP. The data science team switches to a model that keeps ego and neighbor embeddings separate and learns signed aggregation weights.

The new model learns that an account connected to many unrelated, newly created accounts is suspicious. Evaluated on held-out months, it detects more fraud at the same false-positive rate, and the team documents the adjusted homophily of the graph so that later model changes are tested against the same structural assumption.