Learning Cross-Task Generalities Across Graphs via Task-trees

Zehong Wang, Zheyuan Zhang, Tianyi Ma, Nitesh V. Chawla, Chuxu Zhang, Yanfang Ye

Abstract

Building foundation models for graph-structured data is complicated by structural and task heterogeneity. While text and images have universal "tokens," graphs lack a unified representation that spans different domains and task levels (node, edge, and graph). This paper introduces the Task-Tree, a novel structure that aligns diverse graph tasks into a single format by introducing virtual task nodes. Based on this, the authors develop GIT (Graph Generality Identifier on Task-Trees), a foundation model capable of learning cross-task generalities. Evaluated on 32 datasets across five domains, GIT demonstrates superior zero-shot generalization and state-of-the-art performance, marking a significant step toward a universal graph foundation model.

Introduction

In the current AI landscape, foundation models like GPT-4 and Stable Diffusion have revolutionized text and image processing by learning "generalities"—universal patterns that apply across datasets. Graph-structured data, however, remains a stubborn frontier due to its inherent heterogeneity. A social network's connectivity bears little resemblance to a protein molecule's structure, and classifying a single node is mathematically distinct from predicting a whole graph's property. This paper addresses these challenges by proposing a "universal token" for graphs: the Task-Tree.

The Challenge of Graph Heterogeneity

The primary obstacles to a Graph Foundation Model (GFM) are two-fold:

  1. Structural Heterogeneity: Graphs from different domains (e.g., citation networks vs. chemical compounds) exhibit vastly different connectivity patterns.
  2. Task Heterogeneity: Traditional Graph Neural Networks (GNNs) treat node classification, link prediction, and graph classification as separate mathematical problems, preventing a single model from learning shared representations across them.

Methodology: The Task-Tree Framework

The core innovation of this work is the Task-Tree, which provides a unified interface for any graph task, regardless of its level.

Figure 1: The Task-Tree construction process unifies node, edge, and graph tasks into a single tree-based representation by appending a virtual task node.

Task-Tree Construction

For any given task, the authors identify "task-relevant nodes"—such as the target node in node classification or the two endpoints of a potential edge in link prediction. A virtual task node is then appended to the graph and connected to these relevant nodes via virtual links. The resulting computation tree, rooted at this virtual node, effectively transforms any task into a node-level embedding problem at the root. This allows the model to treat molecules and social networks identically as trees of information.

Model Architecture: GIT

The framework consists of two main stages:

  • GIT-G (General Pretraining): The model is pretrained using a self-supervised reconstruction objective. By processing "corrupted" views of task-trees (randomly masking edges and attributes), the model learns to capture corruption-invariant structural and feature-based patterns.
  • GIT-S (Specialization via Instruction Tuning): To bridge the gap to specific domains, the authors employ Instruction Tuning (SFT). Large Language Models (LLMs) encode label descriptions into embeddings, and GIT is fine-tuned to align its task-tree representations with these textual "instructions," creating a specialized version of the model.

Experimental Evaluation

The study utilizes a massive benchmark of 32 text-attributed graphs (TAGs) across five domains, including academic networks, e-commerce, knowledge graphs, molecular graphs, and temporal graphs.

Key Results

  • Zero-Shot Generalization: GIT-S significantly outperformed existing models like OFA and GraphMAE in zero-shot settings, showing an average improvement of approximately 10% on held-out datasets.
  • Few-Shot Performance: In 3-shot scenarios, GIT-S achieved an average accuracy of 60.15%, surpassing both supervised GNNs and other foundation models.
  • Scalability: Experiments on a synthetic dataset with 15 million nodes and nearly a billion edges showed that the task-tree approach is ~2.4x faster than traditional subgraph-based methods, which often require expensive preprocessing to "crop" the graph.

Discussion and Insights

The Task-Tree approach offers several advantages. By using a virtual task node, the model provides a "universal interface" for graphs. Unlike subgraph-based methods, task-trees are computationally efficient, requiring only the addition of a few virtual elements to the existing graph structure.

However, limitations remain. Converting complex, loopy graphs into trees via computation trees inherently loses some structural information, such as cycles. Furthermore, while the model performs exceptionally well on text-attributed graphs, expanding the instruction logic to purely structural patterns remains an open area for research.

Conclusion

By unifying disparate graph tasks into the Task-Tree format, this work provides a scalable and effective path toward Graph Foundation Models. The GIT model demonstrates that learning generalities across diverse graph domains is not only possible but highly effective for zero-shot and few-shot transfer learning.

Summary updated

BibTeX
@inproceedings{wang2025learning,
  author = {Zehong Wang and Zheyuan Zhang and Tianyi Ma and Nitesh V. Chawla and Chuxu Zhang and Yanfang Ye},
  title = {{Learning Cross-Task Generalities Across Graphs via Task-trees}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=BSqf2k01ag},
}
Figure