Prefix-Tuning: Optimizing Continuous Prompts for Generation

Xiang Lisa Li, Percy Liang
1/1/2021
cs.CL

Official code: XiangLi1999/PrefixTuning (960 stars, last commit 2024-04-26).

Abstract

Fine-tuning is the de facto way to leverage large pretrained language models to perform downstream tasks. However, it modifies all the language model parameters and therefore necessitates storing a full copy for each task. In this paper, we propose prefix-tuning, a lightweight alternative to fine-tuning for natural language generation tasks, which keeps language model parameters frozen, but optimizes a small continuous task-specific vector (called the prefix). Prefix-tuning draws inspiration from prompting, allowing subsequent tokens to attend to this prefix as if it were "virtual tokens". We apply prefix-tuning to GPT-2 for table-to-text generation and to BART for summarization. We find that by learning only 0.1\% of the parameters, prefix-tuning obtains comparable performance in the full data setting, outperforms fine-tuning in low-data settings, and extrapolates better to examples with topics unseen during training.

View on arXivView PDF

Code Implementations(1)

Prefix-Tuning: Optimizing Continuous Prompts for Generation

960166Shell, PythonJan 21, 20212 years ago

Similar Papers

Cite this paper

@article{li2021prefixtuning,
  title  = {Prefix-Tuning: Optimizing Continuous Prompts for Generation},
  author = {Xiang Lisa Li and Percy Liang},
  year   = {2021},
  eprint = {2101.00190},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2101.00190}
}

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/2101.00190.svg)](https://codeofpaper.com/paper/2101.00190)

Discussion