A Framework for Graph Node Symmetric Quantification under Dataset Shift

Alessio Micheli, Alejandro Moreo, Marco Podda, Fabrizio Sebastiani, Domenico TortorellaarXiv 2026

TL;DR

Suppose you want to estimate the overall breakdown of voter preferences in a town using a social network, without knowing—or wanting to predict—how any single individual voted. Traditional graph algorithms fail here because they rely on training an individual node classifier first and counting up the results. This paper introduces GSQ, a modular framework that skips individual node labels entirely, learning directly from group-level proportions to predict class distributions in new, shifted regions of a graph.

What Problem Does This Paper Address?

In machine learning, quantification is the task of estimating class proportions (prevalence) in an unlabeled sample—like estimating the percentage of defective products in a batch, rather than flagging each defective item. This becomes crucial under dataset shift, where the test environment looks statistically different from the training environment (e.g., training a disease detector pre-pandemic and deploying it mid-pandemic).

Until now, graph node quantification has been tackled exclusively as an "asymmetric" and "aggregative" problem. You train a classifier on individually labeled nodes, predict labels for unlabeled nodes in a query sample, aggregate them, and apply a mathematical correction for dataset shift.

Fig. 1: Inference with a trained aggregative node quantification pipeline. The encoder maps the input graph to node embeddings, using which a classifier is first trained from labelled nodes and then applied to issue predictions for the unlabelled nodes. For a query sample σ ⊆VU, the aggregative quantifier aggregates the corresponding predictions and corrects for dataset shift to produce a class-prevalence estimate. The shaded regions distinguish graph-level from sample-level inference.

This creates two major roadblocks:

  1. Privacy and Data Constraints: In scenarios like elections or sensitive medical surveys, individual labels are secret; training data only exists as aggregate group statistics (e.g., municipality-level vote shares). Furthermore, making individual-level predictions might be legally or ethically undesirable.
  2. Vapnik’s Principle: Why solve a harder, intermediate task (classifying every single node) when you only care about the aggregate whole?

The authors address this by introducing symmetric node quantification: a paradigm where both the training inputs and test queries are the exact same type of object—samples of nodes labeled only by their overall class distribution.

Methods

The authors propose GSQ (Graph Node Symmetric Quantification), a transductive framework that treats prevalence estimation as a regression problem over the probability simplex (ensuring predicted proportions are non-negative and sum to 1).

Instead of a single rigid algorithm, GSQ is a mix-and-match pipeline with four stages:

  1. Node Encoder: Maps the full graph's features and connections into node embeddings. Options include a graph-agnostic baseline (MLP), a trainable Graph Convolutional Network (GCN), and a Graph Echo State Network (GESN)—a "reservoir computing" model with frozen, randomly initialized recurrent weights.
  2. Node Pooler: Compresses the embeddings of an arbitrary-sized query sample into a single, fixed-size vector (ignoring node order). Options include parameter-free Mean pooling, DeepSets (applying learned non-linearities before and after averaging), and GMNet (modeling embeddings via learnable Gaussian mixtures).
  3. Prevalence Predictor: Maps the pooled sample vector to class proportions using either a Softmax head (trained via Mean Squared Error) or a Dirichlet head (which outputs concentration parameters for a Dirichlet distribution, trained via regularized negative log-likelihood).
  4. Post-hoc Scaling (Optional): Adjusts systematic bias using scalar temperature or vector scaling on a held-out set.

The trainable components are optimized jointly end-to-end using sample-level supervision.

Datasets

The authors evaluate GSQ on four existing graph benchmarks spanning different connectivity and homophily levels (the tendency of connected nodes to share the same class):

  • Cora (7 classes) & Cora-2 (a binary version): High-homophily scientific citation networks.
  • Toloker (binary): A dense, low-homophily network of crowdsourcing workers.
  • Amazon-ratings (5 classes): A low-homophily product co-purchasing network.

No new datasets were introduced, but the authors apply three distinct sampling protocols to simulate dataset shift: the Artificial Prevalence Protocol (APP) to simulate standard label shift, and two graph-traversal protocols—Breadth-First (BFP) and Random-Walk (RWP)—to simulate structural covariate shift (e.g., training on nodes in one neighborhood of the graph and testing on another).

