Scaling Graph Similarity Learning with Graph Neural Networks

Ahmet Tüzen, Helge Langseth, Kjetil NørvågarXiv 2026

Graph similarity is a cornerstone of modern data science, powering everything from chemical compound discovery to social network analysis. But there’s a catch: the gold standards for measuring similarity—Graph Edit Distance (GED) and Maximum Common Subgraph (MCS)—are NP-hard. While Graph Neural Networks (GNNs) have tried to bridge the gap, they’ve historically been stuck in the "small-graph sandbox," struggling with anything larger than a few dozen nodes.

In their paper, "Scaling Graph Similarity Learning with Graph Neural Networks," Ahmet Tüzen and colleagues introduce FiLSim, a framework that breaks these scaling barriers, handling graphs with over 150,000 nodes while outperforming state-of-the-art methods on tiny benchmarks.

TL;DR

FiLSim is a scalable GNN framework that ditches expensive node-level cross-attention in favor of independent graph encoding and a FiLM-based interaction module. It achieves state-of-the-art accuracy on standard benchmarks and is the only learned method capable of scaling to graphs with 150,000+ nodes, where traditional baselines either crash or fail to learn.

What Problem Does This Paper Address?

The "Quadratic Trap." Most existing GNN-based similarity models rely on node-level cross-graph attention or pairwise comparisons. This creates a computational complexity of $O(n_1 n_2)$, where $n$ is the number of nodes. If you're comparing two molecules with 20 nodes, it's fine. If you're comparing two social networks with 20,000 nodes, your GPU will run out of memory (OOM) instantly.

Furthermore, there is a massive data gap. Standard benchmarks like AIDS or LINUX average only 8–13 nodes per graph. We simply didn't have large-scale datasets with reliable similarity labels to even test if these models could handle real-world scales.

Methods

The authors propose FiLSim (FiLM-conditioned Large-graph Similarity), which uses a three-stage pipeline designed for efficiency:

  1. Feature Augmentation: Since many large graphs lack node features, they use Local Degree Profile (LDP). This describes a node by its degree and the statistics (min, max, mean, std) of its neighbors' degrees. It’s simple, descriptive, and—crucially—computable in linear time.
  2. Siamese GNN Encoder: They use a shared Gated GNN (GGNN) to encode each graph independently. Because the graphs don't "talk" to each other during encoding, you can compute an embedding for a graph once and cache it. This turns a $Q \times R$ (query $\times$ reference) problem into a $Q + R$ problem.
  3. FiLM Interaction Module: To predict similarity, they use Feature-wise Linear Modulation (FiLM). Instead of a simple distance metric, one graph's embedding dynamically scales and shifts the other's. This is combined with standard Euclidean distance to produce the final GED or MCS score.

Datasets

The paper evaluates on two fronts:

  • Classic Benchmarks: PTC, AIDS700nef, LINUX, and IMDBMulti (small graphs for baseline comparison).
  • New Large-Scale Benchmarks: The authors introduced a sequential graph-editing strategy to create synthetic versions of real-world datasets like Cora, PubMed, Amazon Computers, and ogbn-arxiv.
  • The Scale: While classic sets have ~10 nodes, ogbn-arxiv averages 169,344 nodes and over 1 million edges.
  • The Labels: By applying a known sequence of edits to a "parent" graph, they generate pairs with reliable GED upper bounds, enabling supervised learning at massive scales.

Key Insights and Ideas

  • Simplicity Scales: The "aha moment" here is that you don't need complex, node-level alignment to be accurate. By focusing on high-quality graph-level embeddings and a smart interaction head (FiLM), FiLSim beats models that are 100x more computationally expensive.
  • The "Linear Cost" Fallacy: The authors show that just having a linear encoding cost isn't enough. Several baselines with similar theoretical complexity failed to converge or produce useful similarities on large graphs, proving that the architecture of the interaction matters as much as the complexity.
  • Caching is King: In a retrieval scenario (comparing one query to 1,000 candidates), FiLSim is roughly 64x faster than pairwise models because it only encodes each graph once.

