[Paper Review] PRODIGY: Enabling In-context Learning Over Graphs
PRODIGY is the first framework enabling in-context learning over graphs by introducing a prompt graph representation that unifies node-, edge-, and graph-level tasks. It uses a graph neural network with attention over the prompt graph and a family of self-supervised pretraining objectives, achieving 18% higher in-context learning accuracy than contrastive baselines and 33% better than fine-tuning with limited data.
In-context learning is the ability of a pretrained model to adapt to novel and diverse downstream tasks by conditioning on prompt examples, without optimizing any parameters. While large language models have demonstrated this ability, how in-context learning could be performed over graphs is unexplored. In this paper, we develop extbf{Pr}etraining extbf{O}ver extbf{D}iverse extbf{I}n-Context extbf{G}raph S extbf{y}stems (PRODIGY), the first pretraining framework that enables in-context learning over graphs. The key idea of our framework is to formulate in-context learning over graphs with a novel \emph{prompt graph} representation, which connects prompt examples and queries. We then propose a graph neural network architecture over the prompt graph and a corresponding family of in-context pretraining objectives. With PRODIGY, the pretrained model can directly perform novel downstream classification tasks on unseen graphs via in-context learning. We provide empirical evidence of the effectiveness of our framework by showcasing its strong in-context learning performance on tasks involving citation networks and knowledge graphs. Our approach outperforms the in-context learning accuracy of contrastive pretraining baselines with hard-coded adaptation by 18\% on average across all setups. Moreover, it also outperforms standard finetuning with limited data by 33\% on average with in-context learning.
Motivation & Objective
- To enable in-context learning for graph machine learning tasks without fine-tuning or parameter updates.
- To unify diverse graph classification tasks—node, edge, and graph-level—into a single prompt-based representation.
- To design a pretraining framework that generalizes across novel graphs and tasks without retraining.
- To develop a graph neural network architecture and pretraining objectives tailored for in-context learning over graphs.
- To demonstrate strong few-shot generalization on unseen graphs and tasks using only prompt examples.
Proposed method
- Introduces the prompt graph, a unified graph structure connecting input nodes/edges (from prompt examples and queries) with label nodes, forming a task-specific graph for in-context learning.
- Employs a graph neural network with attention mechanisms to aggregate information across the prompt graph for prediction.
- Proposes a family of in-context pretraining objectives, including neighbor matching, which classifies node or edge neighborhoods.
- Uses self-supervised pretraining on large-scale citation and knowledge graphs (e.g., MAG240M, Wiki) to learn generalizable representations.
- Applies attribute prediction as a key component, significantly improving performance, as shown in ablation studies.
- Trains the model end-to-end on diverse graphs and tasks to enable zero-shot adaptation to new graphs and tasks via few-shot prompting.
Experimental results
Research questions
- RQ1Can in-context learning be effectively extended from natural language to graph-structured data?
- RQ2What is a unified, general-purpose representation for diverse graph classification tasks (node, edge, graph-level) in an in-context learning setup?
- RQ3How can a graph model be pre-trained to generalize across both novel graphs and novel tasks without fine-tuning?
- RQ4What architectural and pretraining components enable strong few-shot generalization in graph in-context learning?
- RQ5How does performance scale with the number of in-context examples and pretraining data?
Key findings
- PRODIGY outperforms contrastive pretraining baselines with hard-coded adaptation by 18% on average across all datasets and label counts in in-context learning setups.
- It improves performance by 32.6% on average over standard fine-tuning with limited labeled data when using in-context learning.
- The model achieves 69.07% accuracy on paper category classification in a 5-way setting on arXiv, surpassing TENT (65.13%) despite never being trained on that task.
- Performance improves with more in-context examples, demonstrating effective reasoning over prompt patterns beyond the pretraining distribution.
- Scaling pretraining data consistently improves PRODIGY’s performance, while the contrastive baseline saturates quickly.
- Ablation studies show attribute prediction is the most impactful component, with its removal causing a 7% average performance drop.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.