Disentangled Graph Prompting
- The paper introduces DGP, which disentangles prompt generation into class-specific and class-agnostic branches for improved graph OOD detection.
- DGP reweights graph edge weights via lightweight prompt generators while freezing a pre-trained GNN encoder to align in-distribution patterns.
- Empirical results show DGP achieves significant gains, including a 3.63% relative AUC improvement and faster training times across diverse datasets.
Disentangled Graph Prompting (DGP) denotes a graph prompting paradigm in which prompt-conditioned adaptation is separated into distinct factors rather than implemented as a single undifferentiated prompt transformation. In the most explicit current usage, DGP is a graph out-of-distribution (OOD) detection framework that follows the pre-training+prompting paradigm, freezes a pre-trained graph neural network (GNN) encoder, and learns two prompt generators that capture class-specific and class-agnostic in-distribution (ID) patterns by modifying graph edge weights (Yang et al., 31 Mar 2026). In a broader methodological sense, DGP is situated within graph prompt learning, where prompting reformulates graph inputs, representations, or task interfaces so that downstream prediction better aligns with the space or objective of pre-training (Wu et al., 2023, Fu et al., 10 Jun 2025).
1. Terminology and scope
The expression “Disentangled Graph Prompting” is not used uniformly across the literature. Two graph prompting surveys do not explicitly mention a method named DGP, and neither survey introduces disentanglement as a formal prompting subfamily with dedicated losses or a standalone taxonomy item (Wu et al., 2023, Fu et al., 10 Jun 2025). This has two consequences. First, DGP is not a survey-standard label in the way that discrete graph prompt, continuous graph prompt, data-level prompting, or representation-level prompting are. Second, many methods relevant to DGP are described instead through terms such as dual prompts, hop-specific prompts, disentangled structure prompt, decoupled prompting, or factorized prompt design.
A recurrent misconception is that every paper abbreviated “DGP” refers to Disentangled Graph Prompting. This is not the case. In fraud detection with graph-enhanced LLMs, DGP stands for Dual-Granularity Prompting, a method that keeps the target node at fine granularity while compressing neighbors into coarse-grained summaries; the paper explicitly states that its DGP does not expand to Disentangled Graph Prompting (Li et al., 29 Jul 2025). By contrast, the 2026 OOD-detection method uses the exact name Disentangled Graph Prompting and defines disentanglement operationally through separate modeling of class-specific and class-agnostic ID structure (Yang et al., 31 Mar 2026).
The literature therefore supports two complementary uses of the term. In the narrow sense, DGP refers specifically to the OOD-detection framework of (Yang et al., 31 Mar 2026). In the broader sense, it refers to graph prompting designs that separate prompt behavior across meaningful factors such as semantics and structure, node and time, low-hop and high-hop information, or class-specific and class-agnostic evidence. This broader use is interpretive, but it is strongly suggested by the way recent prompting methods decompose prompt generation and injection.
2. Position within graph prompting taxonomies
Graph prompt learning is typically framed as a pre-train, prompt, predict paradigm: followed by answer mapping
In this formulation, prompting differs from standard fine-tuning by emphasizing input reformulation rather than objective engineering, reducing the training objective gap, and often using fewer trainable parameters (Wu et al., 2023).
The 2023 survey organizes graph prompting into discrete and continuous graph prompts, with each further divided into manual prompt, node-level prompt, and topology-level prompt (Wu et al., 2023). The 2025 survey instead classifies methods by intervention point: data-level prompting
representation-level prompting
and task-level prompting
These taxonomies do not define a disentanglement category, but they provide the conceptual location in which DGP is best understood. A disentanglement-based graph prompting method would most naturally fit as a continuous graph prompt, likely topology-level or hybrid if it separates structural and semantic factors (Wu et al., 2023). The later survey also suggests a factorized view through modular prompt forms such as feature prompts, insertion-based prompts, edge prompts, class prototype prompts, conditional prompt generators, and multi-task composed prompts (Fu et al., 10 Jun 2025).
This suggests that DGP is not a separate prompting primitive so much as a structured design principle layered on top of existing prompt families. In practice, a DGP-style method may disentangle by prompt location, by graph factor, by task interface, or by granularity. The surveys further indicate what they do not provide for DGP: no standard disentanglement loss, no unified factor-decomposition template, and no canonical benchmark protocol dedicated to disentanglement itself.
3. Canonical formulation: DGP for graph OOD detection
The clearest formalization of Disentangled Graph Prompting appears in graph-level OOD detection (Yang et al., 31 Mar 2026). The setting assumes access only to an ID training distribution
where each graph is
At test time, a detector must distinguish graphs from and , even though OOD samples are unavailable during training (Yang et al., 31 Mar 2026).
The method adopts a pre-training + prompting protocol. A graph encoder is first pre-trained self-supervisedly, for example with GraphCL or SimGRACE, and then frozen. Prompting is performed not by adding prompt tokens or synthetic nodes, but by reweighting the edges of the input graph through two separate prompt generators:
- a class-specific prompt generator 0,
- a class-agnostic prompt generator 1.
Given node embeddings 2 from the frozen GNN, each existing edge is rescored as
3
DGP learns two such prompted adjacency matrices: 4 Only existing edges are reweighted. This design preserves linear dependence on the number of edges and avoids explicit edge synthesis (Yang et al., 31 Mar 2026).
The paper uses “disentangled” in a restricted but concrete sense. It does not define a latent-variable disentanglement model with orthogonality, mutual-information minimization, or identifiability guarantees. Instead, it disentangles ID pattern mining into two complementary branches. The class-specific branch is trained to expose graph structure predictive of the graph’s ID label. The class-agnostic branch is trained to preserve structure shared across ID graphs while suppressing class discrimination. The prompted graphs are then encoded by the same frozen GNN, so the disentanglement lies in prompt generation rather than in backbone parameterization.
This formulation is distinctive within graph prompting. The prompt object is the graph itself after edge reweighting; the frozen encoder is reused as a representation extractor; and the prompting objective is not ordinary task adaptation but OOD sensitivity under absent OOD supervision. In that sense, DGP treats OOD detection as post-hoc graph adaptation rather than end-to-end encoder learning (Yang et al., 31 Mar 2026).
4. Objectives, optimization, and OOD scoring
The class-specific prompted graph is encoded as
5
and classified by
6
Its loss is ordinary cross-entropy against the true label: 7 The class-agnostic branch uses the same frozen encoder and predictor,
8
but aligns predictions with a uniform class distribution 9: 0 The combined objective is
1
Here, the class-specific generator learns discriminative ID patterns, whereas the class-agnostic generator is encouraged to suppress label-specific evidence and retain shared ID fingerprints (Yang et al., 31 Mar 2026).
The paper further argues that these losses alone can induce trivial solutions, such as assigning uniformly high weights to all edges. To avoid this, DGP adds distance-based regularization built from Mahalanobis scores: 2
3
and
4
Training alternates between minimizing 5 over 6 and minimizing 7 over 8 with 9 fixed (Yang et al., 31 Mar 2026).
At inference, DGP discards the classifier and scores each test graph by a sum of Mahalanobis terms from the two prompted views: 0 Higher scores indicate greater consistency with the ID representation distribution. This yields a detector that is simultaneously sensitive to missing class-specific and class-agnostic ID structure (Yang et al., 31 Mar 2026).
5. Empirical evidence and interpretive findings
The OOD-detection DGP paper evaluates on ten dataset pairs spanning molecular, bioinformatics, and social network domains and reports that DGP achieves a relative AUC improvement of 3.63% over the best graph OOD detection baseline (Yang et al., 31 Mar 2026). In the main AUC table, SEGO has average AUC 1, DGP-GCL reaches 2, and DGP-Sim reaches 3. The method is reported to achieve state of the art on 8 of 10 dataset pairs, with especially strong results on BZR 4 COX2, PTC_MR 5 MUTAG, ENZYMES 6 PROTEIN, Tox21 7 SIDER, FreeSolv 8 ToxCast, ClinTox 9 LIPO, and Esol 0 MUV (Yang et al., 31 Mar 2026).
The auxiliary metrics reinforce the same pattern. The appendix reports that DGP improves AUPR over the best baseline by 4.13% relative on average and achieves a 46.25% relative reduction in FPR95 on average, while being best on 8 of 10 datasets for AUPR and 9 of 10 datasets for FPR95 (Yang et al., 31 Mar 2026). The paper also reports large gains over simpler backbone uses: compared with pre-trained GNNs, DGP gains 19.86% relative AUC on average; compared with fine-tuned GNNs, 13.65% relative AUC; and compared with AAGOD, 13.39% relative AUC (Yang et al., 31 Mar 2026).
Ablation studies show that neither branch is redundant. Removing the class-agnostic branch, removing the class-specific branch, or removing the distance loss each degrades performance, and the full model is best across datasets (Yang et al., 31 Mar 2026). The hyper-parameter analysis further indicates that the relative utility of class-specific versus class-agnostic prompting is dataset dependent: on BZR-COX2, class-agnostic patterns appear relatively more important, whereas on PTC_MR-MUTAG, class-specific patterns appear relatively more important. The best prompt generator depth is reported as 2 layers by default.
The interpretive analyses are equally important. Score distribution overlap between ID and OOD graphs drops from 0.69 for the original pre-trained GNN to 0.44 for DGP, which the paper reports as a 35.94% relative reduction in overlap (Yang et al., 31 Mar 2026). Prompt visualization on BZR and BBBP shows that the class-specific prompt emphasizes backbone structures and likely class-relevant motifs, whereas the class-agnostic prompt emphasizes edges less related to label discrimination and more related to shared ID structure. This does not constitute a formal disentanglement proof, but it does support the claim that the two prompt generators learn meaningfully different prompt views.
Efficiency is another empirical finding. Because the encoder is frozen and the prompt generators are lightweight, DGP is much faster than several end-to-end baselines. On BZR-COX2, training time is reported as 7.48s for DGP-GCL versus 353.35s for SEGO and 277.23s for GOOD-D; on PTC_MR-MUTAG, 9.85s versus 313.67s for SEGO (Yang et al., 31 Mar 2026). These results suggest that factorized prompting can improve both separation quality and computational efficiency when OOD supervision is absent.
6. Related formulations, adjacent methods, and broader significance
Although explicit DGP is currently most clearly instantiated in OOD detection, several neighboring methods supply components of the same design logic. In knowledge graph completion, PDKGC uses a hard task prompt together with a disentangled structure prompt generated from 1 structural components per entity, and adds a mutual-information-based independence regularizer; this is one of the closest direct precursors to DGP, though its disentanglement is applied primarily to graph structure representations projected into prompt tokens (Geng et al., 2023). In dynamic graphs, DyGPrompt separates prompting into node prompt and time prompt, with dual condition-nets generating time-conditioned node modulation and node-conditioned time modulation; the paper explicitly characterizes this as modular or factorized design rather than “true disentanglement” in the representation-learning sense (Yu et al., 2024).
Other prompting papers broaden the design space without using explicit disentanglement objectives. DAGPrompT addresses heterophily and hop-dependent distributions through GLoRA and hop-specific prompts; it is best described as distribution-aware, modular, hop-decoupled graph prompting, not strict disentanglement (Chen et al., 25 Jan 2025). DGTL for text-attributed graphs uses multiple parallel graph channels with learned channel-specific adjacency matrices and injects the resulting embeddings into a frozen LLM, making it a latent, soft-prompt variant of factorized graph prompting (Qin et al., 2023). DyGFM extends the same intuition to multi-domain dynamic graph foundation models by decoupling semantic and temporal branches, computing divergence-aware routing, and generating separate semantic and temporal prompts conditioned on cross-domain mismatch (Yuan et al., 13 May 2026).
A second line of work contributes disentanglement machinery without prompting. ADGCN distinguishes micro-disentanglement from macro-disentanglement, combining component-specific aggregation, adversarial regularization, and topology-aware graph refinement (Zheng et al., 2021). IPGDN adds neighborhood routing and Hilbert-Schmidt Independence Criterion regularization to encourage independence among graph factors (Liu et al., 2019). DGPM separates node-level and motif-level self-supervised learning with motif discovery and cross-level matching, offering a blueprint for structural prompt units even though it is a pretraining method rather than a prompt-learning system (Yan et al., 2023).
These adjacent methods clarify a central boundary in the field. Architectural separation, modular prompting, dual prompts, hop-specific prompts, and semantic-temporal decoupling are often described as “disentangled” in an informal sense. Formal disentanglement, however, would ordinarily imply explicit factor-separation machinery such as independence constraints, mutual-information penalties, orthogonality objectives, or controlled intervention-style evaluation. The literature shows both tendencies. PDKGC uses an explicit independence-oriented regularizer (Geng et al., 2023); DyGPrompt and DAGPrompT do not, and are more accurately described as factorized or decoupled prompting (Yu et al., 2024, Chen et al., 25 Jan 2025). The OOD-detection DGP paper occupies an intermediate position: it explicitly names the method Disentangled Graph Prompting, but operationalizes disentanglement through separated class-specific and class-agnostic prompt branches rather than a full latent-factor identifiability framework (Yang et al., 31 Mar 2026).
Taken together, these papers suggest that DGP is emerging as a methodological direction rather than a single fixed architecture. Its recurring themes are frozen-backbone adaptation, prompt decomposition across graph factors, lightweight prompt generators, and improved handling of objective mismatch, distribution shift, temporal drift, or neighborhood overload. The present literature also indicates the main open boundary: the move from modular prompt separation to fully explicit, testable disentanglement remains incomplete.