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.
Institutions
Fields, topics and concepts
📚 Shelves 4The field of science this work belongs to (OpenAlex fields).Computer Science · 16,667 worksArtificial Intelligence · 16,194 worksArts and Humanities · 16,039 worksLanguage and Linguistics · 15,891 works
🧭 Topics 2Research subjects and languages the work is about.Language models & pretraining · 3,320 worksBias, fairness & safety · 517 works
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.
@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
- 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
- Bloom: A 176b-parameter open-access multilingual language model. https://huggingface.co/bigscience/bloom. ↗
- 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.
- 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.
- 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
- 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.
- Xiang Lisa Li and Percy Liang. Prefix-tuning: Optimizing continuous prompts for generation, 2021. find
- 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.
- Karen Hambardzumyan, Hrant Khachatrian, and Jonathan May. Warp: Word-level adversarial reprogramming. arXiv preprint arXiv:2101.00121, 2021. find
- Guanghui Qin and Jason Eisner. Learning how to ask: Querying lms with mixtures of soft prompts. arXiv preprint arXiv:2104.06599, 2021.
- Xiao Liu, Yanan Zheng, Zhengxiao Du, Ming Ding, Yujie Qian, Zhilin Yang, and Jie Tang. Gpt understands, too. arXiv preprint arXiv:2103.10385, 2021.
- Zhuosheng Zhang, Aston Zhang, Mu Li, and Alex Smola. Automatic chain of thought prompting in large language models. arXiv preprint arXiv:2210.03493, 2022.
- 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
- 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
- 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.
- 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.
- https://openai.com/blog/chatgpt. ↗
- 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.
- 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…
- Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. Technical Report, 2018. find
- 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.
- Ben Wang and Aran Komatsuzaki. GPT-J-6B: A 6 Billion Parameter Autoregressive Language Model. https://github.com/kingoflolz/mesh-transformer-jax, May 2021. ↗
- https://huggingface.co/EleutherAI/gpt-neox-20b. ↗
Updated
This page in Markdown → https://md.research.elamur.ai/free/en/papers/ma-2023-fairness-guided-few-shot-prompting/