Contrastive Learning for Prompt-Based Few-Shot Language Learners

05/03/2022
by   Yiren Jian, et al.
0

The impressive performance of GPT-3 using natural language prompts and in-context learning has inspired work on better fine-tuning of moderately-sized models under this paradigm. Following this line of work, we present a contrastive learning framework that clusters inputs from the same class for better generality of models trained with only limited examples. Specifically, we propose a supervised contrastive framework that clusters inputs from the same class under different augmented "views" and repel the ones from different classes. We create different "views" of an example by appending it with different language prompts and contextual demonstrations. Combining a contrastive loss with the standard masked language modeling (MLM) loss in prompt-based few-shot learners, the experimental results show that our method can improve over the state-of-the-art methods in a diverse set of 15 language tasks. Our framework makes minimal assumptions on the task or the base model, and can be applied to many recent methods with little modification. The code will be made available at: https://github.com/yiren-jian/LM-SupCon.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
12/14/2022

MA-GCL: Model Augmentation Tricks for Graph Contrastive Learning

Contrastive learning (CL), which can extract the information shared betw...
research
03/03/2023

Prompt, Generate, then Cache: Cascade of Foundation Models makes Strong Few-shot Learners

Visual recognition in low-data regimes requires deep neural networks to ...
research
04/02/2023

Learning with Fantasy: Semantic-Aware Virtual Contrastive Constraint for Few-Shot Class-Incremental Learning

Few-shot class-incremental learning (FSCIL) aims at learning to classify...
research
06/14/2023

Generate to Understand for Representation

In recent years, a significant number of high-quality pretrained models ...
research
11/29/2022

Textual Enhanced Contrastive Learning for Solving Math Word Problems

Solving math word problems is the task that analyses the relation of qua...
research
11/08/2022

ConsPrompt: Easily Exploiting Contrastive Samples for Few-shot Prompt Learning

Prompt learning recently become an effective linguistic tool to motivate...
research
07/31/2023

Contrastive Learning for API Aspect Analysis

We present a novel approach - CLAA - for API aspect detection in API rev...

Please sign up or login with your details

Forgot password? Click here to reset