PERFECT: Prompt-free and Efficient Few-shot Learning with Language Models

Rabeeh Karimi Mahabadi, Luke Zettlemoyer, James Henderson, Marzieh Saeidi, Lambert Mathias +2 more
4/3/2022
79 citations
cs.CL

Official code: facebookresearch/perfect (106 stars, Python, Apache-2.0, last commit 2025-12-16).

Abstract

Current methods for few-shot fine-tuning of pretrained masked language models (PLMs) require carefully engineered prompts and verbalizers for each new task to convert examples into a cloze-format that the PLM can score. In this work, we propose PERFECT, a simple and efficient method for few-shot fine-tuning of PLMs without relying on any such handcrafting, which is highly effective given as few as 32 data points.

Show full abstract

PERFECT makes two key design choices: First, we show that manually engineered task prompts can be replaced with task-specific adapters that enable sample-efficient fine-tuning and reduce memory and storage costs by roughly factors of 5 and 100, respectively. Second, instead of using handcrafted verbalizers, we learn new multi-token label embeddings during fine-tuning, which are not tied to the model vocabulary and which allow us to avoid complex auto-regressive decoding. These embeddings are not only learnable from limited data but also enable nearly 100x faster training and inference. Experiments on a wide range of few-shot NLP tasks demonstrate that PERFECT, while being simple and efficient, also outperforms existing state-of-the-art few-shot learning methods. Our code is publicly available at https://github.com/facebookresearch/perfect.git.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

PERFECT: Prompt-free and Efficient Few-shot Learning with Language Models

10624Python, ShellApr 14, 202211 months agoApache-2.0

Similar Papers

Cite this paper

@article{mahabadi2022perfect,
  title  = {PERFECT: Prompt-free and Efficient Few-shot Learning with Language Models},
  author = {Rabeeh Karimi Mahabadi and Luke Zettlemoyer and James Henderson and Marzieh Saeidi and Lambert Mathias and Veselin Stoyanov and Majid Yazdani},
  year   = {2022},
  eprint = {2204.01172},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2204.01172}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2204.01172.svg)](https://codeofpaper.com/paper/2204.01172)

Discussion