Node-Time Conditional Prompt Learning in Dynamic Graphs

Xingtong Yu, Zhenghao Liu, Xinming Zhang, Yuan Fang

TL;DR

DYGPROMPT is a novel framework that brings the power of "prompting" to dynamic graphs. By utilizing a dual-prompting strategy and "condition-nets" that allow nodes and time to mutually influence each other, it effectively bridges the gap between general pre-training and specific downstream tasks while remaining highly parameter-efficient.

The Challenge: Objective and Temporal Gaps

In the realm of graph machine learning, Dynamic Graph Neural Networks (DGNNs) are the gold standard for modeling data that evolves over time, such as social interactions, online learning, or user-item transactions. However, they face a significant "objective gap." Most DGNNs are pre-trained on link prediction (predicting if two nodes will interact), but they are frequently deployed for node classification (predicting a node's category or state).

While "prompting"—reformatting inputs to match a pre-trained model's expectations—has revolutionized Natural Language Processing and static graph learning, it struggles with dynamic graphs for two primary reasons:

  1. The Temporal Gap: The timing of pre-training data often differs from downstream tasks, creating inconsistencies in how time is perceived by the model.
  2. Evolving Node-Time Patterns: A user’s behavior changes over time, and different users have unique "timelines." For example, a student might code in the morning and play games at night, while a professor might have entirely different habits. Existing methods fail to capture this fine-grained interplay where nodes and time mutually characterize each other.

The DYGPROMPT Framework

To address these challenges, the authors propose DYGPROMPT, which introduces two main innovations to adapt pre-trained DGNNs to downstream tasks.

DyGPrompt Framework

1. Dual Prompts

Instead of relying on a single prompt, the framework utilizes two distinct prompts to align the input with the pre-trained model:

  • Node Prompt ($p^{node}$): Modifies node features to align the input with the pre-trained model’s expectations for the specific downstream task.
  • Time Prompt ($p^{time}$): Adjusts time features to account for the temporal shift between the pre-training phase and the downstream application.

2. Dual Condition-Nets

Rather than learning static, fixed prompts, DYGPROMPT uses lightweight neural networks (MLPs) called condition-nets to generate prompts dynamically:

  • Time Condition-Net (TCN): Takes a timestamp and generates a node prompt. This ensures the node's representation is adjusted based on when the interaction happens.
  • Node Condition-Net (NCN): Takes node features and generates a time prompt. This ensures the temporal features are adjusted based on who is involved.

By freezing the large, pre-trained DGNN and only tuning these tiny condition-nets, the model becomes extremely efficient and effective, even when labeled data is scarce.

Key Insights

  • Mutual Characterization: The core insight is that time and nodes shouldn't be treated as independent variables. Time defines the context for a node, and the node's identity defines the significance of a specific time.
  • Hypernetworks for Efficiency: Using MLPs to generate prompts is much more scalable than trying to learn a unique prompt for every single timestamp or node in a massive graph.
  • Bridging the "Pre-train, Fine-tune" Gap: Prompting allows the model to reuse the deep structural knowledge it gained during link prediction pre-training without the risk of "forgetting" that knowledge during heavy fine-tuning.

Experimental Results

The researchers evaluated DYGPROMPT on four diverse public datasets: Wikipedia, Reddit, MOOC, and Genre. The experiments specifically focused on data-scarce scenarios, using only about 0.01% of the total data for downstream tuning.

Performance Comparison Table

DYGPROMPT consistently outperformed state-of-the-art baselines (including recent dynamic prompting methods like TIGPrompt) across all datasets:

  • Accuracy: On the Wikipedia dataset for node classification, DYGPROMPT achieved an 82.09% AUC-ROC, significantly higher than the standard pre-trained TGN (50.61%) and the previous best prompter, TIGPrompt (44.80% with the same backbone).
  • Few-Shot Performance: The model showed remarkable robustness in data-scarce settings, proving that massive labeled datasets aren't strictly necessary if the prompting strategy is well-designed.
  • Efficiency: Despite the added complexity of condition-nets, DYGPROMPT is faster to train and has fewer learnable parameters than many competitive fine-tuning approaches.

Limitations and Future Work

While DYGPROMPT excels at node-level and edge-level tasks, the authors note that graph-level classification (predicting a label for an entire evolving graph) was not evaluated, as it is currently rare in dynamic graph research.

Future directions could include exploring more complex "task templates" beyond simple similarity calculations, applying the framework to larger "foundation models" for graphs, and testing the limits of the condition-nets in highly volatile environments where patterns shift even more rapidly.

Summary updated

BibTeX
@inproceedings{yu2025node,
  author = {Xingtong Yu and Zhenghao Liu and Xinming Zhang and Yuan Fang},
  title = {{Node-Time Conditional Prompt Learning in Dynamic Graphs}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=kVlfYvIqaK},
}
Figure