GPT Understands, Too
Written for the Research library (claude-opus-5-5) from the paper text. Original — arxiv.org/pdf/2103.10385
Summary
Hand-written natural-language prompts help pretrained language models on NLU tasks, but the authors show these prompts are fragile. Swapping a single word in a template can move accuracy by roughly 20 points. Automatic prompt search finds stronger templates, yet it still operates over discrete tokens, so the fragility persists and gradient information is only partly used. The paper proposes P-Tuning, which places trainable continuous vectors ("pseudo" prompt tokens) next to the ordinary discrete prompt words and optimizes them by backpropagation on the task objective. A small prompt encoder, either an LSTM or an MLP, produces these vectors so they are not learned in isolation. Experiments cover LAMA knowledge probing with frozen models and SuperGLUE with fine-tuned models, in both few-shot and fully-supervised settings. P-Tuning improves scores and greatly reduces the variation between manual templates. It beats hand-crafted and searched prompts on LAMA and outperforms PET on SuperGLUE. In practice, adapting a model becomes far less sensitive to exact prompt wording, whether the model is frozen or tuned.
Key points
- On LAMA-TREx P17 with BERT-base-cased, four manual templates ranged from 19.8 to 51.1 precision@1. With P-Tuning, all four reached about 57.8–58.1.
- On LAMA with frozen models, P-Tuning exceeded manual prompts by over 20 points and searched prompts by about 9 points. The standard deviation across templates dropped from 10.1 to 0.46.
- On SuperGLUE with fine-tuned models, P-Tuning outperformed PET using its best discrete prompts, in both few-shot and fully-supervised settings.
- In few-shot ALBERT experiments, LSTM and MLP prompt encoders were reliable. A plain embedding (identity) encoder was unstable, for example CB-F1 of 67.27 versus 84.24 with MLP. On CB, four continuous tokens worked best (avg 86.76), while eight hurt performance (78.40).
- Adding continuous prompts on top of LM-BFF's automatically searched templates gave small gains on MNLI (58.70 vs 57.53) and MRPC (69.49 vs 68.26). Results on SST-2 were roughly unchanged.
Cited by
- On the Opportunities and Risks of Foundation Models
- RLPrompt: Optimizing Discrete Text Prompts with Reinforcement Learning
- Promptbreeder: Self-Referential Self-Improvement Via Prompt Evolution
- Bias and Fairness in Large Language Models: A Survey
- PPT: Pre-trained Prompt Tuning for Few-shot Learning
- Parameter-Efficient Fine-Tuning for Large Models: A Comprehensive Survey
- Towards a Unified View of Parameter-Efficient Transfer Learning
- Few-shot Learning with Multilingual Language Models
- P-Tuning v2: Prompt Tuning Can Be Comparable to Fine-tuning Universally Across Scales and Tasks
- Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processing
- P-Tuning: Prompt Tuning Can Be Comparable to Fine-tuning Across Scales and Tasks
- Generating Training Data with Language Models: Towards Zero-Shot Language Understanding
- Noisy Channel Language Model Prompting for Few-Shot Text Classification
- Recent Advances in Natural Language Processing via Large Pre-Trained Language Models: A Survey
- Reframing Instructional Prompts to GPTk's Language
- A Comprehensive Overview of Large Language Models
- True Few-Shot Learning with Language Models
- Learning How to Ask: Querying LMs with Mixtures of Soft Prompts
- Pre-trained Models for Natural Language Processing: A Survey
- mGPT: Few-Shot Learners Go Multilingual
- SPoT: Better Frozen Model Adaptation through Soft Prompt Transfer
- CogVLM: Visual Expert for Pretrained Language Models
- Baize: An Open-Source Chat Model with Parameter-Efficient Tuning on Self-Chat Data
- Large Language Models as Optimizers
- GPT3Mix: Leveraging Large-scale Language Models for Text Augmentation
- Language Models are Super Mario: Absorbing Abilities from Homologous Models as a Free Lunch
- GLM-130B: An Open Bilingual Pre-trained Model
- Aspect Sentiment Quad Prediction as Paraphrase Generation
- LLaMA-Adapter: Efficient Fine-tuning of Language Models with Zero-init Attention
- A Survey of Large Language Models
- Factual Probing Is [MASK]: Learning vs. Learning to Recall
- Large Language Models Are Human-Level Prompt Engineers
Cite
@misc{liu2021gpt,
title = {{GPT Understands, Too}},
author = {Liu, Xiao and Zheng, Yanan and Du, Zhengxiao and Ding, Ming and Qian, Yujie and Yang, Zhilin and Tang, Jie},
year = {2021},
doi = {10.48550/arxiv.2103.10385},
eprint = {2103.10385},
archivePrefix = {arXiv},
url = {https://doi.org/10.48550/arxiv.2103.10385}
}References
- Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. arXiv preprint arXiv:2005.14165. find
- Christopher Clark, Kenton Lee, Ming-Wei Chang, Tom Kwiatkowski, Michael Collins, and Kristina Toutanova. 2019a. Boolq: Exploring the surprising difficulty of natural yes/no questions. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics… find our card
- Kevin Clark, Urvashi Khandelwal, Omer Levy, and Christopher D Manning. 2019b. What does bert look at? an analysis of bert’s attention. arXiv preprint arXiv:1906.04341. find
- Ido Dagan, Oren Glickman, and Bernardo Magnini. 2005. The pascal recognising textual entailment challenge. In Machine Learning Challenges Workshop, pages 177–190. Springer. find
- Zihang Dai, Zhilin Yang, Yiming Yang, Jaime Carbonell, Quoc V Le, and Ruslan Salakhutdinov. 2019. Transformer-xl: Attentive language models beyond a fixed-length context. arXiv preprint arXiv:1901.02860. find
- Zhengbao Jiang, Frank F Xu, Jun Araki, and Graham Neubig. 2020b. How can we know what language models know? Transactions of the Association for Computational Linguistics, 8:423–438. find our card
- Daniel Khashabi, Snigdha Chaturvedi, Michael Roth, Shyam Upadhyay, and Dan Roth. 2018. Looking beyond the surface: A challenge set for reading comprehension over multiple sentences. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics:… find our card
- Brian Lester, Rami Al-Rfou, and Noah Constant. 2021. The power of scale for parameter-efficient prompt tuning. ArXiv, abs/2104.08691. find
- Hector Levesque, Ernest Davis, and Leora Morgenstern. 2012. The winograd schema challenge. In Thirteenth International Conference on the Principles of Knowledge Representation and Reasoning. Citeseer. find
- Xiang Lisa Li and Percy Liang. 2021. Prefix-tuning: Optimizing continuous prompts for generation. arXiv preprint arXiv:2101.00190. find
- Jiachang Liu, Dinghan Shen, Yizhe Zhang, Bill Dolan, Lawrence Carin, and Weizhu Chen. 2021. What makes good in-context examples for gpt-3? arXiv preprint arXiv:2101.06804. find our card
- Marie-Catherine De Marneffe, Mandy Simons, and Judith Tonhauser. 2019. The commitmentbank: Investigating projection in naturally occurring discourse. In proceedings of Sinn und Bedeutung, volume 23, pages 107–124. find our card
- Xiao Liu, Fanjin Zhang, Zhenyu Hou, Zhaoyu Wang, Li Mian, Jing Zhang, and Jie Tang. 2020. Self-supervised learning: Generative or contrastive. arXiv preprint arXiv:2006.08218, 1(2). — [arXiv:2006.08218](https://arxiv.org/abs/2006.08218) find
- Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805. find
- Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692. find
- Tianyu Gao, Adam Fisch, and Danqi Chen. 2020. Making pre-trained language models better few-shot learners. arXiv preprint arXiv:2012.15723. find our card
- Xu Han, Zhengyan Zhang, Ning Ding, Yuxian Gu, Xiao Liu, Yuqi Huo, Jiezhong Qiu, Liang Zhang, Wentao Han, Minlie Huang, et al. 2021. Pre-trained models: Past, present and future. AI Open. find
- John Hewitt and Christopher D. Manning. 2019. A structural probe for finding syntax in word representations. In North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL). Association for Computational Linguistics. find our card
- Zhengbao Jiang, Antonios Anastasopoulos, Jun Araki, Haibo Ding, and Graham Neubig. 2020a. X-factr: Multilingual factual knowledge retrieval from pre-trained language models. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 5943–5959. find
- Yao Lu, Max Bartolo, Alastair Moore, Sebastian Riedel, and Pontus Stenetorp. 2021. Fantastically ordered prompts and where to find them: Overcoming few-shot prompt order sensitivity. CoRR, abs/2104.08786. find our card
- Fabio Petroni, Patrick Lewis, Aleksandra Piktus, Tim Rocktäschel, Yuxiang Wu, Alexander H Miller, and Sebastian Riedel. 2020. How context affects language models’ factual predictions. arXiv preprint arXiv:2005.04611. find our card
- Fabio Petroni, Tim Rocktäschel, Patrick Lewis, Anton Bakhtin, Yuxiang Wu, Alexander H Miller, and Sebastian Riedel. 2019. Language models as knowledge bases? arXiv preprint arXiv:1909.01066. find our card
- Mohammad Taher Pilehvar and José Camacho-Collados. 2018. Wic: 10, 000 example pairs for evaluating context-sensitive representations. CoRR, abs/1808.09121. find our card
- Guanghui Qin and J. Eisner. 2021. Learning how to ask: Querying lms with mixtures of soft prompts. ArXiv, abs/2104.06599. find our card
- Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9. find
- Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. 2019. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv preprint arXiv:1910.10683. find
- Melissa Roemmele, Cosmin Adrian Bejan, and Andrew S Gordon. 2011. Choice of plausible alternatives: An evaluation of commonsense causal reasoning. In AAAI Spring Symposium: Logical Formalizations of Commonsense Reasoning, pages 90–95. find
- Timo Schick and Hinrich Schütze. 2020. It’s not just size that matters: Small language models are also few-shot learners. Computing Research Repository, arXiv:2009.07118. find our card
- Taylor Shin, Yasaman Razeghi, Robert L Logan IV, Eric Wallace, and Sameer Singh. 2020. Autoprompt: Eliciting knowledge from language models with automatically generated prompts. arXiv preprint arXiv:2010.15980. find our card
- Jesse Vig. 2019. A multiscale visualization of attention in the transformer model. arXiv preprint arXiv:1906.05714. find our card
- Alex Wang, Yada Pruksachatkun, Nikita Nangia, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R Bowman. 2019a. Superglue: A stickier benchmark for general-purpose language understanding systems. arXiv preprint arXiv:1905.00537. find our card
- Alex Wang, Yada Pruksachatkun, Nikita Nangia, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. 2019b. SuperGLUE: A Stickier Benchmark for General-Purpose Language Understanding Systems. In NeurIPS 2019, pages 3261–3275. find our card
- Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. 2018. Glue: A multi-task benchmark and analysis platform for natural language understanding. ArXiv, abs/1804.07461. find our card
- Chenguang Wang, Xiao Liu, and Dawn Song. 2020. Language models are open knowledge graphs. arXiv preprint arXiv:2010.11967. — [arXiv:2010.11967](https://arxiv.org/abs/2010.11967) find
- Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Ruslan Salakhutdinov, and Quoc V Le. 2019. Xlnet: Generalized autoregressive pretraining for language understanding. arXiv preprint arXiv:1906.08237. find our card
- Sheng Zhang, Xiaodong Liu, Jingjing Liu, Jianfeng Gao, Kevin Duh, and Benjamin Van Durme. 2018. Record: Bridging the gap between human and machine commonsense reading comprehension. arXiv preprint arXiv:1810.12885. find our card
- Tianyi Zhang, Felix Wu, Arzoo Katiyar, Kilian Q. Weinberger, and Yoav Artzi. 2020. Revisiting few-sample BERT fine-tuning. CoRR, abs/2006.05987. find our card
- Tony Z. Zhao, Eric Wallace, Shi Feng, Dan Klein, and Sameer Singh. 2021a. Calibrate before use: Improving few-shot performance of language models. CoRR, abs/2102.09690. find our card
- Tony Z Zhao, Eric Wallace, Shi Feng, Dan Klein, and Sameer Singh. 2021b. Calibrate before use: Improving few-shot performance of language models. arXiv preprint arXiv:2102.09690. find our card
- Yanan Zheng, Jing Zhou, Yujie Qian, Ming Ding, Jian Li, Ruslan Salakhutdinov, Jie Tang, Sebastian Ruder, and Zhilin Yang. 2021. Fewnlu: Benchmarking state-of-the-art methods for few-shot natural language understanding. find
- Zexuan Zhong, Dan Friedman, and Danqi Chen. 2021. Factual probing is [mask]: Learning vs. learning to recall. ArXiv, abs/2104.05240. find our card