Papers › Making Pre-trained Language Models Better Few-shot Learners

Making Pre-trained Language Models Better Few-shot Learners

31 Dec 2020ACL 2021 5arXiv:2012.15723archive 2025-07-28

Tianyu Gao, Adam Fisch, Danqi Chen

The recent GPT-3 model (Brown et al., 2020) achieves remarkable few-shot performance solely by leveraging a natural-language prompt and a few task demonstrations as input context. Inspired by their findings, we study few-shot learning in a more practical scenario, where we use smaller language models for which fine-tuning is computationally efficient. We present LM-BFF--better few-shot fine-tuning of language models--a suite of simple and complementary techniques for fine-tuning language models on a small number of annotated examples. Our approach includes (1) prompt-based fine-tuning together with a novel pipeline for automating prompt generation; and (2) a refined strategy for dynamically and selectively incorporating demonstrations into each context. Finally, we present a systematic evaluation for analyzing few-shot performance on a range of NLP tasks, including classification and regression. Our experiments demonstrate that our methods combine to dramatically outperform standard fine-tuning procedures in this low resource setting, achieving up to 30% absolute improvement, and 11% on average across all tasks. Our approach makes minimal assumptions on task resources and domain expertise, and hence constitutes a strong task-agnostic method for few-shot learning.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2012.15723")

Code

Syntology Ran 2 of 9 code samples harvested from 4 repositories linked to this paper; 7 have no recorded run. Of those that ran: 2 ran with no contract checked.

By repository: community (archive-listed): 9 samples from 4 repositories, 2 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

princeton-nlp/LM-BFF officialmentioned in papermentioned on GitHubpytorch report
abdumaa/hiqualprop mentioned on GitHubpytorch report
alrope123/prompt-waywardness mentioned on GitHubpytorch report
facebookresearch/perfect mentioned on GitHubpytorch report
hannight/amulap mentioned on GitHubpytorch report
matthewcym/sflm mentioned on GitHubpytorchMIT report
ucsb-nlp-chang/promptboosting mentioned on GitHubpytorch report
ukplab/emnlp2021-prompt-ft-heuristics mentioned on GitHubpytorch report
zhengxiangshi/powerfulpromptft mentioned on GitHubpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

9 samples harvested; 2 ran; 0 honoured the contract we drafted; 7 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

2ran
7unverified

Licence: 7 of the 9 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 4 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

Adapter facebookresearch/perfect/fewshot/adapters/adapter_modeling.py community (archive-listed) ran · metamorphic tier: invariant Apache-2.0 (permissive) · 848dfe9da2a6b283 · report
SentenceTemplate ucsb-nlp-chang/promptboosting/src/multicls_trainer.py community (archive-listed) ran no licence file found · pointer only · 307acb49942e47f3 · report
BaseMuticlsTrainer ucsb-nlp-chang/promptboosting/src/multicls_trainer.py community (archive-listed) unverified no licence file found · pointer only · bf0624569417a8a0 · report
MyEmbedding alrope123/prompt-waywardness/model_util.py community (archive-listed) unverified no licence file found · pointer only · bfe6f1322cece789 · report
PromptBoostingTrainer ucsb-nlp-chang/promptboosting/src/multicls_trainer.py community (archive-listed) unverified no licence file found · pointer only · 2d2563d117bf30eb · report
RoBERTaVTuningClassification ucsb-nlp-chang/promptboosting/src/multicls_trainer.py community (archive-listed) unverified no licence file found · pointer only · a61da81d2fd7eec9 · report
RobertaForPromptFinetuning hannight/amulap/models.py community (archive-listed) unverified Apache-2.0 (permissive) · 13e2332945c4e127 · report
TestPredictionSaver ucsb-nlp-chang/promptboosting/src/multicls_trainer.py community (archive-listed) unverified no licence file found · pointer only · d6b16c1ebf5bf7fe · report
generate_multicls_l1_label_set_with_cache ucsb-nlp-chang/promptboosting/src/multicls_trainer.py community (archive-listed) unverified no licence file found · pointer only · 7424c5b4dbe4fa38 · report

Tasks

Few-Shot LearningZero-Shot Text Classification

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

AdamAttentionAttention DropoutBPECosine AnnealingDense ConnectionsDropoutGPT-3Layer NormalizationLinear LayerLinear Warmup With Cosine AnnealingMulti-Head AttentionResidual ConnectionSoftmaxWeight Decay

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections