Elamur Research⌕
☰
home / papers / 2023 / Fairness-guided Few-shot Prompting for Large Language Models

Fairness-guided Few-shot Prompting for Large Language Models

Paper · 2023 · Huan Ma, Changqing Zhang, Yatao Bian et al.

Summary

In-context learning in large language models is unstable: accuracy can change sharply depending on which few-shot demonstrations are chosen and how they are ordered. The authors address this by treating prompt quality as a question of predictive bias. They feed the model a "content-free" input that carries no task information, together with a candidate prompt. They then measure how far the resulting label distribution is from uniform, and call this score fairness. It needs only one forward pass and no development set. Experiments show that fairer prompts tend to give higher task accuracy. On this basis they propose two search methods over a labeled pool of N examples. T-fair-Prompting ranks single demonstrations by their individual bias and keeps the top-k. G-fair-Prompting greedily adds whichever demonstration most improves the fairness of the growing prompt. Tested on GPT-3, BLOOM and LLaMA across several classification tasks, the greedy variant comes close to exhaustive search and often beats prior selection methods. This makes it a cheap, interpretable option for black-box LLM APIs.

Key points

  • Models evaluated include GPT-3, BLOOM (176B), GPT2-XL (1.5B) and LLaMA (7B, 13B, 33B, 65B). Datasets include AGNews (topic), TREC (question classification), CoLA (acceptability) and RTE.
  • T-fair-Prompting runs in O(N). G-fair-Prompting costs up to O(N²) in the worst case and consistently outperforms the top-k variant. Using 2 demonstrations often beat using 4 by more than 5%.
  • Exhaustively enumerating 4-shot prompts for RTE on BLOOM took over 120 NVIDIA A100 GPU hours. G-fair-Prompting usually found prompts ranked in the top 20%, and on BLOOM it nearly matched the fairest prompt.
  • Against diversity- and similarity-guided baselines such as KATE, the greedy method gained more than 10% on TREC. The baselines used a training pool 4× larger. KATE stayed best on AGNews.
  • Prompts chosen by G-fair-Prompting without any adjustment generally beat randomly chosen prompts with calibration-before-use. Post-calibration sometimes reduced accuracy, though it added about 10% on BLOOM-TREC.

Our summary of the paper, in our own words — not its text. The work belongs to its authors; read it at the links above.

 Institutions

 Fields, topics and concepts

Cite

Cite as Huan Ma, Changqing Zhang, Yatao Bian, Lemao Liu, Zhirui Zhang, Peilin Zhao, Shu Zhang, Huazhu Fu, Qinghua Hu and Bingzhe Wu. 2023. Fairness-guided Few-shot Prompting for Large Language Models. arXiv:2303.13217.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.48550/arxiv.2303.13217 · arXiv 2303.13217

@misc{ma2023fairness,
  title = {{Fairness-guided Few-shot Prompting for Large Language Models}},
  author = {Huan Ma, Changqing Zhang, Yatao Bian, Lemao Liu, Zhirui Zhang, Peilin Zhao, Shu Zhang, Huazhu Fu, Qinghua Hu and Bingzhe Wu},
  year = {2023},
  doi = {10.48550/arxiv.2303.13217},
  eprint = {2303.13217},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.2303.13217}
}

References

