Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity
Written for the Research library (claude-opus-5-5) from the paper text. Original — aclanthology.org/2022.acl-long.556.pdf
Summary
In-context learning lets large language models such as GPT-2 and GPT-3 classify text after seeing only a few labelled examples in the prompt. This paper shows that the order of those examples matters a great deal. Rearranging the same handful of samples can move accuracy from close to state-of-the-art down to chance level. The authors examine this across GPT-2 and GPT-3 models from 0.1B to 175B parameters. The sensitivity persists at every scale and with more examples, and good orderings do not carry over from one model to another.
Picking an order with a labelled development set would break the true few-shot assumption. Instead, the authors have the model itself generate an unlabelled "probing set." They then rank candidate permutations with entropy-based statistics (LocalE and GlobalE) computed over the labels the model predicts on that set. This favours orders whose predicted labels are not skewed toward one class.
Across eleven text classification tasks, the selection yields roughly a 13% relative improvement on average. Because it needs no extra annotated data, it makes few-shot prompting more dependable.
Key points
- Setup. Four balanced SST-2 samples in all 24 possible orders were tested on GPT-2 (0.1B–1.5B) and GPT-3 (2.7B–175B). Some orders exceeded 85–90% accuracy, while others stayed near 50%.
- Orders don't transfer between models. One permutation dropped from 88.7% on GPT2-XL to 51.6% on GPT2-Large. Spearman correlation of permutation rankings between the 2.7B and 175B models was only 0.05, and label-pattern orderings were similarly inconsistent.
- Why bad prompts fail. They tend to produce heavily imbalanced predicted label distributions. Calibration (Zhao et al., 2021) raises accuracy but leaves high variance across orders.
- Larger models and harder tasks. On CB, GlobalE selection added 4.9% for GPT-3 175B. On CB and RTE, the smaller GPT-2 models stayed near random baseline performance regardless of selection.
- Comparison with a held-out split. Both entropy metrics beat the alternative of splitting the 4-shot training data into train and validation halves for SST-2, at every model size.
Cited by
- Many-Shot In-Context Learning
- In-context Examples Selection for Machine Translation
- MEGA: Multilingual Evaluation of Generative AI
- Knowledge-Augmented Language Model Prompting for Zero-Shot Knowledge Graph Question Answering
- Leak, Cheat, Repeat: Data Contamination and Evaluation Malpractices in Closed-Source LLMs
- RLPrompt: Optimizing Discrete Text Prompts with Reinforcement Learning
- A Survey on In-context Learning
- Towards Measuring the Representation of Subjective Global Opinions in Language Models
- Promptbreeder: Self-Referential Self-Improvement Via Prompt Evolution
- Complexity-Based Prompting for Multi-Step Reasoning
- Surface Form Competition: Why the Highest Probability Answer Isn't Always Right
- Unnatural Instructions: Tuning Language Models with (Almost) No Human Labor
- TrustLLM: Trustworthiness in Large Language Models
- OPT-IML: Scaling Language Model Instruction Meta Learning through the Lens of Generalization
- Maieutic Prompting: Logically Consistent Reasoning with Recursive Explanations
- Challenges and Applications of Large Language Models
- Large language models are zero-shot reasoners
- Making Language Models Better Reasoners with Step-Aware Verifier
- GPT Understands, Too
- Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processing
- Dynamic Prompt Learning via Policy Gradient for Semi-structured Mathematical Reasoning
- Augmented Language Models: a Survey
- Noisy Channel Language Model Prompting for Few-Shot Text Classification
- Recent Advances in Natural Language Processing via Large Pre-Trained Language Models: A Survey
- Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?
- Reframing Instructional Prompts to GPTk's Language
- True Few-Shot Learning with Language Models
- Discovering Language Model Behaviors with Model-Written Evaluations
- Automatic Prompt Optimization with ``Gradient Descent'' and Beam Search
- Reasoning with Language Model Prompting: A Survey
- Large Language Models are Effective Text Rankers with Pairwise Ranking Prompting
- Language Models Are Greedy Reasoners: A Systematic Formal Analysis of Chain-of-Thought
- Want To Reduce Labeling Cost? GPT-3 Can Help
- Self-Consistency Improves Chain of Thought Reasoning in Language Models
- DecodingTrust: A Comprehensive Assessment of Trustworthiness in GPT Models
- GPT-NER: Named Entity Recognition via Large Language Models
- The Rise and Potential of Large Language Model Based Agents: A Survey
- Adaptive Chameleon or Stubborn Sloth: Revealing the Behavior of Large Language Models in Knowledge Conflicts
- Harnessing the Power of LLMs in Practice: A Survey on ChatGPT and Beyond
- Large Language Models as Optimizers
- Active Example Selection for In-Context Learning
- Sentiment Analysis in the Era of Large Language Models: A Reality Check
- A Survey of Large Language Models
- Large Language Models Are Human-Level Prompt Engineers
Cite
@inproceedings{lu2022fantastically,
title = {{Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity}},
author = {Lu, Yao and Bartolo, Max and Moore, Alastair and Riedel, Sebastian and Stenetorp, Pontus},
booktitle = {Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
year = {2022},
doi = {10.18653/v1/2022.acl-long.556},
eprint = {2104.08786},
archivePrefix = {arXiv},
url = {https://doi.org/10.18653/v1/2022.acl-long.556}
}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
- Ido Dagan, Oren Glickman, and Bernardo Magnini. 2005. The pascal recognising textual entailment challenge. In Machine Learning Challenges Workshop, pages 177–190. Springer. find
- Joe Davison, Joshua Feldman, and Alexander M Rush. 2019. Commonsense knowledge mining from pre-trained models. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 117… find
- Marie-Catherine De Marneffe, Mandy Simons, and Judith Tonhauser. 2019. The commitmentbank: Investigating projection in naturally occurring discourse. In proceedings of Sinn und Bedeutung, pages 107– 124. find our card
- Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. Bert: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies,… 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
- Minqing Hu and Bing Liu. 2004. Mining and summarizing customer reviews. In Proceedings of the tenth ACM SIGKDD international conference on Knowledge discovery and data mining, pages 168–177. find
- Zhengbao Jiang, Frank F Xu, Jun Araki, and Graham Neubig. 2020. How can we know what language models know? Transactions of the Association for Computational Linguistics, 8:423–438. find our card
- Ankit Kumar, Ozan Irsoy, Peter Ondruska, Mohit Iyyer, James Bradbury, Ishaan Gulrajani, Victor Zhong, Romain Paulus, and Richard Socher. 2016. Ask me anything: Dynamic memory networks for natural language processing. In International conference on machine learning, pages 1378–1387. PMLR. find our card
- 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
- 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
- Bo Pang and Lillian Lee. 2004. A sentimental education: Sentiment analysis using subjectivity summarization based on minimum cuts. In Proceedings of the 42nd Annual Meeting of the Association for Computational Linguistics (ACL-04), pages 271–278. find
- Bo Pang and Lillian Lee. 2005. Seeing stars: Exploiting class relationships for sentiment categorization with respect to rating scales. In Proceedings of the 43rd Annual Meeting of the Association for Computational Linguistics (ACL’05), pages 115–124. find
- Romain Paulus, Caiming Xiong, and Richard Socher. 2018. A deep reinforced model for abstractive summarization. In International Conference on Learning Representations. find our card
- Ethan Perez, Douwe Kiela, and Kyunghyun Cho. 2021. True few-shot learning with language models. arXiv preprint arXiv:2105.11447. find our card
- Matthew Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. 2018. Deep contextualized word representations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technolog… find
- 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. In Automated Knowledge Base Construction. find our card
- Fabio Petroni, Tim Rocktäschel, Sebastian Riedel, Patrick Lewis, Anton Bakhtin, Yuxiang Wu, and Alexander Miller. 2019. Language models as knowledge bases? In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural… find our card
- A. Radford, Jeffrey Wu, R. Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019. Language models are unsupervised multitask learners. In OpenAI Blog. find
- Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21:1–67. find
- Timo Schick and Hinrich Schütze. 2020. It’s not just size that matters: Small language models are also few-shot learners. arXiv preprint 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:2010.15980. arXiv preprint Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew Y Ng… find our card
- Ellen M Voorhees and Dawn M Tice. 2000. Building a question answering test collection. In Proceedings of the 23rd annual international ACM SIGIR conference on Research and development in information retrieval, pages 200–207. find
- Janyce Wiebe, Theresa Wilson, and Claire Cardie. 2005. Annotating expressions of opinions and emotions in language. Language resources and evaluation, 39(2):165–210. 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
- Xiang Zhang, Junbo Zhao, and Yann Lecun. 2015. Character-level convolutional networks for text classification. Advances in Neural Information Processing Systems, 2015:649–657. find our card
- Tony Z Zhao, Eric Wallace, Shi Feng, Dan Klein, and Sameer Singh. 2021. Calibrate before use: Improving few-shot performance of language models. arXiv preprint arXiv:2102.09690. find our card
- Dataset Prompt Label Mapping SST-2 Review: contains no wit , only labored gags Sentiment: negative positive/negative SST-5 Review: apparently reassembled from the cutting-room floor of any given daytime soap . Sentiment: terrible terrible/bad/okay/good/great MR Review: lame sweet home leaves no sout… find
- Balanced 2 5 2 2 2 2 6 4 14 3 2 12.4 23.1 25.7 22.1 3.9 28.9 11.6 53.8 65.5 69.7/8.4 55.3/11.9 Yes No Yes Yes Yes Yes No Yes Yes No Yes *Table 8: Statistics of evaluation datasets, average length is calculated based on GPT-2 sentence-piece length. For sentence-pair tasks, we report each sentence’s a… find