ProtoGuide: Prototype-Driven Guidance for Class-Conditional Graph Generation

Salvatore Romano, Marco Grassia, Pietro Liò, Giuseppe MangioniarXiv 2026

TL;DR

ProtoGuide is a post-hoc, backbone-agnostic framework that brings the power of classifier guidance to discrete graph diffusion models without requiring any retraining. By relaxing discrete edge outputs into a differentiable soft adjacency matrix and using a frozen Siamese Graph Neural Network, it successfully steers graph generation toward target-class prototypes at runtime.

What Problem Does This Paper Address?

Generating realistic graphs—such as brain networks, social graphs, or infrastructure topologies—with specific class characteristics is a major challenge in machine learning. While diffusion models excel at generating graphs, standard class-conditional approaches embed the class signal directly into the model during training. This tightly couples the conditioning mechanism to the generative model, meaning you have to retrain or adapt the entire system if you want to target a new class.

In image synthesis, this issue is solved using classifier guidance, which uses the gradients of an external classifier to steer a frozen, pre-trained diffusion model at generation time. However, translating this to graphs is difficult: discrete graph diffusion models sample discrete edge states (an edge is either present or absent). Because thresholding and sampling are non-differentiable, gradients cannot propagate through the sampled graph, breaking standard classifier guidance. ProtoGuide addresses this gap, enabling training-free, post-hoc guidance for discrete graph generation.

Methods

Figure 1: ProtoGuide pipeline. At each step t of the reverse diffusion process (running from t = T, pure noise, down to t = 1), the frozen denoiser pθ produces per-edge outputs oij(t) (Panel 1). These are converted into a differentiable soft adjacency matrix eA ∈[0, 1]N×N, together with structural node features (Panel 2). A frozen Siamese GNN fϕ embeds this relaxed graph into z ∈RD and computes a contrastive Siamese score S(G), which pulls z toward the target-class prototype πy∗and pushes it away from the competing class prototype (Panel 3). Backpropagating the contrastive score through the soft adjacency construction yields per-edge gradients gij = ∂S/∂oij(t), which are ℓ2-normalized per-edge to obtain ˆgij, scaled by a guidance scale λ and a cosine annealing schedule α(ρt), and injected into the denoiser output to steer generation toward the target class (Panel 4; the Social class is shown here as an illustrative example). The annealing schedule suppresses guidance early in generation (large t, high noise) and strengthens it later. Denoiser, Siamese GNN, and class prototypes all remain frozen throughout: no component is retrained. † The k-core feature is non-differentiable; it is computed on the hard-thresholded graph and treated as a constant (stop-gradient) during backpropagation.

The ProtoGuide pipeline bypasses the discrete gradient bottleneck using several novel components:

  • Soft-Adjacency Relaxation: At each reverse diffusion step, the denoiser's discrete per-edge outputs are relaxed into continuous probabilities, creating a differentiable "soft" adjacency matrix ($\tilde{\mathbf{A}}$).
  • Differentiable Structural Features: To evaluate graph topology, the framework computes continuous relaxations of key structural node features (degree, $\chi$-degree, and local clustering coefficient). Non-differentiable features, like the $k$-core number, are computed on a hard-thresholded graph and treated as constants using a stop-gradient approach.
  • Contrastive Prototype Guidance: A frozen Siamese Graph Attention Network (GAT) embeds this soft graph into a vector space. Generation is steered using a contrastive objective function that pulls the graph embedding toward a target-class prototype (the mean embedding of real training graphs for that class) while pushing it away from the nearest competing class prototype.
  • Cosine Guidance Schedule: The injected gradient is modulated by an annealing schedule. It suppresses guidance during early, highly noisy generation steps when the topology is unstable, and gradually strengthens it as the graph structure solidifies.
  • Backbone-Agnostic Injection: The authors demonstrate the framework's flexibility by instantiating it on two architecturally distinct discrete diffusion models: EDGE (via direct reverse-step distribution injection) and DiGress (via clean-data prediction injection).

Datasets

The framework was evaluated on five distinct classes of real-world networks, primarily sourced from the ATLAS benchmark and ecological corpora:

  1. Connectome: Human brain networks.
  2. Infrastructure: Topologies representing international trade and transportation networks.
  3. Internet: Autonomous-system graphs.
  4. Social: Online and offline human social networks.
  5. Biological: A combination of biological networks, food webs, and molecular interaction networks.

Key Insights and Ideas

  • Continuous Relaxations Enable Discrete Guidance: The core "aha" moment is that the internal guidance step doesn't need to operate on a strictly discrete graph. Mapping edge probabilities to a continuous space allows standard backpropagation to discover the precise topological modifications needed to match a target class.
  • Prototypes Over Classifiers: Instead of training a complex, time-dependent classifier on noisy intermediate states (which degrades far from $t=0$), ProtoGuide uses stable class centroids in a metric embedding space. This allows the guidance target to be respecified using very small support sets (few-shot) at inference time.
  • Controllability vs. Fidelity Trade-off: The paper highlights that steering a model to look more like a target class does not automatically guarantee that its overall structural distribution matches perfectly. Controllability (class accuracy) and structural fidelity can move independently, meaning researchers must evaluate both.

Key Results

  • Substantial Accuracy Boosts: ProtoGuide raised macro classification accuracy from 50.7% to 73.5% on the EDGE backbone, and from 73.6% to 83.8% on DiGress.
  • Correcting Systematic Model Biases: The unguided EDGE baseline frequently misclassified brain networks (Connectomes) as Social networks, achieving only 11.6% accuracy. ProtoGuide corrected this systematic confusion, skyrocketing Connectome accuracy to 85.0%.
  • Outperforming Joint Training: ProtoGuide outperformed DiGress’s native, built-in conditional training configuration, which achieved only 41.4% macro accuracy under the same setup due to pronounced class biases.
  • Structural Transfer to Real Graphs: In a synthetic-to-real transfer test, a classifier trained only on graphs generated by ProtoGuide achieved 79.2% macro accuracy when evaluated on real, unseen networks, proving that the guided graphs capture genuine class-structural regularities.

Limitations and Future Work

  • Generative Backbone Dependencies: ProtoGuide cannot fix inherent structural deficiencies of the underlying model. For example, because the EDGE backbone struggles to generate connected components for Internet graphs, its structural coverage score remained at 0% both with and without guidance.
  • Intra-Class Steering Constraint: The current protocol trains one unconditional backbone per class and steers within that distribution. A natural next step is testing a single, pooled unconditional backbone steered toward multiple distinct class prototypes.
  • Centroid Simplification: Representing an entire network class by a single prototype centroid may fail if the class has a multi-modal structural organization. Future work could explore mixture or hierarchical prototypes.
  • Feature Bounding Issues: The algebraic relaxation used for the clustering coefficient can occasionally output values outside the standard $[0, 1]$ range when handling fractional adjacencies, suggesting room for alternative differentiable feature sets.

Summary updated

BibTeX
@misc{romano2026protoguide,
  author = {Salvatore Romano and Marco Grassia and Pietro Liò and Giuseppe Mangioni},
  title = {{ProtoGuide: Prototype-Driven Guidance for Class-Conditional Graph Generation}},
  year = {2026},
  eprint = {2609.15239},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.15239},
}
Figure