Homophily · graph learning

On this page 7

Homophily in graph learning is the tendency of connected nodes to share the same label or similar features. A graph is called homophilous when most edges link nodes of the same class, as in citation networks where papers usually cite work from their own field. Within artificial intelligence, homophily is one of the most important structural properties of a graph dataset, because it largely decides whether neighborhood aggregation helps or harms a model.

The concept comes from sociology, where it describes the observation that similar people tend to form ties. In machine learning on graphs it became a measurable quantity once researchers noticed that classic graph neural networks perform well on homophilous benchmarks and degrade sharply on heterophilous graphs, where connected nodes tend to differ.

Why homophily matters for message passing

Homophily matters because most graph neural networks compute a node representation by aggregating features from its neighbors. When neighbors mostly share the node’s class, averaging their features acts as denoising: the class signal is reinforced while random variation cancels out. When neighbors mostly belong to other classes, the same averaging mixes conflicting signals and blurs the distinctions the classifier needs.

This explains why a graph convolutional network can be described as a low-pass filter on the graph signal. Low-pass filtering smooths features along edges, which is exactly the right inductive bias under strong homophily. It also links homophily to over-smoothing: even on homophilous graphs, too many aggregation layers make all representations converge, but the damage appears much earlier on heterophilous graphs.

The assumption is also implicit in older methods. Label propagation spreads known labels along edges and therefore works only when edges connect same-class nodes, and random-walk embeddings such as DeepWalk place nearby nodes close together in vector space.

How homophily is measured

Homophily is measured with ratios that compare edge endpoints, but different definitions can rank the same graph very differently. The table below lists the most widely used measures, each of which ranges from 0 to 1 in its basic form.

MeasureDefinitionMain caveat
Edge homophilyShare of edges joining same-class nodesDominated by large classes
Node homophilyAverage share of same-class neighbors per nodeSensitive to low-degree nodes
Class homophilyPer-class excess over the class frequencyCorrects for class imbalance
Adjusted homophilyEdge homophily corrected for chance agreementCan become negative
Feature similarityAverage cosine similarity across edgesIgnores labels entirely
Common homophily measures for node-labeled graphs

Class imbalance is the main source of misleading values. On a graph where one class holds 90 percent of the nodes, random wiring already produces an edge homophily near 0.8, so a high raw score does not prove that structure carries label information. Adjusted and class-level measures were introduced to remove this chance baseline.

Measuring homophily requires labels, so on a new dataset it can be estimated only from the labeled training nodes. This estimate may be biased when labeled nodes are not sampled uniformly from the graph.

Homophily and heterophily in benchmark graphs

Benchmark datasets differ widely in homophily, and this variation explains many reported performance gaps. Heterophily is the opposite tendency, in which connected nodes tend to differ, and it is treated as a separate Term because it requires different architectures.

DatasetGraph typeEdge homophilyRegime
CoraCitation networkAbout 0.81Strongly homophilous
PubMedCitation networkAbout 0.80Strongly homophilous
ChameleonWikipedia page linksAbout 0.23Heterophilous
TexasUniversity web pagesAbout 0.11Strongly heterophilous
ActorCo-occurrence networkAbout 0.22Heterophilous
Approximate edge homophily of standard node classification datasets

Values are approximate and depend on preprocessing, such as whether edges are made undirected. Several small heterophilous benchmarks have also been criticized for duplicate nodes and train-test leakage, so conclusions drawn from them should be checked on larger, cleaned datasets.

Choosing models according to homophily

The measured homophily level is a practical guide for choosing a graph architecture. The decision table below summarizes common recommendations; it is a starting point, not a rule, because feature quality and degree distribution also matter.

SituationRecommended approachReason
High homophilyGCN, GraphSAGE or label propagationSmoothing reinforces the class signal
Mixed homophilyGraph attention or adaptive filtersLearned weights downweight dissimilar neighbors
Low homophilyEgo and neighbor separation, higher-order neighborhoodsPrevents mixing of conflicting features
Unknown or unreliableCompare with a feature-only MLP baselineShows whether edges add information
Model choice by homophily level

The multilayer perceptron baseline deserves emphasis. A model that ignores edges entirely sometimes outperforms a graph neural network on heterophilous data, which is clear evidence that naive aggregation is harmful for that graph. Architectures such as H2GCN, GPR-GNN and models with signed or high-pass filters were designed specifically for this case.

Common misconceptions about homophily

Homophily is often reduced to a single number, which hides important nuances. The points below reflect findings that experienced practitioners take into account.

  • Low homophily is not always harmful: if dissimilar neighbors follow consistent patterns, for example each class linking to one specific other class, aggregation can still be informative.
  • A global score hides local variation: a graph can be homophilous overall while containing large heterophilous regions.
  • Homophily is task-specific: the same graph can be homophilous for one labeling and heterophilous for another.
  • Rewiring is not free: adding edges between similar nodes raises homophily but can introduce information from the labels themselves.

Because of these nuances, recent work favors class-level and local homophily profiles over one summary score, and reports them alongside model results to make comparisons interpretable.

A plain-language summary

People often make friends with people who are like them. Homophily describes the same pattern in data networks. If linked items usually belong to the same group, the network is homophilous.

Many graph learning models guess what an item is by looking at its neighbors. This works well when neighbors are similar. It works badly when neighbors are usually different. Measuring homophily tells engineers which kind of network they have and which model to pick.

An example from practice

A fraud analytics team at a payment provider builds a transaction graph in which accounts are nodes and money transfers are edges. The team first tries a standard graph convolutional network, expecting fraudulent accounts to cluster together, but the model barely outperforms a feature-only classifier.

Measuring class homophily reveals the reason: fraudulent accounts connect mostly to legitimate victims, so the fraud class has a homophily close to zero, even though the overall edge homophily is above 0.9 because legitimate accounts dominate. The team switches to an architecture that keeps each node’s own features separate from aggregated neighbor features and adds attention weights. Recall on the fraud class rises by several percentage points on a held-out month, and the team adds class-level homophily to its standard dataset report.