TL;DR
The Universal Classifier (UC) is a novel "schema-invariant" foundation model for graphs that unifies node, edge, and graph-level tasks under a single similarity-based objective. By reformulating diverse graph learning problems as a comparison between "queries" and "anchors" in a shared latent space, UC achieves impressive zero-shot generalization across entirely unseen domains with arbitrary feature and label sets.
What Problem Does This Paper Address?
Graph Machine Learning (GML) has long struggled to replicate the "foundation model" success seen in Natural Language Processing and Computer Vision. The primary hurdle is extreme heterogeneity: unlike pixels or text tokens, graph features vary wildly—a node might represent a chemical property in one dataset and a social media embedding in another. Furthermore, the GML landscape is fragmented into distinct tasks (node classification, link prediction, graph regression) that typically require bespoke, task-specific architectures.
Existing attempts at Graph Foundation Models (GFMs) often fall short by being restricted to node-level predictions or requiring fixed feature dimensions. The authors aim to bridge this gap with a truly task-agnostic backbone capable of handling the full spectrum of graph learning applications without architectural modifications.
Methods
The core innovation of the Universal Classifier (UC) is the Query-Anchor Formulation. It treats labeled items (nodes, edges, or graphs) as anchors and unlabeled items as queries. The model's job is to estimate the similarity between them in a joint latent space.
The architecture consists of four primary modules:
- GNN Encoder: Extracts local structural context for each query and anchor node via subgraph sampling and message passing.
- Query-Anchor Transformer: Uses intra-entity attention to correlate features and labels within a node, and cross-entity attention to contextualize queries against the anchor set.
- Similarity Estimator: Quantifies the affinity between queries and anchors using a scaled Frobenius inner product.
- Anchor-Class Aggregator: Pools these similarity scores by class (using a LogMeanExp operator) to produce final probabilistic predictions.
To achieve schema invariance, UC "lifts" raw scalar features and labels into 3D latent tensors using shared MLPs. This decouples the model parameters from the specific number of input features or output classes, allowing it to process any graph regardless of its schema. For regression tasks, UC discretizes continuous values into soft bins, treating them as distinct classes during training and using similarity-weighted interpolation for final scalar output.
Datasets
The authors evaluated UC on a massive, diverse corpus of real-world datasets from benchmarks like GraphLand and GraphBench, moving beyond traditional academic toy examples:
- Node Classification: 9 datasets including arxiv, roman-empire, and amazon-ratings.
- Node Regression: 4 datasets including city-roads and twitch-views.
- Link Prediction: 4 datasets including wiki-cs and tolokers-2.
- Graph Regression: Electronic circuit datasets (EC5, EC7, EC10) targeting efficiency and output voltage.
The model was pre-trained on a large mixture of openly available and synthetic graph datasets, ensuring no overlap with the evaluation sets.
Key Insights and Ideas
- Unification via Similarity: The "aha moment" is that almost any graph task can be framed as a similarity search. Link prediction becomes "how similar is this source node to this target node compared to non-neighbors?" Graph classification becomes "how similar is this new graph to these labeled examples?"
- In-Context Learning for Graphs: UC functions similarly to a Large Language Model performing few-shot inference. It doesn't need to be retrained for a new graph; it just needs a small "support set" of labeled anchors to provide context.
- Ordinality in Latent Space: By using soft-binning for regression, the model naturally learns that adjacent numerical values should be closer in the latent space. t-SNE visualizations confirm that UC successfully clusters anchors by their labels, even for continuous regression targets.
- Extreme Sample Efficiency: The model is surprisingly robust to small context sizes. Experiments show that using just 1-5% of available anchors can recover over 80% of the peak performance, significantly reducing inference-time compute.
Key Results
- Superior Zero-Shot Transfer: UC consistently outperforms state-of-the-art inductive classifiers like GraphAny and TS-Mean. In many cases, its zero-shot performance on unseen graphs even surpasses supervised GNNs trained specifically on those datasets.
- Cross-Task Generalization: UC is the first model to perform node-, edge-, and graph-level tasks without task-specific heads. For link prediction, it outperformed specialized models like BUDDY in zero-shot settings.
- Regression Success: Framing regression as soft-binned classification proved highly effective, matching or exceeding specialized tabular foundation models.
Limitations and Future Work
- Computational Overhead: Lifting every feature into a 3D tensor increases memory and inference costs compared to standard, task-specific GNNs. However, the authors argue that the high sample efficiency (needing fewer anchors) mitigates this in practice.
- Pre-training Coverage: The current model was primarily pre-trained on node and edge objectives. While it transfers well to graph-level tasks, the authors plan to include more graph-level data in future pre-training mixtures.
- Relational Domains: Future work aims to extend UC to multi-relational domains like Knowledge Graphs and complex relational databases, potentially enabling multi-table inferences without specialized heads.
Summary updated