[Paper Review] PERFECT: Prompt-free and Efficient Few-shot Learning with Language Models
This paper proposes Perfect, a prompt-free and efficient few-shot learning method for fine-tuning pretrained language models (PLMs) that eliminates the need for handcrafted prompts and verbalizers. By using task-specific adapters and learnable multi-token label embeddings, Perfect achieves state-of-the-art performance on 12 NLP benchmarks with as few as 32 examples, while reducing training time by up to 100x and storage costs by 100x compared to prior methods.
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. 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.
Motivation & Objective
- To eliminate the need for manual prompt and verbalizer engineering in few-shot fine-tuning of pretrained language models.
- To improve sample efficiency and training stability in low-resource settings with as few as 32 examples.
- To reduce memory, storage, and inference costs compared to prompt-based fine-tuning methods.
- To develop a simple, generalizable framework that outperforms existing prompt-based and adapter-based few-shot learning approaches.
- To demonstrate that effective few-shot learning can be achieved without task-specific prompting or verbalization.
Proposed method
- Replaces handcrafted prompts with task-specific adapter layers inserted into the transformer architecture, freezing the main PLM weights and fine-tuning only the adapters.
- Introduces a learnable, multi-token, fixed-length label embedding for each class that is independent of the model’s vocabulary and trained end-to-end during fine-tuning.
- Uses a prototypical network over multiple tokens to compute logits without requiring auto-regressive decoding, enabling faster inference.
- Employs a masked language modeling objective with dynamic mask token insertion, where the number of masks is tuned per task for optimal performance.
- Applies a contrastive learning objective over the label embeddings to improve generalization in low-shot regimes.
- Uses a small validation set (16 examples) to tune hyperparameters, aligning with the few-shot learning setting.
Experimental results
Research questions
- RQ1Can few-shot learning with PLMs be achieved without handcrafted prompts and verbalizers?
- RQ2Can task-specific adapters enable sample-efficient fine-tuning while reducing memory and storage costs?
- RQ3Can learnable multi-token label embeddings outperform manually designed verbalizers in low-shot settings?
- RQ4Does eliminating auto-regressive decoding for label prediction lead to significant speedups without performance loss?
- RQ5Can a prompt-free, adapter-based method achieve state-of-the-art performance on diverse few-shot NLP benchmarks?
Key findings
- Perfect achieves state-of-the-art performance across 12 diverse NLP benchmarks, outperforming existing prompt-based methods.
- On the SST-2 dataset, Perfect achieves 90.7% test accuracy with 32-shot learning, outperforming the baseline without adapters by 2.5 percentage points.
- Training with Perfect is up to 100x faster than methods requiring auto-regressive decoding, and storage costs are reduced by a factor of 100.
- The method reduces variance in performance across different few-shot training sets and improves worst-case accuracy, indicating greater stability.
- The use of adapters reduces the number of trainable parameters significantly, enabling better sample efficiency and improved convergence in low-data regimes.
- The optimal number of mask tokens varies by task, with two masks performing best on most tasks, though some tasks (e.g., MRPC) benefit from more.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.