Graph Contrastive Learning Meets Graph Meta Learning: A Unified Method for Few-shot Node Tasks

Hao Liu, Jiarui Feng, Lecheng Kong, Dacheng Tao, Yixin Chen, Muhan Zhang

Abstract

Few-shot transductive node classification (FSNC) is a critical task in graph machine learning, particularly when labeled data is scarce. Traditional approaches rely either on meta-learning, which is often "label-hungry," or graph contrastive learning (GCL), which lacks task-specific optimization. We introduce COLA (COntrastive Few-Shot Node CLAssification), a novel framework that unifies these paradigms. By constructing "label-free" meta-tasks using graph augmentations, COLA leverages the entire graph structure to learn robust representations. Our evaluation across six benchmark datasets demonstrates that COLA achieves new state-of-the-art results, outperforming traditional meta-learning and contrastive methods by significant margins.

Introduction

In many real-world graph scenarios—such as identifying rare diseases in biological networks or detecting novel fraud patterns—labeled examples are extremely limited. This challenge is addressed by Few-Shot Transductive Node Classification (FSNC). Historically, meta-learning has been the dominant approach, training models on various "mini-tasks" to learn generalizable patterns. However, recent research suggests that Graph Contrastive Learning (GCL), a self-supervised method, can outperform meta-learning when followed by simple fine-tuning.

The gap lies in the limitations of each: meta-learning requires ground-truth labels to build training tasks, restricting it to small portions of a graph, while GCL lacks the task-based flexibility of meta-learning. COLA bridges this divide by using graph augmentations to discover semantic similarities without human labels, effectively turning the entire graph into a training ground for meta-tasks.

Methodology: The COLA Framework

The core innovation of COLA is the construction of meta-tasks without relying on ground-truth labels. Instead, it uses graph augmentations to discover "pseudo-neighbors" that serve as synthetic classes.

The COLA architecture utilizes three graph views and a momentum encoder to discover pseudo-neighbors for supervised contrastive learning.

As shown in the architecture above, the process involves:

  1. Three Views of the Graph: For every training step, the model creates three augmented versions of the graph (via edge dropping or feature masking) to generate Lookup, Support, and Query embeddings.
  2. Momentum Encoder: To ensure training stability and avoid the "moving target" problem, Lookup and Support embeddings are generated by a Momentum Encoder that updates slowly over time.
  3. Pseudo-Neighbor Discovery: To build a meta-task for a query node, the model identifies the $k$ most similar nodes in the Support view based on the Lookup view. These nodes form the "support set" for that query.
  4. Supervised Contrastive Loss: The model is trained to minimize the distance between a query node and its discovered support set while maximizing the distance from nodes associated with other queries.

Experimental Results

COLA was evaluated on six diverse benchmarks, including citation networks (Cora, CiteSeer, CoraFull, ogbn-arxiv), product networks (Amazon-Computer), and collaboration networks (Coauthor-CS). Notably, COLA proved highly efficient, successfully running on the large-scale ogbn-arxiv dataset where many previous contrastive methods encountered Out-of-Memory (OOM) errors.

COLA consistently outperforms both meta-learning and graph contrastive learning baselines across multiple few-shot tasks.

As detailed in the results table, COLA consistently outperformed both traditional meta-learning and modern contrastive learning baselines:

  • Significant Performance Gains: On CoraFull, COLA improved 5-way 1-shot accuracy to 74.36%, a massive jump from the ~55% achieved by Meta-GNN.
  • State-of-the-Art Benchmarking: It surpassed SUGRL, the previous leading contrastive method, by 3-5% in absolute accuracy across most tasks.
  • Semantic Learning: Analysis shows that the "True Label Ratio"—the percentage of discovered support nodes belonging to the same actual class as the query—increases steadily during training, confirming that COLA successfully captures underlying graph semantics.

Discussion and Future Work

A key insight from this work is that COLA acts as a powerful regularizer. By using unlabeled nodes from the entire graph to build tasks, it prevents the model from overfitting to specific training classes. Furthermore, the research indicates that while standard contrastive learning benefits from many negative samples, few-shot tasks require a more balanced approach, which COLA provides through its unified loss.

Future research directions include exploring more complex, learnable graph augmentations tailored to specific domains and investigating alternative loss formulations to further refine the task-based optimization process.

Summary updated

BibTeX
@inproceedings{liu2023graph,
  author = {Hao Liu and Jiarui Feng and Lecheng Kong and Dacheng Tao and Yixin Chen and Muhan Zhang},
  title = {{Graph Contrastive Learning Meets Graph Meta Learning: A Unified Method for Few-shot Node Tasks}},
  booktitle = {The Web Conference},
  year = {2023},
}
Figure