Key Insights and Ideas

  • Direct learning beats post-hoc patches on structural shifts: Aggregative baselines rely on rigid mathematical assumptions to correct for dataset shift. When shift is induced organically by traversing the graph's topology (BFP/RWP), those assumptions often break. Because GSQ trains directly on structurally sampled groups, it naturally learns how local graph topology relates to class proportions.
  • Graph homophily dictates the best encoder: Relational structure always beats the graph-agnostic MLP, confirming links matter. However, trainable GCNs excel on high-homophily graphs (like Cora), whereas frozen-reservoir GESNs consistently win on "heterophilic" graphs (like Toloker and Amazon) where connected nodes often have different labels.
  • Keep pooling simple, make predictors probabilistic: Across nearly all settings, DeepSets proved to be the most reliable pooler, outperforming the more complex GMNet. Meanwhile, the Dirichlet predictor head consistently beat Softmax under label shift, suggesting that modeling distributional concentration helps when class priors swing wildly.

Key Results

Performance was measured using Mean Absolute Error (AE, lower is better) across 5 folds:

  • Under Structural Covariate Shift (BFP & RWP): Validation-selected GSQ pipelines outperformed strong aggregative baselines (XNQ and APPNP-KDEy-SIS) in 7 out of 8 dataset-protocol comparisons, tying on the eighth (Cora under RWP: 0.0221 vs. 0.0217 AE). On challenging low-homophily graphs, the gap was massive: under BFP on Toloker, GSQ achieved 0.034 AE compared to the best aggregative baseline's 0.262. On Amazon (BFP), GSQ hit 0.036 AE vs. 0.130.
  • Under Prior Probability Shift (APP): GSQ remained highly competitive with XNQ (a specialized aggregative quantifier). XNQ edged out GSQ by tiny margins (0.001 to 0.003 AE) on Cora-2, Toloker, and Cora, while GSQ outperformed XNQ on Amazon (0.065 vs. 0.101 AE).
  • Post-hoc Scaling: Helpful under APP (chosen in 12/20 folds, reducing validation AE by 0.0020 on average), but largely unnecessary under BFP and RWP, where unscaled predictions were preferred in 13/20 and 15/20 folds, respectively.

Limitations and Future Work

The primary limitation is a catch-22 of benchmarking: while GSQ is designed for scenarios where individual node labels do not exist, the experiments relied on generating synthetic training samples from datasets that do have individual labels. In a real-world privacy-constrained scenario (like municipality voting), a practitioner has a fixed, limited number of naturally occurring groups and cannot combinatorially resample nodes at will to help the model generalize.

For future work, the authors suggest testing GSQ on datasets with genuinely native aggregate supervision, extending the framework from transductive (one fixed graph) to inductive and dynamic evolving graphs (such as epidemic modeling), and developing theoretical bounds on sample complexity under graph-sampling shifts.

Summary updated

Abstract

Graph node quantification is the supervised learning task of estimating the prevalence of different classes within an arbitrary sample of unlabelled nodes from a graph, subject to some form of dataset shift. Existing approaches to graph node quantification typically follow the standard aggregative paradigm, i.e., they use labelled nodes from the graph to train an intermediate node classifier, and obtain an estimated class distribution for the sample by aggregating the classifier's predictions for the individual nodes and then correcting the result via some adjustment strategy that accounts for dataset shift. In this work we propose a framework for graph node quantification that does away with both node-level supervision, since its training phase only requires node samples labelled by their class distribution, and node-level predictions, since it estimates class prevalence values directly, without the need of any intermediate node classifier. The framework thus allows symmetric quantification, since (unlike in standard ``asymmetric'' quantification methods) the labelled items used for training and the unlabelled items on which predictions must be issued are of the same type (i.e., node samples). This framework (that we dub GSQ, for Graph Node Symmetric Quantification) allows building pipelines consisting of a node encoder, an embedding pooler, a prevalence predictor, and an optional post-hoc scaling step. These components can be instantiated by choosing from different trainable and reservoir-based encoders, different pooling operators, and different prediction objectives. We evaluate the GSQ framework on binary and multi-class datasets with different levels of homophily, under prior probability shift and under structural covariate shift.
BibTeX
@misc{micheli2026framework,
  author = {Alessio Micheli and Alejandro Moreo and Marco Podda and Fabrizio Sebastiani and Domenico Tortorella},
  title = {{A Framework for Graph Node Symmetric Quantification under Dataset Shift}},
  year = {2026},
  eprint = {2611.32403},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.32403},
}
Figure