A Simple Graph Contrastive Learning Framework for Short Text Classification

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

Abstract

Short Text Classification (STC) is a critical task in natural language processing, yet it remains challenging due to semantic sparsity and the high cost of data labeling. While recent advancements in Graph Neural Networks (GNNs) and Contrastive Learning (CL) have improved performance, they typically rely on stochastic data augmentation techniques that can corrupt the fragile semantics of short texts. We introduce SimSTC, a simple graph contrastive learning framework that avoids artificial noise by constructing three natural views of text: semantic (word graph), syntactic (POS graph), and auxiliary (entity graph). By performing multi-view contrastive learning across these perspectives, SimSTC captures richer discriminative information. Our evaluation across four benchmark datasets demonstrates that SimSTC consistently outperforms specialized graph models and even massive Large Language Models (LLMs) on domain-specific tasks, all while maintaining extreme parameter efficiency.

Introduction: The Sparsity and Scarcity Dilemma

Short Text Classification involves categorizing brief snippets such as tweets, search queries, or technical headlines. These texts suffer from semantic sparsity, where the lack of context makes disambiguation difficult, and label scarcity, as manual annotation is often impractical at scale.

Current state-of-the-art methods often combine GNNs with Contrastive Learning. However, these models usually generate "different views" of the same text through random perturbations, such as word deletion or edge dropping. In short texts, such augmentations are risky; removing a single word like "not" can completely invert the sentiment of a sentence, leading to semantic corruption. Furthermore, most existing CL frameworks are limited to dual-view comparisons, failing to exploit the synergy between multiple information sources.

The SimSTC Framework

SimSTC (Simple graph contrastive learning for Short Text Classification) addresses these issues by generating multiple views naturally during graph construction. Instead of adding noise, it views the text through different structural lenses.

The overall architecture of SimSTC, illustrating the flow from raw corpus to multi-view graph construction, GCN processing, and the final contrastive learning objective.

The framework operates in four primary stages:

  1. Multi-View Graph Construction: Three distinct graphs are built from the corpus. The Word Graph uses Point-wise Mutual Information (PMI) to capture global semantic relationships. The POS Graph uses Part-of-Speech tags to provide syntactic structure. The Entity Graph links text to external knowledge via the NELL knowledge base.
  2. Representation Learning: Graph Convolutional Networks (GCNs) are employed to learn high-quality embeddings for nodes within each graph.
  3. Information Aggregation: Each short text is mapped to these views using view-specific adjacency matrices (TF-IDF for words/POS and binary presence for entities), resulting in three distinct embeddings ($Z_w, Z_p, Z_e$).
  4. Multi-View Contrastive Learning: SimSTC pulls the different representations of the same text closer in a shared latent space while pushing representations of different texts apart. This approach is theoretically grounded; the authors provide proof that multi-view CL provides a tighter lower bound on mutual information compared to standard dual-view methods.

Experimental Evaluation

We evaluated SimSTC on four benchmarks: Twitter, MR, Snippets, and StackOverflow. To simulate real-world label scarcity, we used extremely low training ratios, such as only 40 labels per class for the Twitter and MR datasets.

Performance comparison of SimSTC against various baselines, including traditional deep learning models, specialized graph models, and state-of-the-art LLMs.

Outperforming LLMs on Domain-Specific Tasks

One of the most striking findings is SimSTC's performance relative to Large Language Models like Llama-3 and GPT-3.5. While LLMs excel at general sentiment tasks (Twitter/MR), they struggle with domain-specific short texts. On the Snippets dataset, SimSTC achieved 85.14% accuracy, significantly higher than Llama3-8B (75.25%) and GPT-3.5 (66.50%). This suggests that structured graph representations and external knowledge bases can capture niche semantics that broad pre-training might overlook.

Efficiency and Scalability

Beyond accuracy, SimSTC is remarkably efficient. For the StackOverflow dataset, SimSTC utilizes only 1.46% of the trainable parameters required by a fine-tuned Llama-3 model. This efficiency makes it a viable alternative for organizations with limited computational resources or those dealing with highly specialized domains where fine-tuning massive models is cost-prohibitive.

Conclusion

SimSTC demonstrates that "natural" data augmentation through multi-view graph construction is a superior alternative to stochastic noise for short text classification. By integrating semantic, syntactic, and auxiliary information, the framework overcomes the limitations of semantic sparsity and label scarcity. Future work will explore additional views, such as emotional tone or logical structure, to further enhance the multi-view contrastive process.

Summary updated

BibTeX
@inproceedings{liu2025simple,
  author = {Yonghao Liu and Fausto Giunchiglia and Lan Huang and Ximing Li and Xiaoyue Feng and Renchu Guan},
  title = {{A Simple Graph Contrastive Learning Framework for Short Text Classification}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i18.34093},
}
Figure