Improved Graph Contrastive Learning for Short Text Classification

Yonghao Liu, Lan Huang, Fausto Giunchiglia, Xiaoyue Feng, Renchu Guan

Abstract

Short text classification (STC) is hindered by semantic sparsity and the high cost of data labeling. This paper introduces GIFT (Improved Graph contrastIve learnIng for short text classiFicaTion), a framework designed to enhance STC through heterogeneous graph construction and refined contrastive learning. GIFT addresses the limitations of traditional graph contrastive learning—specifically destructive random augmentations and the false negative problem—by employing Singular Value Decomposition (SVD) for stable data augmentation and a constrained seed k-means approach for cluster-oriented learning. Experimental results across four benchmark datasets demonstrate that GIFT significantly outperforms existing state-of-the-art models in few-shot scenarios.

Introduction

Short texts, such as search queries, news headlines, and social media posts, are inherently difficult to classify due to their lack of context, a phenomenon known as semantic sparsity. While Graph Contrastive Learning (GCL) has emerged as a promising solution by learning representations from augmented views of data, it faces two critical challenges: destructive augmentation and the false negative problem. Randomly dropping nodes or edges can inadvertently strip a short text of its core meaning, while treating all distinct instances as negatives can force semantically similar texts apart in the embedding space.

The GIFT Framework

The proposed GIFT framework mitigates these issues through a multi-faceted approach to graph construction and representation learning.

Overview of the GIFT framework architecture, illustrating the pipeline from heterogeneous graph construction to cluster-oriented contrastive learning.

Heterogeneous Graph Construction

To overcome sparsity, GIFT builds a complex graph incorporating three distinct types of information:

  • Word Graph: Captures internal semantic relationships within the corpus.
  • Entity Graph: Integrates external knowledge using TransE embeddings to provide missing context.
  • POS Tag Graph: Utilizes syntactic roles (e.g., nouns, verbs) to disambiguate word meanings based on their structural function.

SVD-based Augmentation

Instead of relying on stochastic random masking, GIFT utilizes Singular Value Decomposition (SVD) on term-document matrices. By retaining only the top singular values, the model creates a denoised, low-rank approximation of the graph. This serves as a stable, semantically preserved "augmented view" for contrastive learning, capturing global co-occurrence signals that random methods miss.

Visualization of links in original vs. SVD-based word/entity-document matrices, showing how SVD helps rebuild semantically related connections.

Cluster-oriented Contrastive Learning

To address the false negative problem, GIFT employs constrained seed k-means. By using a small set of labeled samples as "seeds," the model clusters unlabeled data to generate weak labels. This allows for contrastive learning at the cluster level, ensuring that texts belonging to the same latent category are pulled together in the representation space.

Experimental Evaluation

The model was evaluated on four standard STC benchmarks: Twitter (sentiment analysis), MR (movie reviews), Snippets (search results), and StackOverflow (technical titles). To simulate real-world data scarcity, the researchers adopted a few-shot setup, using only 40 labeled samples per category for training.

Results and Discussion

GIFT achieved state-of-the-art (SOTA) results across all datasets, notably outperforming large-scale pre-trained models like BERT and RoBERTa, as well as specialized graph models like HGAT.

  • Performance Gains: On the Twitter dataset, GIFT reached 73.16% accuracy, significantly higher than RoBERTa's 56.02%.
  • Macro-F1 Improvements: The model showed superior performance in Macro-F1 scores, indicating high robustness against class imbalances.
  • Ablation Insights: Studies confirmed that both the SVD-based augmentation and the inclusion of POS/Entity graphs are critical; removing any of these components led to a measurable decline in classification performance.

Conclusion

GIFT represents a significant advancement in short text classification by moving away from noisy, random augmentations toward structured, SVD-based denoising. By integrating external knowledge and guiding contrastive learning with constrained clustering, GIFT effectively overcomes the semantic sparsity inherent in short-form text. Future work may explore scaling SVD-based augmentations for massive industrial datasets and refining the integration of evolving external knowledge bases.

Summary updated

BibTeX
@inproceedings{liu2024improved,
  author = {Yonghao Liu and Lan Huang and Fausto Giunchiglia and Xiaoyue Feng and Renchu Guan},
  title = {{Improved Graph Contrastive Learning for Short Text Classification}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i17.29835},
}
Figure