LM-CPPF: Paraphrasing-Guided Data Augmentation for Contrastive Prompt-Based Few-Shot Fine-Tuning

Amirhossein Abaskohi, Sascha Rothe, Yadollah Yaghoobzadeh

Abstract

Few-shot fine-tuning of Pre-trained Language Models (PLMs) often suffers from data scarcity, leading to suboptimal performance. While prompt-based fine-tuning and contrastive learning have shown promise, effective data augmentation in NLP remains a challenge. This paper introduces LM-CPPF (Contrastive Paraphrasing-guided Prompt-based Fine-tuning), a method that utilizes Large Language Models (LLMs) like GPT-3 to generate diverse, meaning-preserving paraphrases. These paraphrases act as augmented views for a supervised contrastive learning objective. Experimental results across six benchmarks demonstrate that LM-CPPF consistently outperforms existing state-of-the-art methods, particularly in extremely low-resource settings.

Introduction

Fine-tuning PLMs on small datasets (e.g., 16 examples per class) is a common challenge. Prompt-based fine-tuning, which reformulates classification as a cloze task, has emerged as a powerful technique. Contrastive learning further enhances this by teaching models to distinguish between similar and dissimilar examples. However, the success of contrastive learning heavily depends on data augmentation. Traditional NLP augmentation methods, such as Easy Data Augmentation (EDA) or Back-Translation, often fail to maintain semantic integrity or provide sufficient diversity. LM-CPPF addresses this by using LLMs to generate high-quality paraphrases that serve as sophisticated augmented views.

Methodology

The LM-CPPF framework integrates two primary training objectives: Masked Language Modeling (MLM) loss and Supervised Contrastive Learning (SCL) loss.

Overview of the LM-CPPF architecture showing the integration of MLM and Contrastive Loss with LLM-generated paraphrases.

The process begins by prompting a "heavyweight" LLM (e.g., GPT-3 or OPT-175B) to generate paraphrases of the input sentences. Unlike previous methods that merely change the prompt template (the "wrapper"), LM-CPPF modifies the input content itself. The MLM loss handles the standard prompt-based classification, while the SCL loss ensures that the embeddings of a sentence and its paraphrase are pulled together in the vector space, while being pushed away from sentences belonging to different classes.

Experimental Setup

The authors evaluated LM-CPPF on six standard benchmarks: SST-2, SST-5, MNLI, QNLI, CoLA, and CR. Each task was restricted to 16 training examples per class. The primary baseline was LM-BFF, the previous state-of-the-art in few-shot prompt-based fine-tuning.

Results

LM-CPPF achieved significant performance gains across all evaluated tasks.

Performance comparison of LM-CPPF against baselines across six NLP benchmarks.

As shown in the results table, LM-CPPF with GPT-3 augmentation consistently provided the highest accuracy. Notably, on the CoLA dataset, performance improved from 6.9% to 14.1%. The method also proved superior to traditional augmentation strategies like Back-Translation and EDA. While GPT-3 yielded the best results, the use of other LLMs like OPT-175B also showed substantial improvements over the baseline, highlighting the generalizability of the paraphrasing-guided approach.

Conclusion and Limitations

LM-CPPF demonstrates that high-quality, LLM-generated paraphrases can significantly boost the effectiveness of contrastive learning in few-shot scenarios. By focusing on content-level augmentation rather than template-level changes, the model learns more robust representations. However, the approach is currently limited by the cost and accessibility of large-scale APIs like GPT-3. Future research may focus on utilizing smaller, open-source models for the augmentation step or automating the selection of paraphrase-priming examples to reduce human intervention.

Summary updated

BibTeX
@inproceedings{abaskohi2023lm,
  author = {Amirhossein Abaskohi and Sascha Rothe and Yadollah Yaghoobzadeh},
  title = {{LM-CPPF: Paraphrasing-Guided Data Augmentation for Contrastive Prompt-Based Few-Shot Fine-Tuning}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.acl-short.59},
}
Figure