23 references, 13 of them with a card of ours. ↗ leads to the work, «find» searches for one we have no id for yet.

  1. Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chri… — Language Models are Few-Shot Learners
  2. Bloom: A 176b-parameter open-access multilingual language model. https://huggingface.co/bigscience/bloom. ↗
  3. Fabio Petroni, Tim Rocktäschel, Patrick Lewis, Anton Bakhtin, Yuxiang Wu, Alexander H Miller, and Sebastian Riedel. Language models as knowledge bases? arXiv preprint arXiv:1909.01066, 2019.
  4. Yao Lu, Max Bartolo, Alastair Moore, Sebastian Riedel, and Pontus Stenetorp. Fantastically ordered prompts and where to find them: Overcoming few-shot prompt order sensitivity. In ACL, 2021.
  5. Feng Nie, Meixi Chen, Zhirui Zhang, and Xu Cheng. Improving few-shot performance of language models via nearest neighbor calibration. arXiv preprint arXiv:2212.02216, 2022. — [arXiv:2212.02216](https://arxiv.org/abs/2212.02216) find
  6. Pengfei Liu, Weizhe Yuan, Jinlan Fu, Zhengbao Jiang, Hiroaki Hayashi, and Graham Neubig. Pre-train, prompt, and predict: A systematic survey of prompting methods in natural language processing. ACM Computing Surveys, 55(9):1–35, 2023.
  7. Xiang Lisa Li and Percy Liang. Prefix-tuning: Optimizing continuous prompts for generation, 2021. find
  8. Xiao Liu, Kaixuan Ji, Yicheng Fu, Zhengxiao Du, Zhilin Yang, and Jie Tang. P-tuning v2: Prompt tuning can be comparable to fine-tuning universally across scales and tasks. arXiv preprint arXiv:2110.07602, 2021.
  9. Karen Hambardzumyan, Hrant Khachatrian, and Jonathan May. Warp: Word-level adversarial reprogramming. arXiv preprint arXiv:2101.00121, 2021. find
  10. Guanghui Qin and Jason Eisner. Learning how to ask: Querying lms with mixtures of soft prompts. arXiv preprint arXiv:2104.06599, 2021.
  11. Xiao Liu, Yanan Zheng, Zhengxiao Du, Ming Ding, Yujie Qian, Zhilin Yang, and Jie Tang. Gpt understands, too. arXiv preprint arXiv:2103.10385, 2021.
  12. Zhuosheng Zhang, Aston Zhang, Mu Li, and Alex Smola. Automatic chain of thought prompting in large language models. arXiv preprint arXiv:2210.03493, 2022.
  13. Claudio Gentile, Zhilei Wang, and Tong Zhang. Fast rates in pool-based batch active learning. arXiv preprint arXiv:2202.05448, 2022. — [arXiv:2202.05448](https://arxiv.org/abs/2202.05448) find
  14. Shizhe Diao, Pengcheng Wang, Yong Lin, and Tong Zhang. Active prompting with chain-of-thought for large language models. arXiv preprint arXiv:2302.12246, 2023. find
  15. Jiachang Liu, Dinghan Shen, Yizhe Zhang, Bill Dolan, Lawrence Carin, and Weizhu Chen. What makes good in-context examples for gpt-3? arXiv preprint arXiv:2101.06804, 2021.
  16. Freda Shi, Xinyun Chen, Kanishka Misra, Nathan Scales, David Dohan, Ed Chi, Nathanael Schärli, and Denny Zhou. Large language models can be easily distracted by irrelevant context. arXiv preprint arXiv:2302.00093, 2023.
  17. https://openai.com/blog/chatgpt. ↗
  18. Tony Z. Zhao, Eric Wallace, Shi Feng, Dan Klein, and Sameer Singh. Calibrate before use: Improving few-shot performance of language models. In ICML, 2021.
  19. Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, Aurelien Rodriguez, Armand Joulin, Edouard Grave, and Guillaume Lample. Llama: Open and efficient foundation language models. arXiv preprint…
  20. Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. Technical Report, 2018. find
  21. Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R Bowman. Glue: A multi-task benchmark and analysis platform for natural language understanding. arXiv preprint arXiv:1804.07461, 2018.
  22. Ben Wang and Aran Komatsuzaki. GPT-J-6B: A 6 Billion Parameter Autoregressive Language Model. https://github.com/kingoflolz/mesh-transformer-jax, May 2021. ↗
  23. https://huggingface.co/EleutherAI/gpt-neox-20b. ↗

Updated

↑ back to top

This page in Markdown → https://md.research.elamur.ai/free/en/papers/ma-2023-fairness-guided-few-shot-prompting/