Key Results

  • Accuracy: FiLSim achieved the lowest error (MAE/RAE) on all four small-scale benchmarks for both GED and MCS tasks.
  • Extreme Scalability: On the ogbn-arxiv dataset (169k nodes), FiLSim remained accurate and efficient. Every single baseline method either ran out of memory or timed out.
  • Inference Speed: FiLSim can score 10,000 graph pairs in seconds on a single GPU, even for the largest datasets.
  • Ablation: The FiLM module was found to be the primary contributor to performance, significantly outperforming the widely used Neural Tensor Network (NTN) head while using fewer parameters.

Limitations and Future Work

  • Upper Bounds vs. Exact Truth: For the large-scale datasets, the labels are GED upper bounds (based on the edit path used to generate them), not necessarily the absolute minimum edit distance.
  • No "Path" Recovery: FiLSim predicts a similarity score (a scalar). It does not provide the actual sequence of edit operations (the "path") required to transform one graph into another, which is important for some explainability use cases.
  • MCS on Large Graphs: The current large-scale generation method only provides GED labels. Extending this to provide reliable MCS labels for 100k-node graphs remains an open challenge.

For more details, you can find the full paper on arXiv under the identifier 2611.09805v1.

Summary updated

Abstract

Graph similarity computation is an important task in graph mining with many real-world applications, such as chemical compound analysis, program dependence comparison, and social network analysis. The problem is computationally challenging: Graph Edit Distance (GED) and Maximum Common Subgraph (MCS), which quantify the distance between graphs and identify their largest shared subgraph, respectively, are NP-hard to compute exactly. To address these computational challenges, Graph Neural Networks (GNNs) have been applied to this problem. However, existing GNN-based approaches have primarily focused on small-scale graph datasets, while scalability to larger scales remains underexplored. In this work, we propose FiLSim, a scalable GNN-based framework, and investigate whether a simplified GNN pipeline can maintain competitive performance on standard benchmarks while scaling to large graphs. We additionally propose a sequential graph-editing strategy to construct large-scale graph datasets with reliable GED labels to evaluate scalability. The proposed framework is evaluated on four benchmark datasets and four newly created large-scale datasets, demonstrating its effectiveness and scalability. FiLSim remains accurate on graphs with more than 150{,}000 nodes, where the baseline methods run out of memory or fail to learn, and scores all test pairs within seconds on a single GPU.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
AIDS700nefFiLSimMAE0.532split: test
Source quote
L877: 0.532
IMDBMultiFiLSimMAE2.235split: test
Source quote
L882: 2.235
LINUXFiLSimMAE0.020split: test
Source quote
L1022: 0.020
PTCFiLSimMAE2.436split: test
Source quote
L1027: 2.436
CoraFiLSimRAE0.190split: test
Source quote
L1430: 0.190
PubMedFiLSimRAE0.185split: test
Source quote
L1435: 0.185
Amazon ComputersFiLSimRAE0.241split: test
Source quote
L1527: 0.241
ogbn-arxivFiLSimRAE0.342split: test
Source quote
L1532: 0.342
AIDS700nefFiLSimMAE0.264split: test
Source quote
L1162: 0.264
IMDBMultiFiLSimMAE0.081split: test
Source quote
L1167: 0.081
LINUXFiLSimMAE0.015split: test
Source quote
L1285: 0.015
PTCFiLSimMAE0.804split: test
Source quote
L1290: 0.804
BibTeX
@misc{tuzen2026scaling,
  author = {Ahmet Tüzen and Helge Langseth and Kjetil Nørvåg},
  title = {{Scaling Graph Similarity Learning with Graph Neural Networks}},
  year = {2026},
  eprint = {2611.09805},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.09805},
}
Figure