Contrastive Learning for Prompt-Based Few-Shot Language Learners

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 bet...

Ausführliche Beschreibung

Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Jian, Yiren, Gao, Chongyang, Vosoughi, Soroush
Format: Artikel
Sprache:eng
Schlagworte:
Online-Zugang:Volltext bestellen
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
container_end_page
container_issue
container_start_page
container_title
container_volume
creator Jian, Yiren
Gao, Chongyang
Vosoughi, Soroush
description 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.
doi_str_mv 10.48550/arxiv.2205.01308
format Article
fullrecord <record><control><sourceid>arxiv_GOX</sourceid><recordid>TN_cdi_arxiv_primary_2205_01308</recordid><sourceformat>XML</sourceformat><sourcesystem>PC</sourcesystem><sourcerecordid>2205_01308</sourcerecordid><originalsourceid>FETCH-LOGICAL-a678-8da35c09afe15233a9be4e6c90436b1f0fdf4c62f28eccb3927646bb3ee03b0a3</originalsourceid><addsrcrecordid>eNotz0FOwzAQhWFvWKDCAVjhCzhMPLbr7ICIAlIkkOg-GjvjEIkmlRMK3B5RunqbX0_6hLgqoTDeWrih_D0cCq3BFlAi-HNxW0_jkmlehgPLhimPw9jLNGX5mqfdflH3NHMnN_yl3t6nRTY09p_Un1rO84U4S_Qx8-VpV2K7edjWT6p5eXyu7xpFbu2V7whthIoSl1YjUhXYsIsVGHShTJC6ZKLTSXuOMWCl1864EJAZMADhSlz_3x4J7T4PO8o_7R-lPVLwFwr1RAw</addsrcrecordid><sourcetype>Open Access Repository</sourcetype><iscdi>true</iscdi><recordtype>article</recordtype></control><display><type>article</type><title>Contrastive Learning for Prompt-Based Few-Shot Language Learners</title><source>arXiv.org</source><creator>Jian, Yiren ; Gao, Chongyang ; Vosoughi, Soroush</creator><creatorcontrib>Jian, Yiren ; Gao, Chongyang ; Vosoughi, Soroush</creatorcontrib><description>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.</description><identifier>DOI: 10.48550/arxiv.2205.01308</identifier><language>eng</language><subject>Computer Science - Artificial Intelligence ; Computer Science - Computation and Language</subject><creationdate>2022-05</creationdate><rights>http://arxiv.org/licenses/nonexclusive-distrib/1.0</rights><oa>free_for_read</oa><woscitedreferencessubscribed>false</woscitedreferencessubscribed></display><links><openurl>$$Topenurl_article</openurl><openurlfulltext>$$Topenurlfull_article</openurlfulltext><thumbnail>$$Tsyndetics_thumb_exl</thumbnail><link.rule.ids>228,230,778,883</link.rule.ids><linktorsrc>$$Uhttps://arxiv.org/abs/2205.01308$$EView_record_in_Cornell_University$$FView_record_in_$$GCornell_University$$Hfree_for_read</linktorsrc><backlink>$$Uhttps://doi.org/10.48550/arXiv.2205.01308$$DView paper in arXiv$$Hfree_for_read</backlink></links><search><creatorcontrib>Jian, Yiren</creatorcontrib><creatorcontrib>Gao, Chongyang</creatorcontrib><creatorcontrib>Vosoughi, Soroush</creatorcontrib><title>Contrastive Learning for Prompt-Based Few-Shot Language Learners</title><description>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.</description><subject>Computer Science - Artificial Intelligence</subject><subject>Computer Science - Computation and Language</subject><fulltext>true</fulltext><rsrctype>article</rsrctype><creationdate>2022</creationdate><recordtype>article</recordtype><sourceid>GOX</sourceid><recordid>eNotz0FOwzAQhWFvWKDCAVjhCzhMPLbr7ICIAlIkkOg-GjvjEIkmlRMK3B5RunqbX0_6hLgqoTDeWrih_D0cCq3BFlAi-HNxW0_jkmlehgPLhimPw9jLNGX5mqfdflH3NHMnN_yl3t6nRTY09p_Un1rO84U4S_Qx8-VpV2K7edjWT6p5eXyu7xpFbu2V7whthIoSl1YjUhXYsIsVGHShTJC6ZKLTSXuOMWCl1864EJAZMADhSlz_3x4J7T4PO8o_7R-lPVLwFwr1RAw</recordid><startdate>20220503</startdate><enddate>20220503</enddate><creator>Jian, Yiren</creator><creator>Gao, Chongyang</creator><creator>Vosoughi, Soroush</creator><scope>AKY</scope><scope>GOX</scope></search><sort><creationdate>20220503</creationdate><title>Contrastive Learning for Prompt-Based Few-Shot Language Learners</title><author>Jian, Yiren ; Gao, Chongyang ; Vosoughi, Soroush</author></sort><facets><frbrtype>5</frbrtype><frbrgroupid>cdi_FETCH-LOGICAL-a678-8da35c09afe15233a9be4e6c90436b1f0fdf4c62f28eccb3927646bb3ee03b0a3</frbrgroupid><rsrctype>articles</rsrctype><prefilter>articles</prefilter><language>eng</language><creationdate>2022</creationdate><topic>Computer Science - Artificial Intelligence</topic><topic>Computer Science - Computation and Language</topic><toplevel>online_resources</toplevel><creatorcontrib>Jian, Yiren</creatorcontrib><creatorcontrib>Gao, Chongyang</creatorcontrib><creatorcontrib>Vosoughi, Soroush</creatorcontrib><collection>arXiv Computer Science</collection><collection>arXiv.org</collection></facets><delivery><delcategory>Remote Search Resource</delcategory><fulltext>fulltext_linktorsrc</fulltext></delivery><addata><au>Jian, Yiren</au><au>Gao, Chongyang</au><au>Vosoughi, Soroush</au><format>journal</format><genre>article</genre><ristype>JOUR</ristype><atitle>Contrastive Learning for Prompt-Based Few-Shot Language Learners</atitle><date>2022-05-03</date><risdate>2022</risdate><abstract>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.</abstract><doi>10.48550/arxiv.2205.01308</doi><oa>free_for_read</oa></addata></record>
fulltext fulltext_linktorsrc
identifier DOI: 10.48550/arxiv.2205.01308
ispartof
issn
language eng
recordid cdi_arxiv_primary_2205_01308
source arXiv.org
subjects Computer Science - Artificial Intelligence
Computer Science - Computation and Language
title Contrastive Learning for Prompt-Based Few-Shot Language Learners
url https://sfx.bib-bvb.de/sfx_tum?ctx_ver=Z39.88-2004&ctx_enc=info:ofi/enc:UTF-8&ctx_tim=2025-01-16T16%3A30%3A25IST&url_ver=Z39.88-2004&url_ctx_fmt=infofi/fmt:kev:mtx:ctx&rfr_id=info:sid/primo.exlibrisgroup.com:primo3-Article-arxiv_GOX&rft_val_fmt=info:ofi/fmt:kev:mtx:journal&rft.genre=article&rft.atitle=Contrastive%20Learning%20for%20Prompt-Based%20Few-Shot%20Language%20Learners&rft.au=Jian,%20Yiren&rft.date=2022-05-03&rft_id=info:doi/10.48550/arxiv.2205.01308&rft_dat=%3Carxiv_GOX%3E2205_01308%3C/arxiv_GOX%3E%3Curl%3E%3C/url%3E&disable_directlink=true&sfx.directlink=off&sfx.report_link=0&rft_id=info:oai/&rft_id=info:pmid/&rfr_iscdi=true